Example #1
0
    void Shot_Missile()
    {
        if (_AniController == null)
        {
            return;
        }

        _AniController.PlayAttackShoot(fireRate);
        StartCoroutine(DelayAction(_AniController._ShootDelay, () =>
        {
            GameObject obj     = (GameObject)Instantiate(shot_range, shotSpawn.position, shotSpawn.rotation);
            Vector3 target_pos = GamePlayManager.Instance._PlayerManager._PlayerController.transform.position;
            Vector3 val        = (target_pos - shotSpawn.position).normalized;
            wt_Mover mov       = obj.GetComponent <wt_Mover>();
            if (mov)
            {
                mov._isMulti = true;
                mov._speedX  = val.x * mov.speed;
                mov._speedY  = val.y * mov.speed;
            }

            SetDamageTrigger(obj);
            GetComponent <AudioSource>().Play();
        }));
    }
Example #2
0
    void Shot_Missile()
    {
        if (_AniController == null)
        {
            return;
        }

        _AniController.PlayAttackShoot(_AutoShotRate);
        StartCoroutine(DelayAction(_AniController._ShootDelay, () =>
        {
            GameObject obj = (GameObject)Instantiate(_pfRangeShoot, shotSpawn.position, shotSpawn.rotation);
            SetDamageTrigger(obj);
            GetComponent <AudioSource>().Play();
        }));
    }