Exemplo n.º 1
0
 void Start()
 {
     iCnt       = 0;
     OldPattern = CAMERA_PATTERN.DEFAULT;
 }
Exemplo n.º 2
0
    void Update()
    {
        switch (pattern)
        {
        case CAMERA_PATTERN.ROTATION_UP:
            cMoveCamera.GetComponent <CCameraWork>().RotationUp();
            OldPattern = CAMERA_PATTERN.ROTATION_UP;

            if (iCnt >= iRotateLim)
            {
                iCnt = 0;
                Set_CameraPattern(CAMERA_PATTERN.DEFAULT);
            }
            break;

        case CAMERA_PATTERN.ROTATION_DOWN:
            cMoveCamera.GetComponent <CCameraWork>().RotationDown();
            OldPattern = CAMERA_PATTERN.ROTATION_DOWN;

            if (iCnt >= iRotateLim)
            {
                iCnt = 0;
                Set_CameraPattern(CAMERA_PATTERN.DEFAULT);
            }
            break;

        case CAMERA_PATTERN.ROTATION_LEFT:
            cMoveCamera.GetComponent <CCameraWork>().RotationLeft();
            OldPattern = CAMERA_PATTERN.ROTATION_LEFT;

            if (iCnt >= iRotateLim)
            {
                iCnt = 0;
                Set_CameraPattern(CAMERA_PATTERN.DEFAULT);
            }
            break;

        case CAMERA_PATTERN.ROTATION_RIGHT:
            cMoveCamera.GetComponent <CCameraWork>().RotationRight();
            OldPattern = CAMERA_PATTERN.ROTATION_RIGHT;

            if (iCnt >= iRotateLim)
            {
                iCnt = 0;
                Set_CameraPattern(CAMERA_PATTERN.DEFAULT);
            }
            break;

        case CAMERA_PATTERN.MOVE_UP:
            cMoveCamera.GetComponent <CCameraWork>().MoveUp();
            OldPattern = CAMERA_PATTERN.MOVE_UP;

            if (iCnt >= iMoveLim)
            {
                iCnt = 0;
                Set_CameraPattern(CAMERA_PATTERN.DEFAULT);
            }
            break;

        case CAMERA_PATTERN.MOVE_DOWN:
            cMoveCamera.GetComponent <CCameraWork>().MoveDown();
            OldPattern = CAMERA_PATTERN.MOVE_UP;

            if (iCnt >= iMoveLim)
            {
                iCnt = 0;
                Set_CameraPattern(CAMERA_PATTERN.DEFAULT);
            }
            break;

        case CAMERA_PATTERN.MOVE_LEFT:
            cMoveCamera.GetComponent <CCameraWork>().MoveLeft();
            OldPattern = CAMERA_PATTERN.MOVE_UP;

            if (iCnt >= iMoveLim)
            {
                iCnt = 0;
                Set_CameraPattern(CAMERA_PATTERN.DEFAULT);
            }
            break;

        case CAMERA_PATTERN.MOVE_RIGHT:
            cMoveCamera.GetComponent <CCameraWork>().MoveRight();
            OldPattern = CAMERA_PATTERN.MOVE_UP;

            if (iCnt >= iMoveLim)
            {
                iCnt = 0;
                Set_CameraPattern(CAMERA_PATTERN.DEFAULT);
            }
            break;

        case CAMERA_PATTERN.MOVE_FRONT:
            cMoveCamera.GetComponent <CCameraWork>().MoveFront();
            OldPattern = CAMERA_PATTERN.MOVE_UP;

            if (iCnt >= iMoveLim)
            {
                iCnt = 0;
                Set_CameraPattern(CAMERA_PATTERN.DEFAULT);
            }
            break;

        case CAMERA_PATTERN.MOVE_BACK:
            cMoveCamera.GetComponent <CCameraWork>().MoveBack();
            OldPattern = CAMERA_PATTERN.MOVE_UP;

            if (iCnt >= iMoveLim)
            {
                iCnt = 0;
                Set_CameraPattern(CAMERA_PATTERN.DEFAULT);
            }
            break;

        case CAMERA_PATTERN.POINT_UPLEFT:
            cMoveCamera.GetComponent <CCameraWork>().PointUpLeft();
            OldPattern = CAMERA_PATTERN.POINT_UPLEFT;

            if (iCnt >= iPointLim)
            {
                iCnt = 0;
                Set_CameraPattern(CAMERA_PATTERN.DEFAULT);
            }
            break;

        case CAMERA_PATTERN.POINT_UPRIGHT:
            cMoveCamera.GetComponent <CCameraWork>().PointUpRight();
            OldPattern = CAMERA_PATTERN.POINT_UPRIGHT;

            if (iCnt >= iPointLim)
            {
                iCnt = 0;
                Set_CameraPattern(CAMERA_PATTERN.DEFAULT);
            }
            break;

        case CAMERA_PATTERN.POINT_DOWNLEFT:
            cMoveCamera.GetComponent <CCameraWork>().PointDownLeft();
            OldPattern = CAMERA_PATTERN.POINT_DOWNLEFT;

            if (iCnt >= iPointLim)
            {
                iCnt = 0;
                Set_CameraPattern(CAMERA_PATTERN.DEFAULT);
            }
            break;

        case CAMERA_PATTERN.POINT_DOWNRIGHT:
            cMoveCamera.GetComponent <CCameraWork>().PointDownRight();
            OldPattern = CAMERA_PATTERN.POINT_DOWNRIGHT;

            if (iCnt >= iPointLim)
            {
                iCnt = 0;
                Set_CameraPattern(CAMERA_PATTERN.DEFAULT);
            }
            break;

        case CAMERA_PATTERN.DEFAULT:
            cMoveCamera.GetComponent <CCameraWork>().Default();
            if (iCnt >= iMoveCoolTime)
            {
                iCnt = 0;

                do
                {
                    Set_CameraPattern(GetRandom <CAMERA_PATTERN>());
                } while (pattern == OldPattern);
            }
            break;

        default: break;
        }

        iCnt++;
    }
Exemplo n.º 3
0
 private void Set_CameraPattern(CAMERA_PATTERN newPattern)
 {
     pattern = newPattern;
 }