예제 #1
0
    public void OnAbilityUse(GameObject btn)
    {
        fillImage = btn.transform.GetChild(0).gameObject.GetComponent <Image>();
        //UnityEngine.Debug.Log(btn.transform.GetChild(0).gameObject.name);
        button = btn.GetComponent <Button>();
        button.interactable  = false;
        fillImage.fillAmount = 1;
        cooldownTimer        = new Stopwatch();
        cooldownTimer.Start();

        GameObject go = Instantiate <GameObject>(fireballPrefab);

        go.transform.position = new Vector3(this.transform.position.x, this.transform.position.y + 1f, this.transform.position.z);
        fireball = new FireBall();
        fireball.AbilityPrefab = go;

        StartCoroutine(SpinImage());
        fireball.Activate(gameObject);
    }