using UnityEngine; using System.Collections; public class HeroAttackController : MonoBehaviour { 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; } } if (Input.GetButtonDown("Fire2")){ Debug.Log("melee"); } } }