Beispiel #1
0
        public void Start()
        {
            var boxController = GetComponent <BoxController>();

            _stateMachineAI = new StateMachineAI();

            var idleState = new IdleState(transform.gameObject);
            var warnState = new WarnState(transform.gameObject, boxController);

            _stateMachineAI.States.Add(idleState);
            _stateMachineAI.States.Add(warnState);

            _stateMachineAI.SetCurrentState("Idle");
        }
        public void Start()
        {
            var roomController = GetComponent <RoomController>();

            _stateMachineAI = new StateMachineAI();

            var waitState     = new WaitState(transform.gameObject);
            var fightState    = new FightState(transform.gameObject, roomController);
            var completeState = new CompleteState();

            _stateMachineAI.States.Add(waitState);
            _stateMachineAI.States.Add(fightState);
            _stateMachineAI.States.Add(completeState);

            _stateMachineAI.SetCurrentState("Wait");
        }
Beispiel #3
0
 public IdleState(StateMachineAI stateMachineAI)
 {
     stateMachine = stateMachineAI;
 }
Beispiel #4
0
 public AttackState(StateMachineAI stateMachineAI)
 {
     stateMachine = stateMachineAI;
 }
Beispiel #5
0
	public ChaseState(StateMachineAI stateMachineAI) {
		stateMachine = stateMachineAI;
		triggerWidth = stateMachine.GetComponent<SphereCollider>().bounds.size.z;
	}
Beispiel #6
0
	public PatrolState(StateMachineAI stateMachineAI) {
		stateMachine = stateMachineAI;
		currentNodeInt = Random.Range(0, stateMachine.patrolNodes.Length);
		currentNode = stateMachine.patrolNodes[currentNodeInt].position;
	}
Beispiel #7
0
	public IdleState(StateMachineAI stateMachineAI) {
		stateMachine = stateMachineAI;
	}
Beispiel #8
0
	public AttackState(StateMachineAI stateMachineAI) {
		stateMachine = stateMachineAI;
	}
Beispiel #9
0
 public ChaseState(StateMachineAI stateMachineAI)
 {
     stateMachine = stateMachineAI;
     triggerWidth = stateMachine.GetComponent <SphereCollider>().bounds.size.z;
 }
Beispiel #10
0
 public PatrolState(StateMachineAI stateMachineAI)
 {
     stateMachine   = stateMachineAI;
     currentNodeInt = Random.Range(0, stateMachine.patrolNodes.Length);
     currentNode    = stateMachine.patrolNodes[currentNodeInt].position;
 }