报错内容1
Failed to create agent because there is no valid NavMesh
UnityEngine.Object:Instantiate(Object, Vector3, Quaternion)
EnemySpawn:Update() (at Assets/Scripts/EnemySpawn.cs:28)
Transform obj = (Transform)Instantiate(m_enemy,m_transform.position,Quaternion.identity);
报错内容2
"SetDestination" can only be called on an active agent that has been placed on a NavMesh.
UnityEngine.NavMeshAgent:SetDestination(Vector3)
Enemy:Update() (at Assets/Scripts/Enemy.cs:59)
m_agent.SetDestination(m_player.transform.position);
现在又出现这个错误
NullReferenceException: Object reference not set to an instance of an object
Enemy.Update () (at Assets/Scripts/Enemy.cs:83
if (stateInfo.nameHash == Animator.StringToHash ("Base Layer.death") && ! m_ani.IsInTransition (0))
{
if(stateInfo.normalizedTime>=1.0f)
{
m_spawn.m_enemyCount--; //出错的是这一行
GameManager.Instance.SetScore(100);
Destroy(this.gameObject);
}
}
这个怎么处理