void IMonsterState.End() { // Teleport to new pos Vector3 pos = MonsterHidingPointStorage.GetRandomPoint().transform.position; monsterController.transform.position = pos; }
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; }
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; }