0
그래서이 유니티를 업데이트하기 전에 잘 작동하지만, 내가 업데이트 후 나는 '사용되지 않습니다 :`대신 false로 isStopped 설정'이 두 오류유니티 탐색 NavMeshAgent
UnityEngine.AI.NavMeshAgent.Resume()를 받고 계속
UnityEngine.AI.NavMeshAgent.Stop()는 '구식이다 :`true로 isStopped을 설정하는 대신'
이 내 코드
public class Navigation : Interaction
{
public float RelaxDistance = 5;
private NavMeshAgent agent;
private Vector3 target = Vector3.zero;
private bool selected = false;
private bool isActive = false;
public override void DeSelect()
{
selected = false;
}
public override void Select()
{
selected = true;
}
public void SendToTarget()
{
agent.SetDestination(target);
agent.Resume();
isActive = true;
}
void Start()
{
agent = GetComponent<NavMeshAgent>();
}
// Update is called once per frame
void Update()
{
if (selected && Input.GetMouseButtonDown(1))
{
var tempTarget = RtsManager.Current.ScreenPointToMapPosition(Input.mousePosition);
if (tempTarget.HasValue)
{
target = tempTarget.Value;
SendToTarget();
}
}
if (isActive && Vector3.Distance(target, transform.position) < RelaxDistance)
{
agent.Stop();
isActive = false;
}
}}
내 프리 팹은 NavMeshAgent 그리고 내가 rebak이 있습니다 에드 지형 .. 난 그냥 포인트가 될 필요가 방향 또는 힌트
나는 이미 그 일을 했어 .... –
무슨 뜻인가요? 여전히 오류가 발생합니까? –
정직하게 일했는데 화합을 다시 시작해야하는 이유가 있었어. –