public void OnEnable()
 {
     m_TransparencySortMode = serializedObject.FindProperty("m_TransparencySortMode");
     m_TransparencySortAxis = serializedObject.FindProperty("m_TransparencySortAxis");
     m_ScriptableRenderLoop = serializedObject.FindProperty("m_CustomRenderPipeline");
     tierSettingsAnimator   = new AnimatedValues.AnimBool(showTierSettingsUI, Repaint);
 }
 public void OnEnable()
 {
     m_TransparencySortMode          = serializedObject.FindProperty("m_TransparencySortMode");
     m_TransparencySortAxis          = serializedObject.FindProperty("m_TransparencySortAxis");
     m_ScriptableRenderLoop          = serializedObject.FindProperty("m_CustomRenderPipeline");
     m_LogWhenShaderIsCompiled       = serializedObject.FindProperty("m_LogWhenShaderIsCompiled");
     m_LightProbeOutsideHullStrategy = serializedObject.FindProperty("m_LightProbeOutsideHullStrategy");
     tierSettingsAnimator            = new AnimatedValues.AnimBool(showTierSettingsUI, Repaint);
 }
Example #3
0
        protected bool ShowFadeGroup(ref UnityEditor.AnimatedValues.AnimBool aAnimBool, System.Action aShowFunction)
        {
            if (EditorGUILayout.BeginFadeGroup(aAnimBool.faded) && aShowFunction != null)
            {
                aShowFunction();
            }
            EditorGUILayout.EndFadeGroup();


            return(aAnimBool.value);
        }
Example #4
0
        public virtual void OnOpenGUI(Material material, MaterialEditor materialEditor)
        {
            // Foldout states
            m_HeaderStateKey        = k_KeyPrefix + material.shader.name; // Create key string for editor prefs
            m_SurfaceOptionsFoldout = new AnimatedValues.AnimBool(true);
            m_SurfaceInputsFoldout  = new AnimatedValues.AnimBool(true);
            m_AdvancedFoldout       = new AnimatedValues.AnimBool(true);
            m_OtherFoldout          = new AnimatedValues.AnimBool(true);

            foreach (var obj in materialEditor.targets)
            {
                MaterialChanged((Material)obj);
            }
        }
Example #5
0
        public void OnEnable()
        {
            m_ValidPlatforms = BuildPlatforms.instance.GetValidPlatforms(true).ToArray();

            m_EditorMemorySettingsProperty   = serializedObject.FindProperty("m_EditorMemorySettings");
            m_PlatformMemorySettingsProperty = serializedObject.FindProperty("m_PlatformMemorySettings");
            m_DefaultMemorySettingsProperty  = serializedObject.FindProperty("m_DefaultMemorySettings");

            m_MemorySettingsDictionary = new Dictionary <BuildTargetGroup, SerializedProperty>();

            foreach (SerializedProperty prop in m_PlatformMemorySettingsProperty)
            {
                m_MemorySettingsDictionary.Add((BuildTargetGroup)prop.FindPropertyRelative("first").intValue, prop.FindPropertyRelative("second"));
            }

            for (var i = 0; i < m_SettingsAnimator.Length; i++)
            {
                m_SettingsAnimator[i] = new AnimatedValues.AnimBool(m_ShowSettingsUI[i], RepaintSettingsEditorWindow);
            }
        }
Example #6
0
    public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
    {
        if (ocultador == null)
        {
            ocultador   = attribute as OcultadorAttribute;
            propControl = ocultador.GetProperty(property.serializedObject);
            visibilidad = new UnityEditor.AnimatedValues.AnimBool(ocultador.Comp(propControl));

            // visibilidad.valueChanged +=
        }
        else
        {
            visibilidad.target = ocultador.Comp(propControl);
        }

        if (visibilidad.target)
        {
            EditorGUI.PropertyField(position, property);
        }
    }
