Пример #1
0
        // Use this for initialization
        void Start()
        {
            entityEffects = player.GetComponent <EntityController>().postProcessor.GetComponent <EntityEffects>();

            colorButtonText            = colorButton.GetComponentInChildren <Text>();
            toggleAnimationsButtonText = toggleAnimationsButton.GetComponentInChildren <Text>();
            outlineButtonText          = outlineButton.GetComponentInChildren <Text>();
        }
Пример #2
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            EntityEffects entityEffects = (EntityEffects)target;

            EditorGUI.BeginDisabledGroup(true);
            script = EditorGUILayout.ObjectField("Script", script, typeof(MonoScript), false) as MonoScript;
            EditorGUI.EndDisabledGroup();

            EditorGUILayout.Space();

            EditorGUILayout.BeginHorizontal();
            showColor = EditorGUILayout.Foldout(showColor, "Color");
            entityEffects.colorEnable = EditorGUILayout.Toggle(entityEffects.colorEnable);
            EditorGUILayout.EndHorizontal();
            if (showColor)
            {
                EditorGUI.BeginDisabledGroup(!entityEffects.colorEnable);
                entityEffects.colorColor = EditorGUILayout.ColorField("Color", entityEffects.colorColor);
                EditorGUI.EndDisabledGroup();
            }

            EditorGUILayout.BeginHorizontal();
            showOutline = EditorGUILayout.Foldout(showOutline, "Outline");
            entityEffects.enableOutline = EditorGUILayout.Toggle(entityEffects.enableOutline);
            EditorGUILayout.EndHorizontal();
            if (showOutline)
            {
                EditorGUI.BeginDisabledGroup(!entityEffects.enableOutline);
                entityEffects.outlineSize  = EditorGUILayout.Slider("Size", entityEffects.outlineSize, 0, 5);
                entityEffects.outlineColor = EditorGUILayout.ColorField("Color", entityEffects.outlineColor);
                EditorGUI.EndDisabledGroup();
            }

            showDissolve = EditorGUILayout.Foldout(showDissolve, "Dissolve");
            if (showDissolve)
            {
                entityEffects.dissolveSpeed     = EditorGUILayout.FloatField("Speed", entityEffects.dissolveSpeed);
                entityEffects.dissolveEdgeColor = EditorGUILayout.ColorField("Edge Color", entityEffects.dissolveEdgeColor);
                entityEffects.dissolveEdgeSize  = EditorGUILayout.FloatField("Edge Size", entityEffects.dissolveEdgeSize);
            }

            serializedObject.ApplyModifiedProperties();

            EditorUtility.SetDirty(target);
        }
Пример #3
0
 // Use this for initialization
 void Start()
 {
     entityEffects      = GetComponent <EntityController>().postProcessor.GetComponent <EntityEffects>();
     playerRenderSource = GetComponent <EntityController>().renderSource.GetComponent <PlayerRenderSource>();
 }