[英]error CS0246, unity cannot find a namespace
我會盡量總結我的問題,但我對使用這個程序很陌生。
我想統一引用一個游戲管理器,以便我可以使用我在不同腳本中創建的某些值。 完整的錯誤是這樣的:
Assets\\FightingIdle.cs(8,12):錯誤 CS0246:找不到類型或命名空間名稱“GameManager”(您是否缺少 using 指令或程序集引用?)
這是我的代碼:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class FightingIdle : MonoBehaviour
{
public GameManager GM;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
void VechtKnop()
{
GM.FightPoints += GM.FightDamage;
}
}
問題出現在這里:'public GameManager GM;'
由於某種原因,unity 找不到類型/命名空間。 誰能幫我解決這個問題?
GameManger.cs
namespace <anything>
開頭的行<anything>
using <anything>
將其添加到 FightingIdle 的頂部
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.