コード例 #1
0
    public void addStroageData(Transform bullet, DestoryOption copyBullet, bool stopTimeLine)
    {
        if (bullet != null)
        {
            bullet.parent = _bullectStorage;
        }
        if (stopTimeLine)
        {
            _stopTiLine.Remove(bullet);
            if (_stopTiLine.Count == 0)
            {
                _controlTimeLine.enabled = true;
            }
        }

        if (copyBullet != null)
        {
            _playerBullectList.Remove(copyBullet);
            _allEnemyList.Remove(copyBullet);
            _enemyDestroyList.Remove(copyBullet);
            _allCoinList.Remove(copyBullet);
            _PowerUpList.Remove(copyBullet);
            //_onotherList.Remove(copyBullet);
        }
    }
コード例 #2
0
    public void setDrowStage(Transform bullect, DestoryOption copyBullet, DestoryOption.objectPosition obPoint, bool stopTimeLine, bool NonDestroyChack)
    {
        if (bullect != null)
        {
            bullect.parent = _drowStage;
        }
        //Debug.Log(bullect.name + " " + bullect.parent.name);
        //UnityEditor.EditorApplication.isPaused = true;

        if (stopTimeLine)
        {
            if (_stopTiLine.IndexOf(bullect) < 0)
            {
                _stopTiLine.Add(bullect);
            }
            _controlTimeLine.enabled = false;
        }

        if (!NonDestroyChack && copyBullet != null)
        {
            switch (obPoint)
            {
            case DestoryOption.objectPosition.enemy:
                _allEnemyList.Add(copyBullet);
                if (copyBullet.destroyChack)
                {
                    _enemyDestroyList.Add(copyBullet);
                }
                break;

            case DestoryOption.objectPosition.palyer:
                _playerBullectList.Add(copyBullet);
                break;

            case DestoryOption.objectPosition.coin:
                _allCoinList.Add(copyBullet);
                break;

            case DestoryOption.objectPosition.powerUp:
                _PowerUpList.Add(copyBullet);
                break;
            }
        }

        //_onotherList.Add(copyBullet);
    }
コード例 #3
0
    void controlMoveOption()
    {
        _chaseEndPosition   = _endPosition = Vector3.zero;
        _bullectModeControl = 0;

        _copyVPosition   = _selfTF.position;
        _copyVPosition.y = 0;
        SetDestoryCenter(_copyVPosition);

        switch (_selectFlight.flightType)
        {
        case FlightOption.FlightTypeList.chaser:
            _bullectModeControl = 2;
            bool          noAngleChack    = false;
            DestoryOption copyChaseBullet = null;
            switch (_obPoint)
            {
            case BullectControl.objectPosition.palyer:
                copyChaseBullet = _destroyOption._collistionControl.enemyChasePosition(_copyVPosition);
                if (copyChaseBullet == null)
                {
                    noAngleChack = true;
                    _endPosition = getDirectionValue(FlightOption.LinerTypeList.forward, _baseTFValue);
                    resetRotateTF();
                }
                else
                {
                    _endPosition = copyChaseBullet.LPosition;
                }
                break;

            default:
                _endPosition = _selectFlight.getChasePosition;
                if (_endPosition.Equals(Vector3.zero))
                {
                    _endPosition = _destroyOption._collistionControl.PlayerPosition;
                }

                break;
            }

            if (!noAngleChack)
            {
                if (_LookAtOption && _otherTfChack == 1)
                {
                    switch (_obPoint)
                    {
                    case objectPosition.palyer:
                        //if(_baseTFValue == null)
                        _selfTF.LookAt(copyChaseBullet.VPosition);
                        break;

                    default:
                        _selfTF.LookAt(_endPosition);
                        break;
                    }
                    settingLookAtTF((_otherTfChack == 1 ? _drowSpriteTF : null), _drowSprite, _obPoint, _startSpriteScale);
                }
                _endPosition -= _selfTF.localPosition;
            }
            _chaseEndPosition = _endPosition;
            break;

        case FlightOption.FlightTypeList.liner:
            if (_baseTFValue == null)
            {
                _baseTFValue = _selfTF;
            }

            _endPosition = linerOptionControl(_selectFlight.randomLinerChack, _selectFlight.linerType, _baseTFValue, _selectFlight.randomForwardCount);
            if (_endPosition.Equals(Vector3.zero))
            {
                return;
            }

            if (_selectFlight.randomLinerChack == 2)
            {
                _nextObjectChack = true;
                _nonresetValue   = true;
                _currentCount--;
            }
            if (_LookAtOption && _otherTfChack == 1)
            {
                _selfTF.localEulerAngles = getEulerAnglesValue(_selectFlight.linerType, _baseTFValue);
                settingLookAtTF(_otherTfChack == 1 ? _drowSpriteTF : null, _drowSprite, _obPoint, _startSpriteScale);
            }

            break;

        case FlightOption.FlightTypeList.delay:
            _bullectModeControl = -1;
            return;

        case FlightOption.FlightTypeList.delete:
            stopBulletObject();
            return;

        case FlightOption.FlightTypeList.loop:
            /*_bullectModeControl = -1;
             * _currentCount = 0;
             * _nextObjectChack = true;*/
            _currentCount = _selectFlight.loopStartIndex;
            nextBlockObject();
            return;

        case FlightOption.FlightTypeList.rotate:
            if (_selectFlight.MoveSpeed == 0 && _selectFlight.drowTIme == 0)
            {
                _selfTF.localEulerAngles = getEulerAnglesValue(_selectFlight.linerType, _baseTFValue);
                //settingLookAtTF(_otherTfChack == 1 ? _drowSprite : null , _obPoint, _startSpriteScale);
                nextBlockObject();
                return;
            }

            return;
        }

        _drowPoint   = _endPosition.normalized * _selectFlight.MoveSpeed;
        _drowPoint.y = 0;
        //_backDrowPoint = _endPosition.normalized/2;
    }
