예제 #1
0
    private void Fire()
    {
        float   startX = (1 - mBoltCount) / 2f * mBoltGap;
        Vector3 pos    = mBoltPos.position;

        pos.x += startX;
        for (int i = 0; i < mBoltCount; i++)
        {
            Bolt newBolt = mPool.GetFromPool();
            newBolt.SetTargetTag("Enemy");
            newBolt.transform.position = pos;
            pos.x += mBoltGap;
        }

        if (mSupporterFlag)
        {
            for (int i = 0; i < mSupporterBoltPosArr.Length; i++)
            {
                Bolt newBolt = mPool.GetFromPool();
                newBolt.SetTargetTag("Enemy");
                newBolt.transform.position = mSupporterBoltPosArr[i].position;
            }
        }

        mSoundController.PlayEffectSound((int)eSoundType.FirePlayer);
    }
예제 #2
0
파일: Boss.cs 프로젝트: zoe0526/Unity-1908
    private IEnumerator AutoFire()
    {
        WaitForSeconds oneSec = new WaitForSeconds(1);

        while (true)
        {
            yield return(oneSec);

            Bolt bolt = mBoltPool.GetFromPool(1);
            bolt.SetTargetTag("Player");
            bolt.transform.position = mBoltPos.position;
            mSoundController.PlayEffectSound((int)eSoundType.FireEnem);
        }
    }
예제 #3
0
파일: Enemy.cs 프로젝트: zoe0526/Unity-1908
    private IEnumerator AutoFire()
    {
        WaitForSeconds fireRate = new WaitForSeconds(.6f);

        while (true)
        {
            yield return(fireRate);

            Bolt newBolt = mBoltPool.GetFromPool();
            newBolt.SetTargetTag("Player");
            newBolt.transform.position = mBoltPos.position;
            newBolt.transform.rotation = mBoltPos.rotation;
            mSoundController.PlayEffectSound((int)eSoundType.FireEnem);
        }
    }