Exemple #1
0
    public override BulletBase CreateBullectValue(bullectOption bullectOp, Transform baseTF, Vector3 startPosition, BulletCreate parentCreate, bool createParent, bool dropPowerUp)
    {
        BullectControl copyBullect = null;

        if (_bullectList.Count == 0)
        {
            copyBullect      = Instantiate(this) as BullectControl;
            copyBullect.name = gameObject.name + "_" + _nameObject++;
            copyBullect.ResetValue();
            copyBullect._originalData = this;
        }
        else
        {
            copyBullect = _bullectList[0];
            _bullectList.RemoveAt(0);
        }

        copyBullect.transform.position = baseTF != null ? baseTF.position : startPosition;
        copyBullect._bullectOp         = bullectOp;
        copyBullect._createBullet      = parentCreate;
        copyBullect._baseTFValue       = baseTF;
        copyBullect.resetCurrent(createParent);

        copyBullect.resetBullet(true);
        copyBullect.nextBlockObject();
        copyBullect._powerOption = dropPowerUp;

        return(copyBullect);
    }
    public override void crushChildBullet(BullectControl copyBullet)
    {
        _lastIndex = _controlBulletList.IndexOf(copyBullet);
        _controlBulletList.Remove(copyBullet);
        for (_deleteIndex = 0; _deleteIndex < _lastIndex; _deleteIndex++)
        {
            _controlBulletList[0].stopBulletObject(notDestroyParent: false);
            _controlBulletList.RemoveAt(0);
        }
        _bulletListCount = _controlBulletList.Count;

        if (_lastIndex > 0)
        {
            _positionRe = false;
        }
        else
        {
            _positionRe = true;
        }

        _changeImgAni = 0;
        if (_changeHead == 0)
        {
            _changeHead = 1;
            _crushEffect.Play(_drowIdleImgName);
        }
    }
    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;
        }
    }
Exemple #4
0
    public override int chackCollisionValue(BullectControl chackBullet)
    {
        _copyMagnitude = returnMagnitude(chackBullet._copyVPosition);
        if (_copyMagnitude < _destroyOption._destroySize || _copyMagnitude < chackBullet._destroyOption._destroySize)
        {
            _returnBulletValue = 0;
            if (destroyBullectChack(false /*chackBullet._backDrowPoint*/))
            {
                _returnBulletValue = 1;
            }
            if (chackBullet.destroyBullectChack(false /*_backDrowPoint*/))
            {
                _returnBulletValue += 2;
            }
            return(_returnBulletValue);
        }

        return(0);
    }
    public virtual void crushChildBullet(BullectControl copyBullet)
    {
        _controlBulletList.Remove(copyBullet);
        _bulletListCount = _controlBulletList.Count;

        /*
         * _lastIndex = _controlBulletList.IndexOf(copyBullet) -1;
         * for(_deleteIndex = 0; _deleteIndex < _lastIndex; _deleteIndex++)
         * {
         *      _controlBulletList[0].stopBulletObject(notDestroyParent:false);
         *      _controlBulletList.RemoveAt(0);
         * }
         * _controlBulletList.RemoveAt(0);*/
        /*
         * if(parentChack != null) {
         *      parentChack.parent = _selfTF;
         *      parentChack.localEulerAngles = Vector3.zero;
         * }
         * Vector3 childCrushPosition = copyBullet.VPosition;
         * _copyEg = _beamBaseImgControl.localScale;
         * _copyEg.y = (childCrushPosition - _selfTF.position).magnitude*3.3f;
         * _beamBaseImgControl.localScale = _copyEg;*/
    }
Exemple #6
0
 public virtual int chackCollisionValue(BullectControl chackBullet)
 {
     return(0);
 }