void OnTriggerEnter2D(Collider2D col) { //3 types of triggers: turn left, turn right, go to nearest tower. //... Debug.Log("Collide"); switch (col.tag) { case "TurnLeft": currRotation = (Vars.Rotation)((int)(currRotation) + 1); break; case "TurnRight": currRotation = (Vars.Rotation)((int)(currRotation) - 1); break; case "GotoTower": currState = MinionState.ToTower; break; case "Destroy": currState = MinionState.Dead; break; } }
// Use this for initialization void Start() { controller = GetComponent <CharacterController> (); currState = MinionState.Forward; currRotation = Vars.Rotation.forward; }