public void CheckForScared() { if (Vector3.Distance(this.transform.position, PlayerManager.Instance.gameObject.transform.position) < personality.distanceCheck) { this.currentEmotion = frightened; } }
private void Update() { if (currentEmotion != normal) { emotionTimeCounter += Time.deltaTime; if (emotionTimeCounter >= personality.resetEmotionTime) { GameObject frontWalkway = this.gameObject.GetComponent <NpcCivMoveWalk>().RayCastDown(); if (frontWalkway != null && frontWalkway.tag == "Concrete") { currentEmotion = normal; emotionTimeCounter = 0; } } } }
void Awake() { currentEmotion = normal; }