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 twist360_36_x(float startR)
    {
        int cnt = 36;

        for (int i = 0; i < cnt; i++)
        {
            GameObject obj = null;
            if (i == cnt - 1)
            {
                obj = _MoverRoot;
            }
            else
            {
                obj = (GameObject)Instantiate(_MoverRoot, transform.position, Quaternion.identity);
            }
            obj.transform.parent        = null;
            obj.transform.localRotation = Quaternion.Euler(0f, 0f, startR + i * 10f);
            wt_Mover mov = obj.GetComponentInChildren <wt_Mover>();
            if (mov)
            {
                mov._isLocalMover = true;
                mov._StartDelay   = i * 0.1f;
                mov.PlayMove();
            }

            Destroy(obj, _Duration);
        }

        Destroy(this.gameObject, _Duration);
    }