public void toDazeState() { enemy.agent.enabled = false; enemy.shouldBeDazed = false; enemy.isDazed = true; enemy.dazeTime = Time.time; enemy.originalColor = enemy.GetComponentInChildren <MeshRenderer>().material.color; enemy.GetComponentInChildren <MeshRenderer>().material.color = Color.blue; enemy.currentState = enemy.dazeState; }
public void UpdateState() { if (Time.time > enemy.dazeTime + 2f) { enemy.GetComponentInChildren <MeshRenderer>().material.color = enemy.originalColor; ToChaseState(); } }