summaryrefslogtreecommitdiff
path: root/Assets/BOXOPHOBIC/Utils/Editor/StyledMaterial/StyledMessageDrawer.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-09-08 10:52:35 +0800
committerchai <chaifix@163.com>2021-09-08 10:52:35 +0800
commit21e186f75b504d832d9c7bef0456edd7d5d3155e (patch)
treee73c43fc78d0326f32da5fadfda57fa8e23c1d90 /Assets/BOXOPHOBIC/Utils/Editor/StyledMaterial/StyledMessageDrawer.cs
parent7bd7b4c6c3be6840cab06aa4d8a38619bce44705 (diff)
+behavior design
Diffstat (limited to 'Assets/BOXOPHOBIC/Utils/Editor/StyledMaterial/StyledMessageDrawer.cs')
-rw-r--r--Assets/BOXOPHOBIC/Utils/Editor/StyledMaterial/StyledMessageDrawer.cs90
1 files changed, 0 insertions, 90 deletions
diff --git a/Assets/BOXOPHOBIC/Utils/Editor/StyledMaterial/StyledMessageDrawer.cs b/Assets/BOXOPHOBIC/Utils/Editor/StyledMaterial/StyledMessageDrawer.cs
deleted file mode 100644
index de9414a4..00000000
--- a/Assets/BOXOPHOBIC/Utils/Editor/StyledMaterial/StyledMessageDrawer.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-// Cristian Pop - https://boxophobic.com/
-
-using UnityEngine;
-using UnityEditor;
-using System;
-
-namespace Boxophobic.StyledGUI
-{
- public class StyledMessageDrawer : MaterialPropertyDrawer
- {
- public string type;
- public string message;
- public string keyword;
- public float value;
- public float top;
- public float down;
-
- MessageType mType;
-
- public StyledMessageDrawer(string t, string m, float top, float down)
- {
- type = t;
- message = m;
- keyword = null;
-
- this.top = top;
- this.down = down;
- }
-
- public StyledMessageDrawer(string t, string m, string k, float v, float top, float down)
- {
- type = t;
- message = m;
- keyword = k;
- value = v;
-
- this.top = top;
- this.down = down;
- }
-
- public override void OnGUI(Rect position, MaterialProperty prop, String label, MaterialEditor materialEditor)
- {
- Material material = materialEditor.target as Material;
-
- if (type == "None")
- {
- mType = MessageType.None;
- }
- else if (type == "Info")
- {
- mType = MessageType.Info;
- }
- else if (type == "Warning")
- {
- mType = MessageType.Warning;
- }
- else if (type == "Error")
- {
- mType = MessageType.Error;
- }
-
- if (keyword != null)
- {
- if (material.HasProperty(keyword))
- {
- if (material.GetFloat(keyword) == value)
- {
- GUILayout.Space(top);
- //EditorGUI.DrawRect(new Rect(position.x, position.y + Top, position.width, position.height), new Color(1,0,0,0.3f));
- EditorGUILayout.HelpBox(message, mType);
- //EditorGUI.HelpBox(new Rect(position.x, position.y + top, position.width, position.height), message, mType);
- GUILayout.Space(down);
-
- }
- }
- }
- else
- {
- GUILayout.Space(top);
- EditorGUILayout.HelpBox(message, mType);
- GUILayout.Space(down);
- }
- }
-
- public override float GetPropertyHeight(MaterialProperty prop, string label, MaterialEditor editor)
- {
- return -2;
- }
- }
-}