예제 #1
0
    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;
        }
    }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     controller   = GetComponent <CharacterController> ();
     currState    = MinionState.Forward;
     currRotation = Vars.Rotation.forward;
 }