HeroAttackController.cs 750 Bytes
Newer Older
1 2 3
using UnityEngine;
using System.Collections;

4
public class HeroAttackController : MonoBehaviour {
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27

    enum ability {fireball, water, others };

    private ability currentAbility = ability.fireball;

	// Use this for initialization
	void Start () {
       
	}

    // Update is called once per frame
    void Update(){
        if (Input.GetButtonDown("Fire1")){
            switch (currentAbility)
            {
                case ability.fireball:
                    Debug.Log("fireball");
                    break;
                default:
                    Debug.Log("default");
                    break;
            }

28
        }
29 30 31 32 33 34 35
        if (Input.GetButtonDown("Fire2")){
                Debug.Log("melee");
        }
    }
       
}