public TaskNPCBehavior(int theNPCDataID, TaskNPCBehavior.TaskNPCState theTaskNPCState) { this.npcDataID = theNPCDataID; this.npcState = theTaskNPCState.state; this.npcPosition = theTaskNPCState.Position; this.npcDirection = theTaskNPCState.Direction; }
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(); }
public override void ApplyDefaultState() { TaskNPCBehavior.TaskNPCState.TaskNPCStateType taskNPCStateType = this.npcState; if (taskNPCStateType != TaskNPCBehavior.TaskNPCState.TaskNPCStateType.Follow) { this.SetDefaultFixStand(); } else { this.SetDefaultFollowSelf(); } this.UpdateCollider(); }
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(); }