/// <summary> /// Initializes a new instance of the <see cref="ChaseState"/> class. /// </summary> /// <param name="statePatternEnemy">State pattern enemy.</param> /// <param name="zombie">Zombie.</param> public ChaseState(StatePatternEnemy statePatternEnemy, HorrorAI zombie) { this.enemy = statePatternEnemy; this.zombie = zombie; MakeDecisionTree(); SetNodes(); decisionTree = new DecisionTree(decisions, actions, enemy.AddActionToQueue); }
/// <summary> /// Initializes a new instance of the <see cref="PatrolState"/> class. /// </summary> /// <param name="statePatternEnemy">State pattern enemy.</param> /// <param name="zombie">Zombie.</param> /// <param name="grid">Grid.</param> public PatrolState(StatePatternEnemy statePatternEnemy, HorrorAI zombie, Grid grid) { this.enemy = statePatternEnemy; this.zombie = zombie; this.grid = grid; MakeDecisionTree(); SetNodes(); decisionTree = new DecisionTree(decisions, actions, enemy.AddActionToQueue); }
/// <summary> /// Awake this instance. /// </summary> private void Awake() { GameObject pathFinding = GameObject.Find("Pathfinding"); enemy = GetComponent<HorrorAI>(); grid = pathFinding.GetComponent<Grid>(); enemySight = GetComponent<EnemySight> (); chaseState = new ChaseState(this, enemy); alertState = new AlertState(this, enemy); patrolState = new PatrolState(this, enemy, grid); pathfindingStrategy = "A*"; processedActions = new Queue<TreeAction>(); }
// Use this for initialization void Start() { col = GetComponent<SphereCollider>(); ai = GetComponent<HorrorAI>(); }
// Use this for initialization void Start() { anim = GetComponent<Animator>(); zombie = GetComponent<HorrorAI>(); }