Beispiel #1
0
        private void DrawSynchronizePositionDataInterpolation(ref Rect propertyRect,
                                                              SerializedProperty interpolatePositionProperty,
                                                              PhotonTransformViewPositionModel.InterpolateOptions interpolateOption)
        {
            DrawPropertyWithHelpIcon(ref propertyRect, ref this.m_InterpolateHelpOpen, interpolatePositionProperty,
                                     INTERPOLATE_TOOLTIP);
            DrawHelpBox(ref propertyRect, this.m_InterpolateHelpOpen, GetInterpolateHelpBoxHeight(), INTERPOLATE_HELP,
                        INTERPOLATE_HELP_URL);

            switch (interpolateOption)
            {
            case PhotonTransformViewPositionModel.InterpolateOptions.FixedSpeed:
                EditorGUI.PropertyField(propertyRect,
                                        serializedObject.FindProperty("m_PositionModel.InterpolateMoveTowardsSpeed"),
                                        new GUIContent("MoveTowards Speed"));
                propertyRect.y += EDITOR_LINE_HEIGHT;
                break;

            case PhotonTransformViewPositionModel.InterpolateOptions.Lerp:
                EditorGUI.PropertyField(propertyRect,
                                        serializedObject.FindProperty("m_PositionModel.InterpolateLerpSpeed"),
                                        new GUIContent("Lerp Speed"));
                propertyRect.y += EDITOR_LINE_HEIGHT;
                break;

                /*case PhotonTransformViewPositionModel.InterpolateOptions.MoveTowardsComplex:
                 *  Rect curveRect = new Rect(propertyRect.xMin, propertyRect.yMin, propertyRect.width - 100, propertyRect.height);
                 *  EditorGUI.PropertyField(curveRect, serializedObject.FindProperty("m_PositionModel.InterpolateSpeedCurve"), new GUIContent("MoveTowards Speed Curve"));
                 *
                 *  Rect labelRect = new Rect(propertyRect.xMax - 95, propertyRect.yMin, 10, propertyRect.height);
                 *  GUI.Label(labelRect, "x");
                 *
                 *  Rect multiplierRect = new Rect(propertyRect.xMax - 80, propertyRect.yMin, 80, propertyRect.height);
                 *  EditorGUI.PropertyField(multiplierRect, serializedObject.FindProperty("m_PositionModel.InterpolateMoveTowardsSpeed"), GUIContent.none);
                 *  propertyRect.y += EDITOR_LINE_HEIGHT;
                 *
                 *  EditorGUI.PropertyField(propertyRect, serializedObject.FindProperty("m_PositionModel.InterpolateMoveTowardsAcceleration"),
                 *      new GUIContent("Acceleration"));
                 *  propertyRect.y += EDITOR_LINE_HEIGHT;
                 *
                 *  EditorGUI.PropertyField(propertyRect, serializedObject.FindProperty("m_PositionModel.InterpolateMoveTowardsDeceleration"),
                 *      new GUIContent("Deceleration"));
                 *  propertyRect.y += EDITOR_LINE_HEIGHT;
                 *  break;*/
            }
        }
Beispiel #2
0
    private void DrawSynchronizePositionDataInterpolation(ref Rect propertyRect, SerializedProperty interpolatePositionProperty,
                                                          PhotonTransformViewPositionModel.InterpolateOptions interpolateOption)
    {
        DrawPropertyWithHelpIcon(ref propertyRect, ref this.m_InterpolateHelpOpen, interpolatePositionProperty, INTERPOLATE_TOOLTIP);
        DrawHelpBox(ref propertyRect, this.m_InterpolateHelpOpen, GetInterpolateHelpBoxHeight(), INTERPOLATE_HELP, INTERPOLATE_HELP_URL);

        switch (interpolateOption)
        {
        case PhotonTransformViewPositionModel.InterpolateOptions.FixedSpeed:
            EditorGUI.PropertyField(propertyRect, serializedObject.FindProperty("m_PositionModel.InterpolateMoveTowardsSpeed"),
                                    new GUIContent("MoveTowards Speed"));
            propertyRect.y += EDITOR_LINE_HEIGHT;
            break;

        case PhotonTransformViewPositionModel.InterpolateOptions.Lerp:
            EditorGUI.PropertyField(propertyRect, serializedObject.FindProperty("m_PositionModel.InterpolateLerpSpeed"), new GUIContent("Lerp Speed"));
            propertyRect.y += EDITOR_LINE_HEIGHT;
            break;
        }
    }
Beispiel #3
0
        private void DrawSynchronizePositionData()
        {
            if (this.m_SynchronizePositionProperty == null || this.m_SynchronizePositionProperty.boolValue == false)
            {
                return;
            }

            SerializedProperty interpolatePositionProperty =
                serializedObject.FindProperty("m_PositionModel.InterpolateOption");

            PhotonTransformViewPositionModel.InterpolateOptions interpolateOption =
                (PhotonTransformViewPositionModel.InterpolateOptions)interpolatePositionProperty.enumValueIndex;

            SerializedProperty extrapolatePositionProperty =
                serializedObject.FindProperty("m_PositionModel.ExtrapolateOption");

            PhotonTransformViewPositionModel.ExtrapolateOptions extrapolateOption =
                (PhotonTransformViewPositionModel.ExtrapolateOptions)extrapolatePositionProperty.enumValueIndex;

            float containerHeight = 155;

            switch (interpolateOption)
            {
            case PhotonTransformViewPositionModel.InterpolateOptions.FixedSpeed:
            case PhotonTransformViewPositionModel.InterpolateOptions.Lerp:
                containerHeight += EDITOR_LINE_HEIGHT;
                break;

                /*case PhotonTransformViewPositionModel.InterpolateOptions.MoveTowardsComplex:
                 *  containerHeight += EDITOR_LINE_HEIGHT*3;
                 *  break;*/
            }

            if (extrapolateOption != PhotonTransformViewPositionModel.ExtrapolateOptions.Disabled)
            {
                containerHeight += EDITOR_LINE_HEIGHT;
            }

            switch (extrapolateOption)
            {
            case PhotonTransformViewPositionModel.ExtrapolateOptions.FixedSpeed:
                containerHeight += EDITOR_LINE_HEIGHT;
                break;
            }

            if (this.m_InterpolateHelpOpen == true)
            {
                containerHeight += GetInterpolateHelpBoxHeight();
            }

            if (this.m_ExtrapolateHelpOpen == true)
            {
                containerHeight += GetExtrapolateHelpBoxHeight();
            }

            // removed Gizmo Options. -3 lines, -1 splitter
            containerHeight -= EDITOR_LINE_HEIGHT * 3;

            Rect rect = PhotonGUI.ContainerBody(containerHeight);

            Rect propertyRect = new Rect(rect.xMin + 5, rect.yMin + 2, rect.width - 10,
                                         EditorGUIUtility.singleLineHeight);

            DrawTeleport(ref propertyRect);
            DrawSplitter(ref propertyRect);

            DrawSynchronizePositionDataInterpolation(ref propertyRect, interpolatePositionProperty, interpolateOption);
            DrawSplitter(ref propertyRect);

            DrawSynchronizePositionDataExtrapolation(ref propertyRect, extrapolatePositionProperty, extrapolateOption);
        }