Exemplo n.º 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);
     }
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public void SwitchToAgent(NavAgent agent)
 {
     CurrentAgent = agent;
 }
Exemplo n.º 4
0
 public void FindPathDone_OnlyMainThread(NavAgent agent, bool found)
 {
     ThreadHelper.MainThreadInvoke(() => EmitMoveEvent(agent, found, agent.TargetEnemy));
 }
Exemplo n.º 5
0
 public void MoveAgent(NavAgent agent, Vector3Int start, Vector3Int end, AgentRemote enemy)
 {
     agent.AsyncStartMove(start, end, enemy);
 }