summaryrefslogtreecommitdiff
path: root/Assets/ThirdParty/VRM/VRMShaders/UniUnlit/Editor
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/ThirdParty/VRM/VRMShaders/UniUnlit/Editor')
-rw-r--r--Assets/ThirdParty/VRM/VRMShaders/UniUnlit/Editor/UniUnlit.Editor.asmdef12
-rw-r--r--Assets/ThirdParty/VRM/VRMShaders/UniUnlit/Editor/UniUnlit.Editor.asmdef.meta7
-rw-r--r--Assets/ThirdParty/VRM/VRMShaders/UniUnlit/Editor/UniUnlitEditor.cs159
-rw-r--r--Assets/ThirdParty/VRM/VRMShaders/UniUnlit/Editor/UniUnlitEditor.cs.meta12
4 files changed, 0 insertions, 190 deletions
diff --git a/Assets/ThirdParty/VRM/VRMShaders/UniUnlit/Editor/UniUnlit.Editor.asmdef b/Assets/ThirdParty/VRM/VRMShaders/UniUnlit/Editor/UniUnlit.Editor.asmdef
deleted file mode 100644
index 564a54cc..00000000
--- a/Assets/ThirdParty/VRM/VRMShaders/UniUnlit/Editor/UniUnlit.Editor.asmdef
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "name": "UniUnlit.Editor",
- "references": [
- "UniUnlit"
- ],
- "optionalUnityReferences": [],
- "includePlatforms": [
- "Editor"
- ],
- "excludePlatforms": [],
- "allowUnsafeCode": false
-} \ No newline at end of file
diff --git a/Assets/ThirdParty/VRM/VRMShaders/UniUnlit/Editor/UniUnlit.Editor.asmdef.meta b/Assets/ThirdParty/VRM/VRMShaders/UniUnlit/Editor/UniUnlit.Editor.asmdef.meta
deleted file mode 100644
index 43cedc39..00000000
--- a/Assets/ThirdParty/VRM/VRMShaders/UniUnlit/Editor/UniUnlit.Editor.asmdef.meta
+++ /dev/null
@@ -1,7 +0,0 @@
-fileFormatVersion: 2
-guid: 529ce3a240c1a7a4bbbb220bbd59686b
-AssemblyDefinitionImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/ThirdParty/VRM/VRMShaders/UniUnlit/Editor/UniUnlitEditor.cs b/Assets/ThirdParty/VRM/VRMShaders/UniUnlit/Editor/UniUnlitEditor.cs
deleted file mode 100644
index 326f129a..00000000
--- a/Assets/ThirdParty/VRM/VRMShaders/UniUnlit/Editor/UniUnlitEditor.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using UnityEditor;
-using UnityEngine;
-using UnityEngine.Rendering;
-
-
-namespace UniGLTF.UniUnlit
-{
- public class UniUnlitEditor : ShaderGUI
- {
- private MaterialProperty _mainTex;
- private MaterialProperty _color;
- private MaterialProperty _cutoff;
- private MaterialProperty _blendMode;
- private MaterialProperty _cullMode;
- private MaterialProperty _vColBlendMode;
-// private MaterialProperty _srcBlend;
-// private MaterialProperty _dstBlend;
-// private MaterialProperty _zWrite;
-
- public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties)
- {
- _mainTex = FindProperty(Utils.PropNameMainTex, properties);
- _color = FindProperty(Utils.PropNameColor, properties);
- _cutoff = FindProperty(Utils.PropNameCutoff, properties);
- _blendMode = FindProperty(Utils.PropNameBlendMode, properties);
- _cullMode = FindProperty(Utils.PropNameCullMode, properties);
- _vColBlendMode = FindProperty(Utils.PropNameVColBlendMode, properties);
-// _srcBlend = FindProperty(PropNameSrcBlend, properties);
-// _dstBlend = FindProperty(PropNameDstBlend, properties);
-// _zWrite = FindProperty(PropNameZWrite, properties);
-
- var materials = materialEditor.targets.Select(x => x as Material).ToArray();
-
- EditorGUI.BeginChangeCheck();
- {
- DrawRenderingBox(materialEditor, materials);
- DrawColorBox(materialEditor, materials);
- DrawOptionsBox(materialEditor, materials);
- }
- EditorGUI.EndChangeCheck();
- }
-
- public override void AssignNewShaderToMaterial(Material material, Shader oldShader, Shader newShader)
- {
- var blendMode = UniUnlitRenderMode.Opaque;
- if (material.HasProperty(Utils.PropNameStandardShadersRenderMode)) // from Standard shader
- {
- blendMode = (UniUnlitRenderMode) Math.Min(2f, material.GetFloat(Utils.PropNameStandardShadersRenderMode));
- }
-
- // assigns UniUnlit's properties...
- base.AssignNewShaderToMaterial(material, oldShader, newShader);
-
- // take over old value
- material.SetFloat(Utils.PropNameBlendMode, (float) blendMode);
-
- Utils.ValidateProperties(material, isRenderModeChangedByUser: true);
- }
-
- private void DrawRenderingBox(MaterialEditor materialEditor, Material[] materials)
- {
- EditorGUILayout.LabelField("Rendering", EditorStyles.boldLabel);
- EditorGUILayout.BeginVertical(GUI.skin.box);
- {
- if (PopupEnum<UniUnlitRenderMode>("Rendering Type", _blendMode, materialEditor))
- {
- ModeChanged(materials, isRenderModeChangedByUser: true);
- }
- if (PopupEnum<UniUnlitCullMode>("Cull Mode", _cullMode, materialEditor))
- {
- ModeChanged(materials, isRenderModeChangedByUser: true);
- }
- EditorGUILayout.Space();
-
- switch ((UniUnlitRenderMode) _blendMode.floatValue)
- {
- case UniUnlitRenderMode.Cutout:
- materialEditor.ShaderProperty(_cutoff, "Cutoff");
- break;
- case UniUnlitRenderMode.Opaque:
- case UniUnlitRenderMode.Transparent:
- break;
- }
- }
- EditorGUILayout.EndVertical();
- EditorGUILayout.Space();
- }
-
- private void DrawColorBox(MaterialEditor materialEditor, Material[] materials)
- {
- EditorGUILayout.LabelField("Color", EditorStyles.boldLabel);
- EditorGUILayout.BeginVertical(GUI.skin.box);
- {
- materialEditor.TexturePropertySingleLine(new GUIContent("Main Tex", "(RGBA)"), _mainTex, _color);
- materialEditor.TextureScaleOffsetProperty(_mainTex);
- EditorGUILayout.Space();
-
- if (PopupEnum<UniUnlitVertexColorBlendOp>("Vertex Color Blend Mode", _vColBlendMode, materialEditor))
- {
- ModeChanged(materials, isRenderModeChangedByUser: true);
- }
- }
- EditorGUILayout.EndVertical();
- EditorGUILayout.Space();
- }
-
- private void DrawOptionsBox(MaterialEditor materialEditor, Material[] materials)
- {
- EditorGUILayout.LabelField("Options", EditorStyles.boldLabel);
- EditorGUILayout.BeginVertical(GUI.skin.box);
- {
- #if UNITY_5_6_OR_NEWER
-// materialEditor.EnableInstancingField();
- materialEditor.DoubleSidedGIField();
- #endif
- materialEditor.RenderQueueField();
- }
- EditorGUILayout.EndVertical();
- EditorGUILayout.Space();
- }
-
- private static bool PopupEnum<T>(string name, MaterialProperty property, MaterialEditor editor) where T : struct
- {
- if (!typeof(T).IsEnum) return false;
-
- EditorGUI.showMixedValue = property.hasMixedValue;
- EditorGUI.BeginChangeCheck();
- var values = (T[]) Enum.GetValues(typeof(T));
- var names = Enum.GetNames(typeof(T));
-
- var currInt = (int) property.floatValue;
- var currValue = (T) Enum.ToObject(typeof(T), currInt);
- var currIndex = Array.IndexOf(values, currValue);
- var nextIndex = EditorGUILayout.Popup(name, currIndex, names);
- var changed = EditorGUI.EndChangeCheck();
- if (changed)
- {
- editor.RegisterPropertyChangeUndo("EnumPopUp");
- var nextValue = values[nextIndex];
- var nextInt = (int) (object) nextValue;
- property.floatValue = nextInt;
- }
- EditorGUI.showMixedValue = false;
- return changed;
- }
-
-
- private static void ModeChanged(Material[] materials, bool isRenderModeChangedByUser = false)
- {
- foreach (var material in materials)
- {
- Utils.ValidateProperties(material, isRenderModeChangedByUser);
- }
- }
- }
-}
diff --git a/Assets/ThirdParty/VRM/VRMShaders/UniUnlit/Editor/UniUnlitEditor.cs.meta b/Assets/ThirdParty/VRM/VRMShaders/UniUnlit/Editor/UniUnlitEditor.cs.meta
deleted file mode 100644
index 7d35d3e6..00000000
--- a/Assets/ThirdParty/VRM/VRMShaders/UniUnlit/Editor/UniUnlitEditor.cs.meta
+++ /dev/null
@@ -1,12 +0,0 @@
-fileFormatVersion: 2
-guid: 4c70714358bb2fb4fa96ef08640763fd
-timeCreated: 1514224771
-licenseType: Free
-MonoImporter:
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant: