예제 #1
0
 //only main thread
 private void EmitMoveEvent(NavAgent agent, bool isFound, AgentRemote enemy)
 {
     if (isFound)
     {
         MovementListener.Move(
             agent.GetMovePath(),
             agent.GetTimes(),
             agent.CurrentPosition,
             agent.Remote,
             enemy);
     }
 }
예제 #2
0
파일: AgentRemote.cs 프로젝트: dqtoy/Assets
        public void Dead()
        {
            Debugger.Log(AgentID + ": dead called from animation");
            unitSubject.Remove(observer);
            deathEvents?.Invoke(this);
            deathEvents = null;


            FixedMove.Stop();
            NavAgent?.Stop();
            Unbinding();
            unitSubject.Remove(observer);
            unitSubject.ObserverPooling.Release(observer);
        }
예제 #3
0
 public void SwitchToAgent(NavAgent agent)
 {
     CurrentAgent = agent;
 }
예제 #4
0
 public void FindPathDone_OnlyMainThread(NavAgent agent, bool found)
 {
     ThreadHelper.MainThreadInvoke(() => EmitMoveEvent(agent, found, agent.TargetEnemy));
 }
예제 #5
0
 public void MoveAgent(NavAgent agent, Vector3Int start, Vector3Int end, AgentRemote enemy)
 {
     agent.AsyncStartMove(start, end, enemy);
 }