Unity: Lösung für "type or namespace could not be found"?
Hallo,
ich habe gerade angefangen, in Unity zu entwickeln und habe mir dazu ein Tutorial angeschaut. Der Code der dabei in einem C#-Skript herausgekommen ist, sieht folgendermaßen aus:
sing System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameAssets : MonoBehaviour
{
public static GameAssets instance;
private void Awake()
{
instance = this;
}
public Sprite playersprite;
}
In Unity kommt jetzt aber diese Fehlermeldung:
Assets\Scripts\GameAssets.cs(12,10): error CS0246: The type or namespace name 'Sprite' could not be found (are you missing a using directive or an assembly reference?)
Das Skript ist nahezu identisch mit dem aus dem Video (vom 25.1.2019, also eigentlich nicht veraltet), aber funktioniert nicht. Groß-/Kleinschreibung ist nicht das Problem.
LG