Ich habe vor kurzem die Idee gehabt eine Art Tower Defense Spiel (Erstmals nur für mich zur Übung) in Unity zu programmieren.
Zum einen werden mir folgende Fehler angezeigt:
3× Error CS0246: The type or namespace name 'GizmoType', 'DrawGizmoAttribute' und 'DrawGizmo' could not be found (are you missing a using directive or an assembly reference?)
3× Error CS0103: the name 'GizmoType does not exist in the current context.
Hier erstmal der Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WaypointGizmos : MonoBehaviour
{
private static readonly float Width = 0.5f;
private static readonly float HalfWidth = Width/ 2;
[DrawGizmo(GizmoType.NonSelected I GizmoType.Selected I GizmoType.Pickable, typeof(Waypoint))]
public static void DrawSceneGizmos(Waypoint waypoint, GizmoType gizmoType)
{
DrawStartPoint(waypoint);
DrawOrientation(waypoint);
}
private static void DrawStartPoint(Waypoint waypoint)
{
if (waypoint.PreviousWaypoint)
{
return;
}
Gizmos.color = Color.yellow;
Gizmos.DrawSphere(waypoint.transform.position, HalfWidth);
}
private static void DrawOrientation(Waypoint waypoint)
{
// Code zur Zeichnung der Orientierung
}
}
Zusätzliche Informationen: ich wollte ein Wegpunktsystem programmieren, habe folgendes Tutorial angeschaut: https://youtu.be/33ls0i7FX4o
Also entweder bin ich blind weil ich habe eigentlich alles so gemacht. Ich nutze Visual Studio von Microsoft zum Coden. Vielleicht da ein Problem was ich mir nicht vorstellen kann. Habe den Code von einer KI ( Open AI ChatGPT) überprüfen lassen die hat lediglich folgendes hinzugefügt:
// Code zur Zeichnung der Orientierung
Ich hoffe ihr könnt mir helfen danke im voraus.
Gruß Manuel