コード例 #4
0
    void Update()
    {
        //_allCoinList
        _drowC            = 0;
        _max1Count        = _allCoinList.Count;
        _copyVector3      = _playerControlSC.VPosition;
        _chaseCoinControl = _blockControlSC._chaseCoinControl;
        int playerStatus = _playerControlSC.getPlayerStatus;

        for (_indexC = 0; _indexC < _max1Count; _indexC++)
        {
            _select1TF = _allCoinList[_drowC++];
            if (_select1TF.chackCrushPlayerValue(_copyVector3) > 0)
            {
                _drowC -= 1;
                _playerControlSC.coindCollisionChack();
            }
            else
            {
                _select1TF.coinChaseFlowAct(_chaseCoinControl);
            }
        }

        if (playerStatus == 0)
        {
            _drowC     = 0;
            _max1Count = _PowerUpList.Count;
            for (_indexC = 0; _indexC < _max1Count; _indexC++)
            {
                _select1TF = _PowerUpList[_drowC++];
                if (_select1TF.chackCrushPlayerValue(_copyVector3) > 0)
                {
                    _drowC -= 1;
                    _playerControlSC.PowerUpItemChack();
                }
            }
        }

        _drowC     = 0;
        _max1Count = _allEnemyList.Count;
        for (_indexC = 0; _indexC < _max1Count; _indexC++)
        {
            _drowB       = 0;
            _removeChack = false;
            _select1TF   = _allEnemyList[_drowC++];

            if (_select1TF.destroyChack)
            {
                if (_playerControlSC.colliderBoxChack(_select1TF.destroyBound))
                {
                    if (_select1TF.destroyBullectChack(bladeDelete:true))
                    {
                        _removeChack = true;
                        _drowC      -= 1;
                        _playerControlSC.setScorePlayerBound(PlayerControl.enemyCrushType.blade_Die);
                    }
                    else
                    {
                        _playerControlSC.setScorePlayerBound(PlayerControl.enemyCrushType.blade);
                    }
                }

                if (!_removeChack)
                {
                    _max2Count = _playerBullectList.Count;
                    for (_indexB = 0; _indexB < _max2Count; _indexB++)
                    {
                        _select2TF   = _playerBullectList[_drowB++];
                        _removeChack = true;
                        switch (_select1TF.chackCollisionValue((BullectControl)_select2TF))
                        {
                        case 1:                         // enemy crush
                            _drowC -= 1;
                            _playerControlSC.setScorePlayerBound(PlayerControl.enemyCrushType.bullet_Die);
                            break;

                        case 2:                         // player bullet crush
                            _drowB -= 1;
                            _playerControlSC.setScorePlayerBound(PlayerControl.enemyCrushType.bullet);
                            break;

                        case 3:                         // duth
                            _drowC -= 1;
                            _drowB -= 1;
                            _playerControlSC.setScorePlayerBound(PlayerControl.enemyCrushType.bullet_Die);
                            break;

                        default:                         // miss
                            _removeChack = false;
                            break;
                        }

                        if (_drowB < 0 || _playerBullectList.Count <= _drowB)
                        {
                            break;
                        }
                    }
                }
            }

            if (!_removeChack && !_allstopBulletCreate)
            {
                _removeChack = true;
                switch (_select1TF.chackCrushPlayerValue(_copyVector3))
                {
                case 1:                 // crush player
                    _playerControlSC.playerCollisionChack(_select1TF.VPosition);
                    break;

                case 2:                 // crush of player and bullect
                    _drowC -= 1;
                    _playerControlSC.playerCollisionChack(_select1TF.VPosition);
                    break;

                default:
                    _removeChack = false;
                    break;
                }
            }

            if (_drowC < 0 || _allEnemyList.Count <= _drowC)
            {
                return;
            }
        }
    }