Example #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);
    }
Example #2
0
    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);
        }
    }
Example #3
0
    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);
        }
    }