Пример #1
0
    void IMonsterState.End()
    {
        // Teleport to new pos
        Vector3 pos = MonsterHidingPointStorage.GetRandomPoint().transform.position;

        monsterController.transform.position = pos;
    }
Пример #2
0
 void IMonsterState.Start()
 {
     if (willMoveForward)
     {
         monsterEyes.ChangeEyeColor(MonsterEyes.EyeColors.green);
         currentDestination = MonsterHidingPointStorage.GetNextPointTowardsCenter(monsterController.transform.position);
         monsterController.monsterNavAgent.destination = currentDestination.transform.position;
     }
     else
     {
         monsterEyes.ChangeEyeColor(MonsterEyes.EyeColors.red);
         currentDestination = MonsterHidingPointStorage.GetNextPointTowardsCenter(monsterController.transform.position);
         monsterController.monsterNavAgent.destination = currentDestination.transform.position;
     }
     monsterController.monsterNavAgent.isStopped = false;
 }
Пример #3
0
    void IMonsterState.Start()
    {
        ace        = monsterController.GetComponent <AudioSource>();
        ace.volume = 8;
        ace.clip   = monsterController.parrotAudio[UnityEngine.Random.Range(0, monsterController.currentIndex)];
        ace.Play();

        if (willMoveForward)
        {
            monsterEyes.ChangeEyeColor(MonsterEyes.EyeColors.green);
            currentDestination = MonsterHidingPointStorage.GetNextPointTowardsCenter(monsterController.transform.position);
            monsterController.monsterNavAgent.destination = currentDestination.transform.position;
        }
        else
        {
            monsterEyes.ChangeEyeColor(MonsterEyes.EyeColors.red);
            currentDestination = MonsterHidingPointStorage.GetNextPointTowardsCenter(monsterController.transform.position);
            monsterController.monsterNavAgent.destination = currentDestination.transform.position;
        }
        monsterController.monsterNavAgent.isStopped = false;
    }