Beispiel #1
0
        /*******************************************/
        /*              Self-Define                */
        /*******************************************/
        //----------------------
        // Public Functions

        //----------------------
        // Protected Functions

        //----------------------
        // Private Functions

        /// <summary>
        /// Do the revolution action.
        /// </summary>
        private void DoRevolution()
        {
            if (mOrigin == null)
            {
                return;
            }

            switch (mAxis)
            {
            case JCS_Axis.AXIS_X:
            {
                if (mRevoluteAsLocalPosition)
                {
                    this.transform.localPosition
                        = JCS_Mathf.CirclePositionX(
                              this.mOrigin.localPosition,
                              this.mDegree,
                              this.mRadius,
                              this.transform.localPosition);
                }
                else
                {
                    this.transform.position
                        = JCS_Mathf.CirclePositionX(
                              this.mOrigin.position,
                              this.mDegree,
                              this.mRadius,
                              this.transform.position);
                }
            }
            break;

            case JCS_Axis.AXIS_Y:
            {
                if (mRevoluteAsLocalPosition)
                {
                    this.transform.localPosition
                        = JCS_Mathf.CirclePositionY(
                              this.mOrigin.localPosition,
                              this.mDegree,
                              this.mRadius,
                              this.transform.localPosition);
                }
                else
                {
                    this.transform.position
                        = JCS_Mathf.CirclePositionY(
                              this.mOrigin.position,
                              this.mDegree,
                              this.mRadius,
                              this.transform.position);
                }
            }
            break;

            case JCS_Axis.AXIS_Z:
            {
                if (mRevoluteAsLocalPosition)
                {
                    this.transform.localPosition
                        = JCS_Mathf.CirclePositionZ(
                              this.mOrigin.localPosition,
                              this.mDegree,
                              this.mRadius,
                              this.transform.localPosition);
                }
                else
                {
                    this.transform.position
                        = JCS_Mathf.CirclePositionZ(
                              this.mOrigin.position,
                              this.mDegree,
                              this.mRadius,
                              this.transform.position);
                }
            }
            break;
            }
        }