예제 #1
0
        private static void ShowMaskOffsetUi(MfxController mfxController)
        {
            EditorGUILayout.Separator();
            EditorGUILayout.LabelField(MfxEditorLocalization.MfxParamsLabel, EditorStyles.boldLabel);

            mfxController.MaskOffsetDirection = (MaskOffsetDirection)EditorGUILayout.EnumPopup(MfxEditorLocalization.MaskOffsetDirection, mfxController.MaskOffsetDirection);
            mfxController.MaskOffsetCurve     = EditorGUILayout.CurveField(MfxEditorLocalization.MaskOffsetCurve, mfxController.MaskOffsetCurve);
            mfxController.ScaleTimeFactor     = float.Parse(EditorGUILayout.TextField(MfxEditorLocalization.ScaleTimeLabel, mfxController.ScaleTimeFactor.ToString(CultureInfo.InvariantCulture)));
            mfxController.ScaleOffsetFactor   = float.Parse(EditorGUILayout.TextField(MfxEditorLocalization.ScalePositionLabel, mfxController.ScaleOffsetFactor.ToString(CultureInfo.InvariantCulture)));
        }
예제 #2
0
        private static void ShowByDistanceUi(MfxController mfxController)
        {
            EditorGUILayout.Separator();
            EditorGUILayout.LabelField(MfxEditorLocalization.DistanceParamsLabel, EditorStyles.boldLabel);

            // ReplaceMaterials depending on the distance
            mfxController.ByDistance = EditorGUILayout.Toggle(MfxEditorLocalization.ByDistanceLabel, mfxController.ByDistance);

            // Object To Calculate Distance
            if (mfxController.ByDistance)
            {
                mfxController.DistanceBasedObject = (GameObject)EditorGUILayout.ObjectField(MfxEditorLocalization.DistanceBasedObjectLabel, mfxController.DistanceBasedObject, typeof(GameObject), true);
            }
        }
예제 #3
0
        private static void ShowAutoParamsUi(MfxController mfxController)
        {
            EditorGUILayout.Separator();
            EditorGUILayout.LabelField(MfxEditorLocalization.AutoParamsLabel, EditorStyles.boldLabel);

            mfxController.AutoAnimate = EditorGUILayout.Toggle(MfxEditorLocalization.AutoAnimateLabel, mfxController.AutoAnimate);

            mfxController.AutoStop = EditorGUILayout.Toggle(MfxEditorLocalization.AutoStopLabel, mfxController.AutoStop);

            if (!mfxController.AutoDestroy)
            {
                mfxController.AutoReplace = EditorGUILayout.Toggle(MfxEditorLocalization.AutoReplaceLabel, mfxController.AutoReplace);
            }

            if (!mfxController.AutoReplace)
            {
                mfxController.AutoDestroy = EditorGUILayout.Toggle(MfxEditorLocalization.AutoDestroyLabel, mfxController.AutoDestroy);
            }
        }
예제 #4
0
        private static void ShowReplaceMaterialsUi(MfxController mfxController)
        {
            EditorGUILayout.Separator();
            EditorGUILayout.LabelField(MfxEditorLocalization.ReplaceMaterialParamsLabel, EditorStyles.boldLabel);

            mfxController.DetermineWorkflowAutomatically = EditorGUILayout.Toggle(MfxEditorLocalization.DetermineWorkflowAutomaticallyLabel, mfxController.DetermineWorkflowAutomatically);

            if (!mfxController.DetermineWorkflowAutomatically)
            {
                mfxController.MfxShaderType = (MfxShaderType)EditorGUILayout.EnumPopup(MfxEditorLocalization.ShaderTypeLabel, mfxController.MfxShaderType);
            }

            mfxController.MfxMaterial = (Material)EditorGUILayout.ObjectField(MfxEditorLocalization.MaterialLabel, mfxController.MfxMaterial, typeof(Material), true);

            mfxController.ReplaceMaterial = EditorGUILayout.Toggle(MfxEditorLocalization.ReplaceMaterialLabel, mfxController.ReplaceMaterial);

            //if (mfxController.ReplaceMaterial)
            {
                mfxController.ReplaceMaterialMode = EditorGUILayout.Toggle(MfxEditorLocalization.ReplaceMaterialInEditorLabel, mfxController.ReplaceMaterialMode);

                if (mfxController.ReplaceMaterialMode)
                {
                    var materialsCount = MfxMaterialUtil.GetMaterialsCount(mfxController.TargetObject);

                    EditorGUILayout.LabelField(MfxEditorLocalization.MaterialsCountLabel + materialsCount);

                    if (GUILayout.Button(MfxEditorLocalization.ReplaceMaterialButton))
                    {
                        if (mfxController.MfxMaterial == null)
                        {
                            Debug.LogWarning("template mfx materials is not selected");
                        }
                        else
                        {
                            MfxMaterialUtil.ReplaceRenderersMaterials(mfxController.MfxMaterial, mfxController.Target, mfxController.DetermineWorkflowAutomatically,
                                                                      mfxController.MfxShaderType, true);
                        }
                    }
                }
            }
        }
예제 #5
0
 private void Awake()
 {
     _mfxController = GetComponent <MfxController>();
 }