예제 #1
0
    private void Fire()
    {
        if (Input.GetKeyDown(KeyCode.F))
        {
            if (_mana >= 15)
            {
                ApplyImpact(-15);

                _FBClone = Instantiate(_fireBall, new Vector3(_shootingPoint.position.x, _shootingPoint.position.y, 0),
                                       transform.rotation);
                _FBClone.transform.localScale = _shootingPoint.localScale;

                switch (_spell)
                {
                case SpellType.Damage:
                    _FBClone.SetColor(Color.red);
                    break;

                case SpellType.Heal:
                    _FBClone.SetColor(Color.green);
                    break;
                }

                _text.text = _mana.ToString();
            }
        }
    }