如何解决之前一切正常,但现在总会给我CS0246错误
我想在游戏中制作一个任务系统,一切正常,但是现在当我添加另一个脚本时,团结一致给我这个错误:Assets \ QuestManager.cs(6,12):error CS0246:类型或名称空间名称找不到“ QuestObject”(您是否缺少using指令或程序集引用?)我该如何解决?很抱歉,如果是斯洛伐克写错了话
在此脚本中告诉我错误
using System.Collections;
using UnityEngine;
public class QuestManager : MonoBehavIoUr
{
public QuestObject[] quests;
public bool[] questCompleted;
public DialogueManager theDM;
public string itemCollected;
public string enemyKilled;
// Start is called before the first frame update
void Start()
{
questCompleted = new bool[quests.Length];
}
// Update is called once per frame
void Update()
{
}
public void ShowQuestText(string questText)
{
theDM.dialogLines = new string[1];
theDM.dialogLines[0] = questText;
theDM.currentLine = 0;
theDM.ShowDialogue();
}
}
我想参考这个脚本
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class QuestObject : MonoBehavIoUr
{
public int questNumber;
public QuestManager theQM;
public string startText;
public string endText;
public bool isItemQuest;
public string targetItem;
public bool isEnemyQuest;
public string targetEnemy;
public int enemiesToKill;
private int enemyKillCount;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if(isItemQuest)
{
if(theQM.itemCollected == targetItem)
{
theQM.itemCollected = null;
EndQuest();
}
}
if(isEnemyQuest)
{
if(theQM.enemyKilled == targetEnemy)
{
theQM.enemyKilled = null;
enemyKillCount++;
}
if(enemyKillCount >= enemiesToKill)
{
EndQuest();
}
}
}
public void StartQuest()
{
theQM.ShowQuestText(startText);
}
public void EndQuest()
{
theQM.ShowQuestText(endText);
theQM.questCompleted[questNumber] = true;
gameObject.SetActive(false);
}
}
有人可以帮我吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。