Example #7
0
        void OnEnable()
        {
            var sortingGroup = target as SortingGroup;

            sortingGroup.Refresh();

            list = new ReorderableList(serializedObject,
                                       serializedObject.FindProperty("rendererInfos"),
                                       true, false, false, false);

            sortingLayerID = serializedObject.FindProperty("sortingLayerID");
            sortingMode    = serializedObject.FindProperty("sortingMode");

            showManualMode = new AnimBool(sortingMode.intValue == 0);
            showManualMode.valueChanged = new UnityEvent();
            showManualMode.valueChanged.AddListener(Repaint);

            // Get SortingLayerField method
            var editorTypes = typeof(Editor).Assembly.GetTypes();
            var type        = editorTypes.FirstOrDefault(t => t.Name == "EditorGUILayout");

            meth_SortingLayerField = type.GetMethod("SortingLayerField", (BindingFlags.Static | BindingFlags.NonPublic), null, new Type[] { typeof(GUIContent), typeof(SerializedProperty), typeof(GUIStyle) }, null);
        }
Example #8
0
        protected void ShowAdvancedFadeGroup(ref UnityEditor.AnimatedValues.AnimBool aAnimBool, SerializedProperty aEnableObj, string aGroupName, System.Action aShowFunction)
        {
            float sideWidth   = 50.0f;
            float centerWidth = ((ScreenWidth) - (sideWidth * 2.0f) - 62.0f);

            EditorGUILayout.BeginVertical(GUI.skin.textField);
            EditorGUILayout.BeginHorizontal();

            string enableTxt  = "Enable";
            string disableTxt = "Disable";

            if (!SceneAutoLoader.IsUsingEnglish)
            {
                enableTxt  = "Activé";
                disableTxt = "Désactivé";
            }


            if (aAnimBool.target)
            {
                GUI.color = GetColor(false);
                EditorGUILayout.BeginHorizontal(GUI.skin.box);
                GUI.color = Color.white;
                EditorGUILayout.LabelField(enableTxt, m_LabelTxtStyleCenterSmall, GUILayout.Width(sideWidth), GUILayout.Height(10));
                EditorGUILayout.EndHorizontal();
                if (GUILayout.Button(aGroupName, m_ButtonStyle, GUILayout.Width(centerWidth)))
                {
                    aAnimBool.target = !aAnimBool.target;
                }
                EditorGUILayout.BeginHorizontal(GUI.skin.box);
                EditorGUILayout.LabelField(disableTxt, m_LabelTxtStyleCenterSmall, GUILayout.Width(sideWidth), GUILayout.Height(10));
                EditorGUILayout.EndHorizontal();
            }
            else
            {
                EditorGUILayout.BeginHorizontal(GUI.skin.box);
                EditorGUILayout.LabelField(enableTxt, m_LabelTxtStyleCenterSmall, GUILayout.Width(sideWidth), GUILayout.Height(10));
                EditorGUILayout.EndHorizontal();
                if (GUILayout.Button(aGroupName, m_ButtonStyle, GUILayout.Width(centerWidth)))
                {
                    aAnimBool.target = !aAnimBool.target;
                }
                GUI.color = GetColor(false);
                EditorGUILayout.BeginHorizontal(GUI.skin.box);
                GUI.color = Color.white;
                EditorGUILayout.LabelField(disableTxt, m_LabelTxtStyleCenterSmall, GUILayout.Width(sideWidth), GUILayout.Height(10));
                EditorGUILayout.EndHorizontal();
            }
            EditorGUILayout.EndHorizontal();


            if (EditorGUILayout.BeginFadeGroup(aAnimBool.faded) && aShowFunction != null)
            {
                aShowFunction();
            }
            EditorGUILayout.EndFadeGroup();


            if (aAnimBool.target)
            {
                DrawSeparator(false);
            }
            EditorGUILayout.EndVertical();
            if (aEnableObj != null)
            {
                aEnableObj.boolValue = aAnimBool.target;
            }
        }