Esempio n. 1
0
 public TaskNPCBehavior(int theNPCDataID, TaskNPCBehavior.TaskNPCState theTaskNPCState)
 {
     this.npcDataID    = theNPCDataID;
     this.npcState     = theTaskNPCState.state;
     this.npcPosition  = theTaskNPCState.Position;
     this.npcDirection = theTaskNPCState.Direction;
 }
Esempio n. 2
0
 public override void Release()
 {
     this.npcDataID          = 0;
     this.npcState           = TaskNPCBehavior.TaskNPCState.TaskNPCStateType.None;
     this.animator           = null;
     this.navMeshAgent       = null;
     this.notTriggerCollider = null;
     this.triggerCollider    = null;
     base.Release();
 }
Esempio n. 3
0
 public override void ApplyDefaultState()
 {
     TaskNPCBehavior.TaskNPCState.TaskNPCStateType taskNPCStateType = this.npcState;
     if (taskNPCStateType != TaskNPCBehavior.TaskNPCState.TaskNPCStateType.Follow)
     {
         this.SetDefaultFixStand();
     }
     else
     {
         this.SetDefaultFollowSelf();
     }
     this.UpdateCollider();
 }
Esempio n. 4
0
 public override void UpdateState(object state)
 {
     if (this.npcState == TaskNPCBehavior.TaskNPCState.TaskNPCStateType.Die)
     {
         return;
     }
     TaskNPCBehavior.TaskNPCState taskNPCState = state as TaskNPCBehavior.TaskNPCState;
     if (taskNPCState == null)
     {
         return;
     }
     if (this.npcState == taskNPCState.state && (this.npcPosition.x == taskNPCState.Position.x & this.npcPosition.z == taskNPCState.Position.z) && this.npcDirection.x == taskNPCState.Direction.x && this.npcDirection.z == taskNPCState.Direction.z)
     {
         return;
     }
     this.npcState     = taskNPCState.state;
     this.npcPosition  = taskNPCState.Position;
     this.npcDirection = new Vector3(taskNPCState.Direction.x, 0f, taskNPCState.Direction.z);
     this.UpdateCollider();
 }