コード例 #1
0
ファイル: ChaseState.cs プロジェクト: weej89/PsychoticGameDev
    /// <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);
    }
コード例 #2
0
    /// <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);
    }
コード例 #3
0
    /// <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>();
    }
コード例 #4
0
ファイル: EnemySight.cs プロジェクト: weej89/PsychoticGameDev
 // Use this for initialization
 void Start()
 {
     col = GetComponent<SphereCollider>();
     ai = GetComponent<HorrorAI>();
 }
コード例 #5
0
 // Use this for initialization
 void Start()
 {
     anim = GetComponent<Animator>();
     zombie = GetComponent<HorrorAI>();
 }