//Allows a destination to be set and will use delegate to signal progress public void SetDestination(Vector3 vPosition, AgentStatusChange vArrived) //Set Destination on NavMesh { if (mCheckProgress != null) { StopCoroutine(mCheckProgress); mCheckProgress = null; if (mOnAgentStatusChange != null) { mOnAgentStatusChange(this, Result.Aborted); //Abort last path mOnAgentStatusChange = null; } } mOnAgentStatusChange = vArrived; //Set callback delegate mNMA.SetDestination(vPosition); mCheckProgress = StartCoroutine(CheckProgress()); //Check on Navigation progress }
protected void ClearPath() //Reset Path & remove callback delegate { mNMA.ResetPath(); //Clear path mOnAgentStatusChange = null; //Clear Delegate }