コード例 #1
0
	void Awake () {
		wanderState = new WanderState (wanderTimeMin, wanderTimeMax, wanderSpeed, wanderRadius);
		idleState = new IdleState (idleTime);
		chaseState = new ChaseState (chaseTime, chaseSpeed);
		attackState = new AttackState ();
		deadState = new DeadState ();
		leaveAltarState = new LeaveAltarState ();
	}
コード例 #2
0
    private void Awake()
    {
        wanderState = new WanderState (this); // huntStart = new HuntState (this); May replace with this
        idleState = new IdleState (this); // huntStart = new HuntState (this); May replace with this
        forageState = new ForageState (this);
        flightState = new FlightState (this);
        pursuitState = new PursuitState (this);
        exitState = new ExitState (this);
        enterState = new EnterState (this);
        navMeshAgent = GetComponent<NavMeshAgent>();

        navMeshAgent.enabled = true;
        // navMeshObstacle.enabled = false;

        navMeshRadius = navMeshAgent.radius;

        navMeshAgent.avoidancePriority = Random.Range(0, 100);  // Randomly set the avoidance priority
    }