示例#1
0
 public void createPowerUpItem(Vector3 _drowPosition)
 {
     if (_PowerControl >= _createBullet.Length)
     {
         return;
     }
     _PowerUpItem.CreateBullectValue(null, _drowPosition, null, false, false);
 }
示例#2
0
    void Update()
    {
        if (!_EnabledControl)
        {
            return;
        }

        switch (_switchOption)
        {
        case 0:
            _currentSpeed += Time.deltaTime;
            if (!_fristChack)
            {
                if (_currentSpeed >= _fistDelayDuration)
                {
                    _currentSpeed = _bullectOption.createSpeed;
                    _fristChack   = true;
                }
                return;
            }

            if (_currentSpeed >= _bullectOption.createSpeed)
            {
                _currentSpeed -= _bullectOption.createSpeed;

                _copyBullet = _bullectOption.CreateBullectValue(_selfTF, Vector3.zero, this, _createParent, --currentPowerOption == 0);
                if (/*_ChildChaseOption &&*/ _copyBullet != null)
                {
                    _controlBulletList.Add(_copyBullet);
                    _bulletListCount = _controlBulletList.Count;
                }

                if (--_copyDrowCount == 0)
                {
                    resetBullet();                     // code clear chack, dumy
                    if (_delayLoopShotTime > 0)
                    {
                        _switchOption   = 1;
                        _EnabledControl = this.enabled = true;
                    }
                }
            }
            break;

        case 1:
            _currentSpeed += Time.deltaTime;
            if (_delayLoopShotTime > _currentSpeed)
            {
                return;
            }

            resetBullet(true);
            break;
        }
    }
示例#3
0
 public void createCoinValue(List <BullectControl> controlBulletList, Vector3 _drowPosition, int number = 0)
 {
     if (controlBulletList != null)
     {
         controlBulletListMaxCount = controlBulletList.Count;
         for (int i = 0; i < controlBulletListMaxCount; i++)
         {
             if (controlBulletList[i].stopBulletObject(notDestroyParent:false))
             {
                 _coinEffect.CreateBullectValue(null, controlBulletList[i].VPosition, null, false, false);
             }
         }
     }
     else
     {
         for (int i = 0; i < number; i++)
         {
             _coinEffect.CreateBullectValue(null, _drowPosition + new Vector3(Random.Range(-0.3f, 0.3f), 0, Random.Range(-0.3f, 0.3f)), null, false, false);
         }
     }
 }
示例#4
0
    bool chackColliderSword(Bounds destroyBound)
    {
        //if (_copyBounds.Contains(destroyBound.min) || _copyBounds.Contains(destroyBound.max)) return false;
        //if (destroyBound.max.x < _copyBounds.min.x || _copyBounds.max.x < destroyBound.min.x) return false;
        //if (destroyBound.max.z < _copyBounds.min.z || _copyBounds.max.z < destroyBound.min.z) return false;

        /*
         * Debug.Log(destroyBound.max.x + " < " + _copyBounds.min.x + " " + (destroyBound.max.x < _copyBounds.min.x) + " .. " +
         *        _copyBounds.max.x + " < " + destroyBound.min.x + " " + (_copyBounds.max.x < destroyBound.min.x) + "\n" +
         *        destroyBound.max.z + " < " + _copyBounds.min.z + " " + (destroyBound.max.z < _copyBounds.min.z) + " .. " +
         *        _copyBounds.max.z + " < " + destroyBound.min.z + " " + (_copyBounds.max.z < destroyBound.min.z));*/

        /*if(Random.Range(0,2) == 0) _createBaldEffect.x = (destroyBound.max.x + _copyBounds.min.x)/2;
         * else _createBaldEffect.x = (destroyBound.min.x + _copyBounds.max.x)/2;
         *
         * _createBaldEffect.z = (destroyBound.max.z + _copyBounds.min.z)*2/5;
         * _bladeEffect.CreateBullectValue(null, _createBaldEffect, null, false);
         *
         * return true;*/

        _boundYChackIndex = _boundXChackIndex = 0;
        if (destroyBound.max.x < _copyBounds.min.x)
        {
            return(false);
        }
        else if (_copyBounds.min.x < destroyBound.max.x)
        {
            _boundXChackIndex = 1;
        }

        if (_copyBounds.max.x < destroyBound.min.x)
        {
            return(false);
        }
        else if (destroyBound.min.x < _copyBounds.max.x)
        {
            _boundXChackIndex += 2;
        }

        if (destroyBound.max.z < _copyBounds.min.z)
        {
            return(false);
        }
        else if (_copyBounds.min.z < destroyBound.max.z)
        {
            _boundYChackIndex = 1;
        }

        if (_copyBounds.max.z < destroyBound.min.z)
        {
            return(false);
        }
        else if (destroyBound.min.z < _copyBounds.max.z)
        {
            _boundYChackIndex += 2;
        }

        switch (_drowSwitchIndex)
        {
        case 1:
        case 2:
            return(true);
        }

        switch (_boundXChackIndex)
        {
        case 1:
            _createBaldEffect.x = (destroyBound.min.x + _copyBounds.max.x) / 2;
            break;

        case 2:
            _createBaldEffect.x = (destroyBound.max.x + _copyBounds.min.x) / 2;
            break;

        case 3:
            _createBaldEffect.x = _copyBounds.center.x;
            break;

        default:
            return(false);
        }

        switch (_boundYChackIndex)
        {
        case 1:
            _createBaldEffect.z = (destroyBound.max.z + _copyBounds.min.z) / 2;
            break;

        case 2:
            _createBaldEffect.z = (destroyBound.min.z + _copyBounds.max.z) / 2;
            break;

        case 3:
            _createBaldEffect.z = destroyBound.center.z;
            break;

        default:
            return(false);
        }

        //_createBaldEffect.z = destroyBound.center.z;
        //_createBaldEffect.z = _selfTF.position.z + _copyBounds.min.z;
        _bladeEffect.CreateBullectValue(null, _createBaldEffect, null, false, false);
        return(true);
    }