Esempio n. 1
0
    public void PlaySlash1()
    {
        _isAutoShot = false;
        _AniController.PlayAttackSlash1(_AutoShotRate);
        StartCoroutine(DelayAction(0.3f, () =>
        {
            GameObject obj = (GameObject)Instantiate(_pfSlash01, transform.position, Quaternion.identity);
            GetComponent <AudioSource>().Play();
        }));

        StartCoroutine(DelayAction(1f, () =>
        {
            _isAutoShot = true;
        }));
    }
Esempio n. 2
0
    void Shot_Melee()
    {
        if (_AniController == null)
        {
            return;
        }

        _AniController.PlayAttackSlash1(fireRate);

        StartCoroutine(DelayAction(_AniController._SlashDelay, () =>
        {
            GameObject obj       = (GameObject)Instantiate(shot_melee, shotSpawn.position, shotSpawn.rotation);
            obj.transform.parent = shotSpawn;

            SetDamageTrigger(obj);
            GetComponent <AudioSource>().Play();

            if (_isDash)
            {
                Vector3 pos = transform.position + new Vector3(_DashValue, 0f, 0f);
                TweenPosition.Begin(this.gameObject, 0.5f, pos).method = UITweener.Method.EaseInOut;
            }
        }));
    }