Beispiel #1
0
    protected Vector3 getDirectionValue(FlightOption.LinerTypeList linerType, Transform baseTFValue)
    {
        Vector3 endPosition = Vector3.zero;

        switch (linerType)
        {
        case FlightOption.LinerTypeList.forward:
            endPosition = baseTFValue.forward;
            break;

        case FlightOption.LinerTypeList.backward:
            endPosition = baseTFValue.forward * -1;
            break;

        case FlightOption.LinerTypeList.left:
            endPosition = baseTFValue.right;
            break;

        case FlightOption.LinerTypeList.right:
            endPosition = baseTFValue.right * -1;             // 플레이어 기준
            break;

        case FlightOption.LinerTypeList.left_forward:
            endPosition = baseTFValue.forward + baseTFValue.right;
            break;

        case FlightOption.LinerTypeList.left_backward:
            endPosition = (baseTFValue.forward * -1) + baseTFValue.right;
            break;

        case FlightOption.LinerTypeList.Right_forward:
            endPosition = baseTFValue.forward + (baseTFValue.right * -1);
            break;

        case FlightOption.LinerTypeList.Right_backward:
            endPosition = (baseTFValue.forward * -1) + (baseTFValue.right * -1);
            break;
        }

        return(endPosition);
    }
Beispiel #2
0
    protected Vector3 getEulerAnglesValue(FlightOption.LinerTypeList linerType, Transform baseTFValue)
    {
        Vector3 EulerAngles = baseTFValue.eulerAngles;

        EulerAngles.x = EulerAngles.z = 0;
        switch (linerType)
        {
        case FlightOption.LinerTypeList.backward:
            EulerAngles.y *= -1;
            break;

        case FlightOption.LinerTypeList.left:
            EulerAngles.y += 90;
            break;

        case FlightOption.LinerTypeList.right:
            EulerAngles.y -= 90;
            break;

        case FlightOption.LinerTypeList.left_forward:
            EulerAngles.y += 45;
            break;

        case FlightOption.LinerTypeList.left_backward:
            EulerAngles.y += 135;
            break;

        case FlightOption.LinerTypeList.Right_forward:
            EulerAngles.y -= 45;
            break;

        case FlightOption.LinerTypeList.Right_backward:
            EulerAngles.y -= 135;
            break;
        }

        return(EulerAngles);
    }
Beispiel #3
0
    protected Vector3 linerOptionControl(int randomLinerChack, FlightOption.LinerTypeList linerType, Transform baseTFValue, int randomCount)
    {
        Vector3 endPosition = Vector3.zero;

        switch (randomLinerChack)
        {
        case 0:
            endPosition = getDirectionValue(linerType, baseTFValue);
            break;

        case 1:
            nextBlockObject();
            return(Vector3.zero);

        case 2:        // 주변을 렌덤으로 둥둥 떠다니는 옵션

            if (_randomLinerControl.Count == 0)
            {
                for (int i = 0; i < 8; i++)
                {
                    _randomLinerControl.Add(i);
                }

                // forward 타입을 추가로 더 줘서 점점더 앞으로 전진하도록 수정
                for (int i = 0; i < randomCount; i++)
                {
                    _randomLinerControl.Add(0);
                }
            }

            linerType = FlightOption.LinerTypeList.forward;

            int chackIndex = Random.Range(0, _randomLinerControl.Count);
            switch (_randomLinerControl[chackIndex])
            {
            case 1:
                linerType = FlightOption.LinerTypeList.backward;
                break;

            case 2:
                linerType = FlightOption.LinerTypeList.left;
                break;

            case 3:
                linerType = FlightOption.LinerTypeList.right;
                break;

            case 4:
                linerType = FlightOption.LinerTypeList.left_backward;
                break;

            case 5:
                linerType = FlightOption.LinerTypeList.Right_backward;
                break;

            case 6:
                linerType = FlightOption.LinerTypeList.left_forward;
                break;

            case 7:
                linerType = FlightOption.LinerTypeList.Right_forward;
                break;
            }

            _randomLinerControl.RemoveAt(chackIndex);
            endPosition = getDirectionValue(linerType, baseTFValue);
            break;
        }

        return(endPosition);
    }