Merge branch 'unity-versionup'
# Conflicts: # Assets/ResourcesData/Background/[첸나]방송용 방/Scene/[첸나]방송용 방.unity
This commit is contained in:
commit
302b2959ce
@ -14,7 +14,7 @@ Material:
|
||||
m_ValidKeywords:
|
||||
- _EMISSION
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 1
|
||||
m_LightmapFlags: 7
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
@ -136,4 +136,4 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
|
||||
4
Assets/External/BioIK/Demo/Materials/Box.mat
vendored
4
Assets/External/BioIK/Demo/Materials/Box.mat
vendored
@ -14,7 +14,7 @@ Material:
|
||||
m_ValidKeywords:
|
||||
- _EMISSION
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 1
|
||||
m_LightmapFlags: 7
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
@ -136,4 +136,4 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
|
||||
@ -14,7 +14,7 @@ Material:
|
||||
m_ValidKeywords:
|
||||
- _EMISSION
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 1
|
||||
m_LightmapFlags: 7
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
@ -136,4 +136,4 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
|
||||
4
Assets/External/BioIK/Demo/Materials/Red.mat
vendored
4
Assets/External/BioIK/Demo/Materials/Red.mat
vendored
@ -14,7 +14,7 @@ Material:
|
||||
m_ValidKeywords:
|
||||
- _EMISSION
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 1
|
||||
m_LightmapFlags: 7
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
@ -136,4 +136,4 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
@ -27,7 +27,7 @@ Material:
|
||||
m_ValidKeywords:
|
||||
- _EMISSION
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 0
|
||||
m_LightmapFlags: 6
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
@ -27,7 +27,7 @@ Material:
|
||||
m_ValidKeywords:
|
||||
- _EMISSION
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 1
|
||||
m_LightmapFlags: 7
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
|
||||
@ -15,7 +15,7 @@ Material:
|
||||
- _EMISSION
|
||||
- _NORMALMAP
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 1
|
||||
m_LightmapFlags: 7
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
@ -137,4 +137,4 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
|
||||
@ -133,4 +133,4 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
|
||||
@ -108,4 +108,4 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
|
||||
@ -120,4 +120,4 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
|
||||
@ -119,4 +119,4 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
|
||||
@ -28,7 +28,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
--- !u!114 &-2537191031519904044
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
|
||||
@ -199,4 +199,4 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
|
||||
@ -135,7 +135,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
--- !u!114 &8771852287512767389
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
--- !u!114 &-5755898939291106094
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
|
||||
@ -117,7 +117,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
--- !u!114 &5988364977265673585
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
|
||||
@ -130,4 +130,4 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
--- !u!114 &-1839986918002453301
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
|
||||
@ -130,4 +130,4 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
|
||||
@ -130,4 +130,4 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
|
||||
@ -373,7 +373,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
--- !u!114 &5151949587641123878
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
|
||||
@ -389,7 +389,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
--- !u!114 &7694048184109273949
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
|
||||
@ -402,4 +402,4 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
|
||||
@ -407,4 +407,4 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
|
||||
@ -25,7 +25,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
|
||||
@ -386,7 +386,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
--- !u!114 &6202150226457244543
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
--- !u!114 &-7482000731104837112
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
|
||||
@ -373,7 +373,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
--- !u!114 &1781190763146025199
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
|
||||
@ -389,7 +389,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
--- !u!114 &6621973610829896646
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
--- !u!114 &-2976717314438926610
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
|
||||
@ -198,4 +198,4 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 9
|
||||
version: 10
|
||||
--- !u!114 &-8324562969990519675
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
|
||||
BIN
Assets/External/NiloToonURP/CHANGELOG.md
(Stored with Git LFS)
vendored
BIN
Assets/External/NiloToonURP/CHANGELOG.md
(Stored with Git LFS)
vendored
Binary file not shown.
@ -22,7 +22,7 @@ namespace NiloToon.NiloToonURP
|
||||
private static readonly int PerMaterialEnableDepthTextureRimLightAndShadow =
|
||||
Shader.PropertyToID("_PerMaterialEnableDepthTextureRimLightAndShadow");
|
||||
|
||||
enum NiloToonSurfaceTypePreset
|
||||
public enum NiloToonSurfaceTypePreset
|
||||
{
|
||||
Opaque_Outline = 0,
|
||||
Opaque = 1,
|
||||
@ -552,7 +552,7 @@ namespace NiloToon.NiloToonURP
|
||||
|
||||
string[] IsSkinFinalBanNames = new string[] { };
|
||||
IsSkinFinalBanNames = IsSkinFinalBanNames.Concat(IsSkinBanNames).ToArray();
|
||||
//IsSkinFinalBanNames = IsSkinFinalBanNames.Concat(IsFaceBanNames).ToArray();
|
||||
IsSkinFinalBanNames = IsSkinFinalBanNames.Concat(IsFaceBanNames).ToArray();
|
||||
//IsSkinFinalBanNames = IsSkinFinalBanNames.Concat(IsMouthBanNames).ToArray();
|
||||
//----------------------------------------------------
|
||||
List<string> IsNoOutlineFinalTargetNames =
|
||||
@ -1476,7 +1476,7 @@ namespace NiloToon.NiloToonURP
|
||||
// ...
|
||||
}
|
||||
|
||||
static void SetMaterialNiloToonSurfaceTypeAndProperties(Material m,
|
||||
public static void SetMaterialNiloToonSurfaceTypeAndProperties(Material m,
|
||||
NiloToonSurfaceTypePreset niloToonSurfaceTypePreset)
|
||||
{
|
||||
// fix render queue when it is out of expected range
|
||||
|
||||
@ -19,6 +19,7 @@ namespace LWGUI
|
||||
{
|
||||
var shader = AssetDatabase.LoadAssetAtPath<Shader>(assetPath);
|
||||
MetaDataHelper.ReleaseShaderMetadataCache(shader);
|
||||
ReflectionHelper.InvalidatePropertyCache(shader);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
|
||||
@ -4,8 +4,10 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using LWGUI.Timeline;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace LWGUI
|
||||
@ -13,81 +15,68 @@ namespace LWGUI
|
||||
/// <summary>
|
||||
/// Misc Function
|
||||
/// </summary>
|
||||
public class Helper
|
||||
public static class Helper
|
||||
{
|
||||
#region Engine Misc
|
||||
|
||||
public static void ObsoleteWarning(string obsoleteStr, string newStr)
|
||||
{
|
||||
Debug.LogWarning("LWGUI: '" + obsoleteStr + "' is Obsolete! Please use '" + newStr + "'!");
|
||||
}
|
||||
|
||||
public static bool PropertyValueEquals(MaterialProperty prop1, MaterialProperty prop2)
|
||||
{
|
||||
if (prop1.textureValue == prop2.textureValue
|
||||
&& prop1.vectorValue == prop2.vectorValue
|
||||
&& prop1.colorValue == prop2.colorValue
|
||||
&& prop1.floatValue == prop2.floatValue
|
||||
&& prop1.intValue == prop2.intValue
|
||||
)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
#region Misc
|
||||
|
||||
public static readonly string ProjectPath = Application.dataPath.Substring(0, Application.dataPath.Length - 6);
|
||||
|
||||
public static bool IsPropertyHideInInspector(MaterialProperty prop)
|
||||
{
|
||||
return (prop.flags & MaterialProperty.PropFlags.HideInInspector) != 0;
|
||||
return (prop.GetPropertyFlags() & ShaderPropertyFlags.HideInInspector) != 0;
|
||||
}
|
||||
|
||||
public static string GetKeyWord(string keyWord, string propName)
|
||||
public static bool StringToBool(string str) => str?.ToLower() is "on" or "true";
|
||||
|
||||
public static string GetKeywordName(string keyword, string propName)
|
||||
{
|
||||
string k;
|
||||
if (string.IsNullOrEmpty(keyWord) || keyWord == "__")
|
||||
if (string.IsNullOrEmpty(keyword) || keyword == "__")
|
||||
{
|
||||
k = propName.ToUpperInvariant() + "_ON";
|
||||
}
|
||||
else
|
||||
{
|
||||
k = keyWord.ToUpperInvariant();
|
||||
k = keyword.ToUpperInvariant();
|
||||
}
|
||||
return k;
|
||||
}
|
||||
|
||||
public static void SetShaderKeyWord(Object[] materials, string keyWord, bool isEnable)
|
||||
public static void SetShaderKeywordEnabled(Object[] materials, string keywordName, bool isEnable)
|
||||
{
|
||||
if (string.IsNullOrEmpty(keyWord) || string.IsNullOrEmpty(keyWord)) return;
|
||||
if (string.IsNullOrEmpty(keywordName) || string.IsNullOrEmpty(keywordName)) return;
|
||||
|
||||
foreach (Material m in materials)
|
||||
{
|
||||
// delete "_" keywords
|
||||
if (keyWord == "_")
|
||||
if (keywordName == "_")
|
||||
{
|
||||
if (m.IsKeywordEnabled(keyWord))
|
||||
if (m.IsKeywordEnabled(keywordName))
|
||||
{
|
||||
m.DisableKeyword(keyWord);
|
||||
m.DisableKeyword(keywordName);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.IsKeywordEnabled(keyWord))
|
||||
if (m.IsKeywordEnabled(keywordName))
|
||||
{
|
||||
if (!isEnable) m.DisableKeyword(keyWord);
|
||||
if (!isEnable) m.DisableKeyword(keywordName);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isEnable) m.EnableKeyword(keyWord);
|
||||
if (isEnable) m.EnableKeyword(keywordName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetShaderKeyWord(Object[] materials, string[] keyWords, int index)
|
||||
public static void SelectShaderKeyword(Object[] materials, string[] keywordNames, int index)
|
||||
{
|
||||
Debug.Assert(keyWords.Length >= 1 && index < keyWords.Length && index >= 0,
|
||||
"KeyWords Length: " + keyWords.Length + " or Index: " + index + " Error! ");
|
||||
for (int i = 0; i < keyWords.Length; i++)
|
||||
Debug.Assert(keywordNames.Length >= 1 && index < keywordNames.Length && index >= 0,
|
||||
"KeyWords Length: " + keywordNames.Length + " or Index: " + index + " Error! ");
|
||||
for (int i = 0; i < keywordNames.Length; i++)
|
||||
{
|
||||
SetShaderKeyWord(materials, keyWords[i], index == i);
|
||||
SetShaderKeywordEnabled(materials, keywordNames[i], index == i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -161,6 +150,23 @@ namespace LWGUI
|
||||
|
||||
#region Math
|
||||
|
||||
public const double Float_Epsilon = 1e-10;
|
||||
|
||||
public static bool Approximately(float a, float b) => Mathf.Abs(a - b) < Float_Epsilon;
|
||||
|
||||
public static bool PropertyValueEquals(MaterialProperty prop1, MaterialProperty prop2)
|
||||
{
|
||||
if (prop1.textureValue == prop2.textureValue
|
||||
&& prop1.vectorValue == prop2.vectorValue
|
||||
&& prop1.colorValue == prop2.colorValue
|
||||
&& Approximately(prop1.floatValue, prop2.floatValue)
|
||||
&& prop1.intValue == prop2.intValue
|
||||
)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
public static float PowPreserveSign(float f, float p)
|
||||
{
|
||||
float num = Mathf.Pow(Mathf.Abs(f), p);
|
||||
@ -191,6 +197,9 @@ namespace LWGUI
|
||||
|
||||
private static GUIStyle _guiStyle_Helpbox;
|
||||
public static GUIStyle guiStyle_Helpbox => _guiStyle_Helpbox ?? new GUIStyle(EditorStyles.helpBox) { fontSize = 12 };
|
||||
|
||||
private static GUIStyle _guiStyle_RampSelectButton;
|
||||
public static GUIStyle guiStyle_RampSelectButton => _guiStyle_RampSelectButton ?? new GUIStyle(EditorStyles.miniButton) { alignment = TextAnchor.MiddleLeft };
|
||||
|
||||
private static GUIStyle _guiStyles_ToolbarSearchTextFieldPopup;
|
||||
public static GUIStyle guiStyles_ToolbarSearchTextFieldPopup
|
||||
@ -223,7 +232,7 @@ namespace LWGUI
|
||||
#endregion
|
||||
|
||||
|
||||
#region Draw GUI for Drawer
|
||||
#region Draw GUI for Drawers
|
||||
|
||||
// TODO: use Reflection
|
||||
// copy and edit of https://github.com/GucioDevs/SimpleMinMaxSlider/blob/master/Assets/SimpleMinMaxSlider/Scripts/Editor/MinMaxSliderDrawer.cs
|
||||
@ -294,10 +303,34 @@ namespace LWGUI
|
||||
return toggleValue;
|
||||
}
|
||||
|
||||
public static bool ToggleButton(Rect position, GUIContent label, bool on, GUIStyle style = null, float padding = 0)
|
||||
{
|
||||
var paddedRect = new Rect(position.x + padding, position.y, position.width - padding * 2, position.height);
|
||||
style ??= EditorStyles.miniButton;
|
||||
|
||||
bool flag = GUI.Button(paddedRect, label, style);
|
||||
if (Event.current.type == EventType.Repaint)
|
||||
{
|
||||
bool isHover = paddedRect.Contains(Event.current.mousePosition);
|
||||
style.Draw(position, label, isHover, false, on, false);
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
public static void DrawShaderPropertyWithErrorLabel(Rect position, MaterialProperty prop, GUIContent label, MaterialEditor editor, string message)
|
||||
{
|
||||
var c = GUI.color;
|
||||
GUI.color = Color.red;
|
||||
var newLabel = $"{ label.text } ({ message })";
|
||||
editor.DefaultShaderProperty(position, prop, newLabel);
|
||||
GUI.color = c;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Draw GUI for Material
|
||||
#region Draw GUI for Materials
|
||||
|
||||
public static void DrawSplitLine()
|
||||
{
|
||||
@ -431,10 +464,10 @@ namespace LWGUI
|
||||
Undo.RecordObjects(targetMaterials, "LWGUI: Paste Material Properties");
|
||||
foreach (Material material in targetMaterials)
|
||||
{
|
||||
for (int i = 0; i < ShaderUtil.GetPropertyCount(_copiedMaterial.shader); i++)
|
||||
for (int i = 0; i < _copiedMaterial.shader.GetPropertyCount(); i++)
|
||||
{
|
||||
var name = ShaderUtil.GetPropertyName(_copiedMaterial.shader, i);
|
||||
var type = ShaderUtil.GetPropertyType(_copiedMaterial.shader, i);
|
||||
var name = _copiedMaterial.shader.GetPropertyName(i);
|
||||
var type = _copiedMaterial.shader.GetPropertyType(i);
|
||||
PastePropertyValueToMaterial(material, name, name, type, valueMask);
|
||||
}
|
||||
if ((valueMask & (uint)CopyMaterialValueMask.Keyword) != 0)
|
||||
@ -446,31 +479,31 @@ namespace LWGUI
|
||||
|
||||
private static void PastePropertyValueToMaterial(Material material, string srcName, string dstName)
|
||||
{
|
||||
for (int i = 0; i < ShaderUtil.GetPropertyCount(_copiedMaterial.shader); i++)
|
||||
for (int i = 0; i < _copiedMaterial.shader.GetPropertyCount(); i++)
|
||||
{
|
||||
var name = ShaderUtil.GetPropertyName(_copiedMaterial.shader, i);
|
||||
var name = _copiedMaterial.shader.GetPropertyName(i);
|
||||
if (name == srcName)
|
||||
{
|
||||
var type = ShaderUtil.GetPropertyType(_copiedMaterial.shader, i);
|
||||
var type = _copiedMaterial.shader.GetPropertyType(i);
|
||||
PastePropertyValueToMaterial(material, srcName, dstName, type);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void PastePropertyValueToMaterial(Material material, string srcName, string dstName, ShaderUtil.ShaderPropertyType type, uint valueMask = (uint)CopyMaterialValueMask.All)
|
||||
private static void PastePropertyValueToMaterial(Material material, string srcName, string dstName, ShaderPropertyType type, uint valueMask = (uint)CopyMaterialValueMask.All)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ShaderUtil.ShaderPropertyType.Color:
|
||||
case ShaderPropertyType.Color:
|
||||
if ((valueMask & (uint)CopyMaterialValueMask.Vector) != 0)
|
||||
material.SetColor(dstName, _copiedMaterial.GetColor(srcName));
|
||||
break;
|
||||
case ShaderUtil.ShaderPropertyType.Vector:
|
||||
case ShaderPropertyType.Vector:
|
||||
if ((valueMask & (uint)CopyMaterialValueMask.Vector) != 0)
|
||||
material.SetVector(dstName, _copiedMaterial.GetVector(srcName));
|
||||
break;
|
||||
case ShaderUtil.ShaderPropertyType.TexEnv:
|
||||
case ShaderPropertyType.Texture:
|
||||
if ((valueMask & (uint)CopyMaterialValueMask.Texture) != 0)
|
||||
material.SetTexture(dstName, _copiedMaterial.GetTexture(srcName));
|
||||
break;
|
||||
@ -580,10 +613,10 @@ namespace LWGUI
|
||||
// Build Display Mode Menu Items
|
||||
var displayModeMenus = new[]
|
||||
{
|
||||
"Show All Advanced Properties (" + displayModeData.advancedCount + " of " + perShaderData.propStaticDatas.Count + ")",
|
||||
"Show All Hidden Properties (" + displayModeData.hiddenCount + " of " + perShaderData.propStaticDatas.Count + ")",
|
||||
"Show Only Modified Properties (" + perMaterialData.modifiedCount + " of " + perShaderData.propStaticDatas.Count + ")",
|
||||
"Show Only Modified Properties by Group (" + perMaterialData.modifiedCount + " of " + perShaderData.propStaticDatas.Count + ")",
|
||||
$"Show All Advanced Properties ({ displayModeData.advancedCount } - { perShaderData.propStaticDatas.Count })",
|
||||
$"Show All Hidden Properties ({ displayModeData.hiddenCount } - { perShaderData.propStaticDatas.Count })",
|
||||
$"Show Only Modified Properties ({ perMaterialData.modifiedCount } - { perShaderData.propStaticDatas.Count })",
|
||||
$"Show Only Modified Properties by Group ({ perMaterialData.modifiedCount } - { perShaderData.propStaticDatas.Count })",
|
||||
};
|
||||
var enabled = new[] { true, true, true, true };
|
||||
var separator = new bool[4];
|
||||
@ -740,7 +773,7 @@ namespace LWGUI
|
||||
|
||||
#region Context Menu
|
||||
|
||||
private static void EditPresetEvent(string mode, ShaderPropertyPreset presetAsset, List<ShaderPropertyPreset.Preset> targetPresets, MaterialProperty prop, LWGUIMetaDatas metaDatas)
|
||||
private static void EditPresetEvent(string mode, LwguiShaderPropertyPreset presetAsset, List<LwguiShaderPropertyPreset.Preset> targetPresets, MaterialProperty prop, LWGUIMetaDatas metaDatas)
|
||||
{
|
||||
if (!VersionControlHelper.Checkout(presetAsset))
|
||||
{
|
||||
@ -772,15 +805,15 @@ namespace LWGUI
|
||||
|
||||
var (perShaderData, perMaterialData, perInspectorData) = metaDatas.GetDatas();
|
||||
var (propStaticData, propDynamicData) = metaDatas.GetPropDatas(prop);
|
||||
var menus = new GenericMenu();
|
||||
var menu = new GenericMenu();
|
||||
|
||||
// 2022+ Material Varant Menus
|
||||
#if UNITY_2022_1_OR_NEWER
|
||||
ReflectionHelper.HandleApplyRevert(menus, prop);
|
||||
ReflectionHelper.HandleApplyRevert(menu, prop);
|
||||
#endif
|
||||
|
||||
// Copy
|
||||
menus.AddItem(new GUIContent("Copy"), false, () =>
|
||||
menu.AddItem(new GUIContent("Copy"), false, () =>
|
||||
{
|
||||
_copiedMaterial = UnityEngine.Object.Instantiate(metaDatas.GetMaterial());
|
||||
_copiedProps.Clear();
|
||||
@ -859,20 +892,20 @@ namespace LWGUI
|
||||
};
|
||||
|
||||
if (_copiedMaterial != null && _copiedProps.Count > 0 && GUI.enabled)
|
||||
menus.AddItem(new GUIContent("Paste"), false, pasteAction);
|
||||
menu.AddItem(new GUIContent("Paste"), false, pasteAction);
|
||||
else
|
||||
menus.AddDisabledItem(new GUIContent("Paste"));
|
||||
menu.AddDisabledItem(new GUIContent("Paste"));
|
||||
|
||||
menus.AddSeparator("");
|
||||
menu.AddSeparator("");
|
||||
|
||||
// Copy Display Name
|
||||
menus.AddItem(new GUIContent("Copy Display Name"), false, () =>
|
||||
menu.AddItem(new GUIContent("Copy Display Name"), false, () =>
|
||||
{
|
||||
EditorGUIUtility.systemCopyBuffer = propStaticData.displayName;
|
||||
});
|
||||
|
||||
// Copy Property Names
|
||||
menus.AddItem(new GUIContent("Copy Property Names"), false, () =>
|
||||
menu.AddItem(new GUIContent("Copy Property Names"), false, () =>
|
||||
{
|
||||
EditorGUIUtility.systemCopyBuffer = prop.name;
|
||||
foreach (var extraPropName in propStaticData.extraPropNames)
|
||||
@ -896,7 +929,7 @@ namespace LWGUI
|
||||
// Preset
|
||||
if (GUI.enabled)
|
||||
{
|
||||
menus.AddSeparator("");
|
||||
menu.AddSeparator("");
|
||||
foreach (var activePresetData in perMaterialData.activePresetDatas)
|
||||
{
|
||||
// Cull self
|
||||
@ -912,22 +945,38 @@ namespace LWGUI
|
||||
|
||||
if (activePreset.GetPropertyValue(prop.name) != null)
|
||||
{
|
||||
menus.AddItem(new GUIContent("Update to Preset/" + presetPropDisplayName + "/" + "All"), false, () => EditPresetEvent("Update", presetAsset, presetAsset.presets, prop, metaDatas));
|
||||
menus.AddItem(new GUIContent("Update to Preset/" + presetPropDisplayName + "/" + activePreset.presetName), false, () => EditPresetEvent("Update", presetAsset, new List<ShaderPropertyPreset.Preset>(){activePreset}, prop, metaDatas));
|
||||
menus.AddItem(new GUIContent("Remove from Preset/" + presetPropDisplayName + "/" + "All"), false, () => EditPresetEvent("Remove", presetAsset, presetAsset.presets, prop, metaDatas));
|
||||
menus.AddItem(new GUIContent("Remove from Preset/" + presetPropDisplayName + "/" + activePreset.presetName), false, () => EditPresetEvent("Remove", presetAsset, new List<ShaderPropertyPreset.Preset>(){activePreset}, prop, metaDatas));
|
||||
menu.AddItem(new GUIContent("Update to Preset/" + presetPropDisplayName + "/" + "All"), false, () => EditPresetEvent("Update", presetAsset, presetAsset.GetPresets(), prop, metaDatas));
|
||||
menu.AddItem(new GUIContent("Update to Preset/" + presetPropDisplayName + "/" + activePreset.presetName), false, () => EditPresetEvent("Update", presetAsset, new List<LwguiShaderPropertyPreset.Preset>(){activePreset}, prop, metaDatas));
|
||||
menu.AddItem(new GUIContent("Remove from Preset/" + presetPropDisplayName + "/" + "All"), false, () => EditPresetEvent("Remove", presetAsset, presetAsset.GetPresets(), prop, metaDatas));
|
||||
menu.AddItem(new GUIContent("Remove from Preset/" + presetPropDisplayName + "/" + activePreset.presetName), false, () => EditPresetEvent("Remove", presetAsset, new List<LwguiShaderPropertyPreset.Preset>(){activePreset}, prop, metaDatas));
|
||||
}
|
||||
else
|
||||
{
|
||||
menus.AddItem(new GUIContent("Add to Preset/" + presetPropDisplayName + "/" + "All"), false, () => EditPresetEvent("Add", presetAsset, presetAsset.presets, prop, metaDatas));
|
||||
menus.AddItem(new GUIContent("Add to Preset/" + presetPropDisplayName + "/" + activePreset.presetName), false, () => EditPresetEvent("Add", presetAsset, new List<ShaderPropertyPreset.Preset>(){activePreset}, prop, metaDatas));
|
||||
menu.AddItem(new GUIContent("Add to Preset/" + presetPropDisplayName + "/" + "All"), false, () => EditPresetEvent("Add", presetAsset, presetAsset.GetPresets(), prop, metaDatas));
|
||||
menu.AddItem(new GUIContent("Add to Preset/" + presetPropDisplayName + "/" + activePreset.presetName), false, () => EditPresetEvent("Add", presetAsset, new List<LwguiShaderPropertyPreset.Preset>(){activePreset}, prop, metaDatas));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Custom
|
||||
if (propStaticData.baseDrawers != null)
|
||||
{
|
||||
foreach (var baseDrawer in propStaticData.baseDrawers)
|
||||
{
|
||||
baseDrawer.GetCustomContextMenus(menu, rect, prop, metaDatas);
|
||||
}
|
||||
}
|
||||
|
||||
menus.ShowAsContext();
|
||||
menu.ShowAsContext();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Importer
|
||||
|
||||
// https://docs.unity3d.com/ScriptReference/TextureImporter.GetPlatformTextureSettings.html
|
||||
public static string[] platformNamesForTextureSettings => new[] { "DefaultTexturePlatform", "Standalone", "Web", "iPhone", "Android", "WebGL", "Windows Store Apps", "PS4", "XboxOne", "Nintendo Switch", "tvOS" };
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -77,7 +77,7 @@ namespace LWGUI
|
||||
|
||||
private static Dictionary<Shader, PerShaderCache> _perShaderCachesDic = new Dictionary<Shader, PerShaderCache>();
|
||||
|
||||
public static LWGUIMetaDatas BuildMetaDatas(Shader shader, Material material, MaterialEditor materialEditor, LWGUI lwgui, MaterialProperty[] props)
|
||||
public static LWGUIMetaDatas BuildMetaDatas(Shader shader, Material material, MaterialEditor editor, LWGUI lwgui, MaterialProperty[] props)
|
||||
{
|
||||
var outDatas = new LWGUIMetaDatas();
|
||||
|
||||
@ -90,18 +90,18 @@ namespace LWGUI
|
||||
|
||||
// perMaterialData
|
||||
if (!perShaderCache.perMaterialDataCachesDic.ContainsKey(material))
|
||||
perShaderCache.perMaterialDataCachesDic.Add(material, new PerMaterialCache() { perMaterialData = new PerMaterialData(shader, material, props, outDatas.perShaderData) });
|
||||
perShaderCache.perMaterialDataCachesDic.Add(material, new PerMaterialCache() { perMaterialData = new PerMaterialData(shader, material, editor, props, outDatas.perShaderData) });
|
||||
|
||||
var perMaterialCache = perShaderCache.perMaterialDataCachesDic[material];
|
||||
outDatas.perMaterialData = perMaterialCache.perMaterialData;
|
||||
outDatas.perMaterialData.Update(shader, material, props, outDatas.perShaderData);
|
||||
outDatas.perMaterialData.Update(shader, material, editor, props, outDatas.perShaderData);
|
||||
|
||||
// perInspectorData
|
||||
if (!perMaterialCache.perInspectorDataCachesDic.ContainsKey(lwgui))
|
||||
perMaterialCache.perInspectorDataCachesDic.Add(lwgui, new PerInspectorData());
|
||||
|
||||
outDatas.perInspectorData = perMaterialCache.perInspectorDataCachesDic[lwgui];
|
||||
outDatas.perInspectorData.Update(materialEditor);
|
||||
outDatas.perInspectorData.Update(editor);
|
||||
|
||||
return outDatas;
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ namespace LWGUI
|
||||
{
|
||||
public class PresetHelper
|
||||
{
|
||||
private static Dictionary<string /*FileName*/, ShaderPropertyPreset> _loadedPresets = new Dictionary<string, ShaderPropertyPreset>();
|
||||
private static Dictionary<string /*FileName*/, LwguiShaderPropertyPreset> _loadedPresets = new Dictionary<string, LwguiShaderPropertyPreset>();
|
||||
|
||||
private static bool _isInitComplete;
|
||||
|
||||
@ -25,16 +25,16 @@ namespace LWGUI
|
||||
{
|
||||
_loadedPresets.Clear();
|
||||
_isInitComplete = false;
|
||||
var GUIDs = AssetDatabase.FindAssets("t:" + typeof(ShaderPropertyPreset));
|
||||
var GUIDs = AssetDatabase.FindAssets("t:" + typeof(LwguiShaderPropertyPreset));
|
||||
foreach (var GUID in GUIDs)
|
||||
{
|
||||
var preset = AssetDatabase.LoadAssetAtPath<ShaderPropertyPreset>(AssetDatabase.GUIDToAssetPath(GUID));
|
||||
var preset = AssetDatabase.LoadAssetAtPath<LwguiShaderPropertyPreset>(AssetDatabase.GUIDToAssetPath(GUID));
|
||||
AddPreset(preset);
|
||||
}
|
||||
_isInitComplete = true;
|
||||
}
|
||||
|
||||
public static void AddPreset(ShaderPropertyPreset preset)
|
||||
public static void AddPreset(LwguiShaderPropertyPreset preset)
|
||||
{
|
||||
if (!preset) return;
|
||||
if (!_loadedPresets.ContainsKey(preset.name))
|
||||
@ -43,7 +43,7 @@ namespace LWGUI
|
||||
}
|
||||
}
|
||||
|
||||
public static ShaderPropertyPreset GetPresetFile(string presetFileName)
|
||||
public static LwguiShaderPropertyPreset GetPresetAsset(string presetFileName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(presetFileName))
|
||||
return null;
|
||||
@ -53,7 +53,7 @@ namespace LWGUI
|
||||
|
||||
if (!_loadedPresets.ContainsKey(presetFileName) || !_loadedPresets[presetFileName])
|
||||
{
|
||||
Debug.LogError("LWGUI: Invalid ShaderPropertyPreset: ‘" + presetFileName + "’ !");
|
||||
Debug.LogError("LWGUI: Invalid ShaderPropertyPreset path: ‘" + presetFileName + "’ !");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -69,9 +69,9 @@ namespace LWGUI
|
||||
var drawer = ReflectionHelper.GetPropertyDrawer(material.shader, prop, out _);
|
||||
|
||||
// Apply active preset
|
||||
if (drawer != null && drawer is IBasePresetDrawer)
|
||||
if (drawer != null && drawer is IPresetDrawer)
|
||||
{
|
||||
var activePreset = (drawer as IBasePresetDrawer).GetActivePreset(prop, PresetHelper.GetPresetFile((drawer as PresetDrawer).presetFileName));
|
||||
var activePreset = (drawer as IPresetDrawer).GetActivePreset(prop, PresetHelper.GetPresetAsset((drawer as PresetDrawer).presetFileName));
|
||||
if (activePreset != null)
|
||||
activePreset.ApplyToDefaultMaterial(material);
|
||||
}
|
||||
|
||||
@ -14,35 +14,29 @@ namespace LWGUI
|
||||
{
|
||||
#region RampEditor
|
||||
|
||||
public static readonly string projectPath = Application.dataPath.Substring(0, Application.dataPath.Length - 6);
|
||||
|
||||
|
||||
private static readonly GUIContent _iconAdd = new GUIContent(EditorGUIUtility.IconContent("d_Toolbar Plus").image, "Add"),
|
||||
_iconEdit = new GUIContent(EditorGUIUtility.IconContent("editicon.sml").image, "Edit"),
|
||||
_iconDiscard = new GUIContent(EditorGUIUtility.IconContent("d_TreeEditor.Refresh").image, "Discard"),
|
||||
_iconSave = new GUIContent(EditorGUIUtility.IconContent("SaveActive").image, "Save");
|
||||
|
||||
public static bool RampEditor(
|
||||
public static void RampEditor(
|
||||
Rect buttonRect,
|
||||
MaterialProperty prop,
|
||||
ref LwguiGradient gradient,
|
||||
ColorSpace colorSpace,
|
||||
LwguiGradient.ChannelMask viewChannelMask,
|
||||
LwguiGradient.GradientTimeRange timeRange,
|
||||
bool isDirty,
|
||||
string defaultFileName,
|
||||
string rootPath,
|
||||
int defaultWidth,
|
||||
int defaultHeight,
|
||||
out bool hasChange,
|
||||
out bool doEditWhenNoGradient,
|
||||
out bool doRegisterUndo,
|
||||
out Texture2D newTexture,
|
||||
out bool doCreate,
|
||||
out bool doSave,
|
||||
out bool doDiscard
|
||||
out bool doDiscard,
|
||||
LwguiGradientWindow.ChangeGradientCallback onChangeGradient = null
|
||||
)
|
||||
{
|
||||
newTexture = null;
|
||||
var hasChange = false;
|
||||
var shouldCreate = false;
|
||||
var hasNoGradient = gradient == null;
|
||||
var _doEditWhenNoGradient = false;
|
||||
var doOpenWindow = false;
|
||||
var singleButtonWidth = buttonRect.width * 0.25f;
|
||||
var editRect = new Rect(buttonRect.x + singleButtonWidth * 0, buttonRect.y, singleButtonWidth, buttonRect.height);
|
||||
@ -51,14 +45,15 @@ namespace LWGUI
|
||||
var discardRect = new Rect(buttonRect.x + singleButtonWidth * 3, buttonRect.y, singleButtonWidth, buttonRect.height);
|
||||
|
||||
// Edit button event
|
||||
hasChange = false;
|
||||
{
|
||||
EditorGUI.BeginChangeCheck();
|
||||
LwguiGradientEditorHelper.GradientEditButton(editRect, _iconEdit, gradient, colorSpace, viewChannelMask, timeRange, () =>
|
||||
{
|
||||
// if the current edited texture is null, create new one
|
||||
if (prop.textureValue == null)
|
||||
if (hasNoGradient)
|
||||
{
|
||||
shouldCreate = true;
|
||||
_doEditWhenNoGradient = true;
|
||||
Event.current.Use();
|
||||
return false;
|
||||
}
|
||||
@ -67,47 +62,23 @@ namespace LWGUI
|
||||
doOpenWindow = true;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}, onChangeGradient);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
hasChange = true;
|
||||
gradient = LwguiGradientWindow.instance.lwguiGradient;
|
||||
if (LwguiGradientWindow.instance)
|
||||
{
|
||||
gradient = LwguiGradientWindow.instance.lwguiGradient;
|
||||
}
|
||||
}
|
||||
|
||||
doRegisterUndo = doOpenWindow;
|
||||
}
|
||||
doEditWhenNoGradient = _doEditWhenNoGradient;
|
||||
|
||||
|
||||
// Create button
|
||||
if (GUI.Button(addRect, _iconAdd) || shouldCreate)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
if (!Directory.Exists(projectPath + rootPath))
|
||||
Directory.CreateDirectory(projectPath + rootPath);
|
||||
|
||||
var absPath = EditorUtility.SaveFilePanel("Create New Ramp Texture", rootPath, defaultFileName, "png");
|
||||
|
||||
if (absPath.StartsWith(projectPath + rootPath))
|
||||
{
|
||||
//Create texture and save PNG
|
||||
var saveUnityPath = absPath.Replace(projectPath, String.Empty);
|
||||
CreateAndSaveNewGradientTexture(defaultWidth, defaultHeight, saveUnityPath, colorSpace == ColorSpace.Linear);
|
||||
// VersionControlHelper.Add(saveUnityPath);
|
||||
//Load created texture
|
||||
newTexture = AssetDatabase.LoadAssetAtPath<Texture2D>(saveUnityPath);
|
||||
break;
|
||||
}
|
||||
else if (absPath != String.Empty)
|
||||
{
|
||||
var retry = EditorUtility.DisplayDialog("Invalid Path", "Please select the subdirectory of '" + projectPath + rootPath + "'", "Retry", "Cancel");
|
||||
if (!retry) break;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
doCreate = GUI.Button(addRect, _iconAdd);
|
||||
|
||||
// Save button
|
||||
{
|
||||
@ -119,8 +90,6 @@ namespace LWGUI
|
||||
|
||||
// Discard button
|
||||
doDiscard = GUI.Button(discardRect, _iconDiscard);
|
||||
|
||||
return hasChange;
|
||||
}
|
||||
|
||||
public static bool HasGradient(AssetImporter assetImporter) { return assetImporter.userData.Contains("#");}
|
||||
@ -174,7 +143,7 @@ namespace LWGUI
|
||||
// Save texture to disk
|
||||
if (doSaveToDisk)
|
||||
{
|
||||
var systemPath = projectPath + path;
|
||||
var systemPath = Helper.ProjectPath + path;
|
||||
VersionControlHelper.Checkout(path);
|
||||
File.WriteAllBytes(systemPath, texture2D.EncodeToPNG());
|
||||
assetImporter.SaveAndReimport();
|
||||
@ -228,28 +197,42 @@ namespace LWGUI
|
||||
var ramp = gradient.GetPreviewRampTexture(width, height, ColorSpace.Linear);
|
||||
var png = ramp.EncodeToPNG();
|
||||
|
||||
var systemPath = projectPath + unityPath;
|
||||
var systemPath = Helper.ProjectPath + unityPath;
|
||||
File.WriteAllBytes(systemPath, png);
|
||||
|
||||
AssetDatabase.ImportAsset(unityPath);
|
||||
SetRampTextureImporter(unityPath, true, isLinear, EncodeGradientToJSON(gradient, gradient));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void SetRampTextureImporter(string unityPath, bool isReadable = true, bool isLinear = false, string userData = null)
|
||||
{
|
||||
var textureImporter = AssetImporter.GetAtPath(unityPath) as TextureImporter;
|
||||
if (!textureImporter)
|
||||
{
|
||||
Debug.LogError($"LWGUI: Can NOT get TextureImporter at path: { unityPath }");
|
||||
return;
|
||||
}
|
||||
|
||||
textureImporter.wrapMode = TextureWrapMode.Clamp;
|
||||
textureImporter.isReadable = true;
|
||||
textureImporter.isReadable = isReadable;
|
||||
textureImporter.textureCompression = TextureImporterCompression.Uncompressed;
|
||||
textureImporter.alphaSource = TextureImporterAlphaSource.FromInput;
|
||||
textureImporter.mipmapEnabled = false;
|
||||
textureImporter.sRGBTexture = !isLinear;
|
||||
|
||||
var platformTextureSettings = textureImporter.GetDefaultPlatformTextureSettings();
|
||||
platformTextureSettings.format = TextureImporterFormat.RGBA32;
|
||||
platformTextureSettings.textureCompression = TextureImporterCompression.Uncompressed;
|
||||
textureImporter.SetPlatformTextureSettings(platformTextureSettings);
|
||||
foreach (var platformName in Helper.platformNamesForTextureSettings)
|
||||
{
|
||||
var platformTextureSettings = textureImporter.GetPlatformTextureSettings(platformName);
|
||||
platformTextureSettings.format = TextureImporterFormat.RGBA32;
|
||||
textureImporter.SetPlatformTextureSettings(platformTextureSettings);
|
||||
}
|
||||
|
||||
//Gradient data embedded in userData
|
||||
textureImporter.userData = EncodeGradientToJSON(gradient, gradient);
|
||||
if (userData != null)
|
||||
textureImporter.userData = userData;
|
||||
|
||||
textureImporter.SaveAndReimport();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@ -257,7 +240,7 @@ namespace LWGUI
|
||||
|
||||
#region RampSelector
|
||||
|
||||
public static void RampSelector(Rect rect, string rootPath, Action<Texture2D> switchRampMapEvent)
|
||||
public static void RampMapSelectorOverride(Rect rect, MaterialProperty prop, string rootPath, RampSelectorWindow.SwitchRampMapCallback switchRampMapEvent)
|
||||
{
|
||||
var e = Event.current;
|
||||
if (e.type == UnityEngine.EventType.MouseDown && rect.Contains(e.mousePosition))
|
||||
@ -275,7 +258,20 @@ namespace LWGUI
|
||||
else
|
||||
return null;
|
||||
}).ToArray();
|
||||
RampSelectorWindow.ShowWindow(rect, rampMaps, switchRampMapEvent);
|
||||
RampSelectorWindow.ShowWindow(prop, rampMaps, switchRampMapEvent);
|
||||
}
|
||||
}
|
||||
|
||||
public static void RampIndexSelectorOverride(Rect rect, MaterialProperty prop, LwguiRampAtlas rampAtlas, RampSelectorWindow.SwitchRampMapCallback switchRampMapEvent)
|
||||
{
|
||||
if (!rampAtlas)
|
||||
return;
|
||||
|
||||
var e = Event.current;
|
||||
if (e.type == UnityEngine.EventType.MouseDown && rect.Contains(e.mousePosition))
|
||||
{
|
||||
e.Use();
|
||||
RampSelectorWindow.ShowWindow(prop, rampAtlas.GetTexture2Ds(LwguiGradient.ChannelMask.RGB), switchRampMapEvent);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@ -283,16 +279,20 @@ namespace LWGUI
|
||||
|
||||
public class RampSelectorWindow : EditorWindow
|
||||
{
|
||||
public delegate void SwitchRampMapCallback(MaterialProperty prop, Texture2D newRampMap, int index);
|
||||
|
||||
private Texture2D[] _rampMaps;
|
||||
private Vector2 _scrollPosition;
|
||||
private Action<Texture2D> _switchRampMapEvent;
|
||||
private MaterialProperty _prop;
|
||||
private SwitchRampMapCallback _switchRampMapEvent;
|
||||
|
||||
public static void ShowWindow(Rect rect, Texture2D[] rampMaps, Action<Texture2D> switchRampMapEvent)
|
||||
public static void ShowWindow(MaterialProperty prop, Texture2D[] rampMaps, SwitchRampMapCallback switchRampMapEvent)
|
||||
{
|
||||
RampSelectorWindow window = ScriptableObject.CreateInstance<RampSelectorWindow>();
|
||||
window.titleContent = new GUIContent("Ramp Selector");
|
||||
window.minSize = new Vector2(400, 500);
|
||||
window._rampMaps = rampMaps;
|
||||
window._prop = prop;
|
||||
window._switchRampMapEvent = switchRampMapEvent;
|
||||
window.ShowAuxWindow();
|
||||
}
|
||||
@ -302,19 +302,22 @@ namespace LWGUI
|
||||
EditorGUILayout.BeginVertical();
|
||||
_scrollPosition = EditorGUILayout.BeginScrollView(_scrollPosition);
|
||||
|
||||
foreach (Texture2D rampMap in _rampMaps)
|
||||
for (int i = 0; i < _rampMaps.Length; i++)
|
||||
{
|
||||
var rampMap = _rampMaps[i];
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
if (rampMap != null)
|
||||
{
|
||||
var guiContent = new GUIContent(rampMap.name);
|
||||
var guiContent = new GUIContent($"{ i }. { rampMap.name }");
|
||||
var rect = EditorGUILayout.GetControlRect();
|
||||
var buttonWidth = Mathf.Min(300f, Mathf.Max(GUI.skin.button.CalcSize(guiContent).x, rect.width * 0.35f));
|
||||
var buttonRect = new Rect(rect.x + rect.width - buttonWidth, rect.y, buttonWidth, rect.height);
|
||||
var previewRect = new Rect(rect.x, rect.y, rect.width - buttonWidth - 3.0f, rect.height);
|
||||
if (GUI.Button(buttonRect, guiContent) && _switchRampMapEvent != null)
|
||||
|
||||
if (GUI.Button(buttonRect, guiContent, Helper.guiStyle_RampSelectButton) && _switchRampMapEvent != null)
|
||||
{
|
||||
_switchRampMapEvent(rampMap);
|
||||
_switchRampMapEvent(_prop, rampMap, i);
|
||||
LwguiGradientWindow.CloseWindow();
|
||||
Close();
|
||||
}
|
||||
EditorGUI.DrawPreviewTexture(previewRect, rampMap);
|
||||
|
||||
@ -4,6 +4,7 @@ using System;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
|
||||
namespace LWGUI
|
||||
{
|
||||
@ -57,12 +58,12 @@ namespace LWGUI
|
||||
EditorGUIUtility.labelWidth = RevertableHelper.labelWidth;
|
||||
}
|
||||
|
||||
public static void FixGUIWidthMismatch(MaterialProperty.PropType propType, MaterialEditor materialEditor)
|
||||
public static void FixGUIWidthMismatch(ShaderPropertyType propType, MaterialEditor materialEditor)
|
||||
{
|
||||
switch (propType)
|
||||
{
|
||||
case MaterialProperty.PropType.Texture:
|
||||
case MaterialProperty.PropType.Range:
|
||||
case ShaderPropertyType.Texture:
|
||||
case ShaderPropertyType.Range:
|
||||
materialEditor.SetDefaultGUIWidths();
|
||||
break;
|
||||
default:
|
||||
@ -88,22 +89,22 @@ namespace LWGUI
|
||||
public static string GetPropertyDefaultValueText(MaterialProperty defaultProp)
|
||||
{
|
||||
string defaultText = String.Empty;
|
||||
switch (defaultProp.type)
|
||||
switch (defaultProp.GetPropertyType())
|
||||
{
|
||||
case MaterialProperty.PropType.Color:
|
||||
case ShaderPropertyType.Color:
|
||||
defaultText = defaultProp.colorValue.ToString();
|
||||
break;
|
||||
case MaterialProperty.PropType.Float:
|
||||
case MaterialProperty.PropType.Range:
|
||||
case ShaderPropertyType.Float:
|
||||
case ShaderPropertyType.Range:
|
||||
defaultText = defaultProp.floatValue.ToString();
|
||||
break;
|
||||
case MaterialProperty.PropType.Int:
|
||||
case ShaderPropertyType.Int:
|
||||
defaultText = defaultProp.intValue.ToString();
|
||||
break;
|
||||
case MaterialProperty.PropType.Texture:
|
||||
case ShaderPropertyType.Texture:
|
||||
defaultText = defaultProp.textureValue != null ? defaultProp.textureValue.name : "None";
|
||||
break;
|
||||
case MaterialProperty.PropType.Vector:
|
||||
case ShaderPropertyType.Vector:
|
||||
defaultText = defaultProp.vectorValue.ToString();
|
||||
break;
|
||||
}
|
||||
@ -130,6 +131,7 @@ namespace LWGUI
|
||||
if (DrawRevertButton(rect))
|
||||
{
|
||||
GUI.changed = true;
|
||||
EditorGUI.FocusTextInControl(string.Empty);
|
||||
DoRevertProperty(prop, metaDatas);
|
||||
|
||||
if (isHeader)
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
// Copyright (c) Jason Ma
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using UnityEditor;
|
||||
using UnityEditor.VersionControl;
|
||||
@ -9,7 +8,7 @@ using UnityEngine;
|
||||
|
||||
namespace LWGUI
|
||||
{
|
||||
public class VersionControlHelper
|
||||
public static class VersionControlHelper
|
||||
{
|
||||
public static bool isVCEnabled => Provider.enabled && Provider.isActive;
|
||||
|
||||
@ -99,5 +98,31 @@ namespace LWGUI
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool IsWriteable(UnityEngine.Object obj) => IsWriteable(new[] { obj });
|
||||
|
||||
public static bool IsWriteable(UnityEngine.Object[] objs)
|
||||
{
|
||||
if (objs == null)
|
||||
return false;
|
||||
|
||||
bool isWriteable = true;
|
||||
|
||||
foreach (var obj in objs)
|
||||
{
|
||||
if (!obj)
|
||||
continue;
|
||||
|
||||
if (!AssetDatabase.Contains(obj))
|
||||
continue;
|
||||
|
||||
isWriteable &= AssetDatabase.IsOpenForEdit(obj);
|
||||
|
||||
if (!isWriteable)
|
||||
break;
|
||||
}
|
||||
|
||||
return isWriteable;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3,6 +3,7 @@
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"LWGUI.Runtime",
|
||||
"LWGUI.Timeline",
|
||||
"Unity.InternalAPIEditorBridge.020"
|
||||
],
|
||||
"includePlatforms": [
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
// Copyright (c) Jason Ma
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
@ -9,7 +10,8 @@ namespace LWGUI
|
||||
|
||||
public class LWGUI : ShaderGUI
|
||||
{
|
||||
public LWGUIMetaDatas metaDatas;
|
||||
public LWGUIMetaDatas metaDatas;
|
||||
public bool hasChange;
|
||||
|
||||
public static LWGUICustomGUIEvent onDrawCustomHeader;
|
||||
public static LWGUICustomGUIEvent onDrawCustomFooter;
|
||||
@ -22,13 +24,18 @@ namespace LWGUI
|
||||
/// <summary>
|
||||
/// Called every frame when the content is updated, such as the mouse moving in the material editor
|
||||
/// </summary>
|
||||
public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] props)
|
||||
public override void OnGUI(MaterialEditor editor, MaterialProperty[] props)
|
||||
{
|
||||
//-----------------------------------------------------------------------------
|
||||
// Init Datas
|
||||
var material = materialEditor.target as Material;
|
||||
var material = editor.target as Material;
|
||||
var shader = material.shader;
|
||||
this.metaDatas = MetaDataHelper.BuildMetaDatas(shader, material, materialEditor, this, props);
|
||||
if (hasChange)
|
||||
{
|
||||
OnValidate(editor.targets);
|
||||
hasChange = false;
|
||||
}
|
||||
this.metaDatas = MetaDataHelper.BuildMetaDatas(shader, material, editor, this, props);
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -55,7 +62,7 @@ namespace LWGUI
|
||||
// Draw Properties
|
||||
{
|
||||
// move fields left to make rect for Revert Button
|
||||
materialEditor.SetDefaultGUIWidths();
|
||||
editor.SetDefaultGUIWidths();
|
||||
RevertableHelper.InitRevertableGUIWidths();
|
||||
|
||||
// start drawing properties
|
||||
@ -104,7 +111,7 @@ namespace LWGUI
|
||||
EditorGUI.indentLevel = indentLevel;
|
||||
}
|
||||
|
||||
materialEditor.SetDefaultGUIWidths();
|
||||
editor.SetDefaultGUIWidths();
|
||||
}
|
||||
|
||||
|
||||
@ -116,10 +123,10 @@ namespace LWGUI
|
||||
|
||||
// Render settings
|
||||
if (SupportedRenderingFeatures.active.editableMaterialRenderQueue)
|
||||
materialEditor.RenderQueueField();
|
||||
materialEditor.EnableInstancingField();
|
||||
materialEditor.LightmapEmissionProperty();
|
||||
materialEditor.DoubleSidedGIField();
|
||||
editor.RenderQueueField();
|
||||
editor.EnableInstancingField();
|
||||
editor.LightmapEmissionProperty();
|
||||
editor.DoubleSidedGIField();
|
||||
|
||||
// Custom Footer
|
||||
if (onDrawCustomFooter != null)
|
||||
@ -163,11 +170,14 @@ namespace LWGUI
|
||||
if (propStaticData.isReadOnly) GUI.enabled = false;
|
||||
Helper.BeginProperty(rect, prop, metaDatas);
|
||||
Helper.DoPropertyContextMenus(rect, prop, metaDatas);
|
||||
RevertableHelper.FixGUIWidthMismatch(prop.type, materialEditor);
|
||||
|
||||
RevertableHelper.FixGUIWidthMismatch(prop.GetPropertyType(), materialEditor);
|
||||
if (propStaticData.isAdvancedHeaderProperty)
|
||||
propStaticData.isExpanding = EditorGUI.Foldout(rect, propStaticData.isExpanding, string.Empty);
|
||||
|
||||
RevertableHelper.DrawRevertableProperty(revertButtonRect, prop, metaDatas, propStaticData.isMain || propStaticData.isAdvancedHeaderProperty);
|
||||
materialEditor.ShaderProperty(rect, prop, label);
|
||||
|
||||
Helper.EndProperty(metaDatas, prop);
|
||||
GUI.enabled = enabled;
|
||||
}
|
||||
@ -187,6 +197,7 @@ namespace LWGUI
|
||||
|
||||
public static void OnValidate(Object[] materials)
|
||||
{
|
||||
VersionControlHelper.Checkout(materials);
|
||||
UnityEditorExtension.ApplyMaterialPropertyAndDecoratorDrawers(materials);
|
||||
MetaDataHelper.ForceUpdateMaterialsMetadataCache(materials);
|
||||
}
|
||||
@ -197,20 +208,26 @@ namespace LWGUI
|
||||
OnValidate(metaDatas?.GetMaterialEditor()?.targets);
|
||||
}
|
||||
|
||||
// Called after edit or undo
|
||||
public override void ValidateMaterial(Material material)
|
||||
{
|
||||
base.ValidateMaterial(material);
|
||||
// Undo
|
||||
if (metaDatas == null)
|
||||
// Debug.Log($"ValidateMaterial {material.name}, {metaDatas}, {Event.current?.type}");
|
||||
|
||||
// Validate a Faked Material when select/edit a Material
|
||||
if (metaDatas == null && (Event.current == null || Event.current.type == EventType.Layout))
|
||||
{
|
||||
OnValidate(new Object[] { material });
|
||||
// Skip to avoid lag when editing large amounts of materials
|
||||
}
|
||||
// Undo/Edit in Timeline (EventType.Repaint)
|
||||
// Note: When modifying the material in Timeline in Unity 2022, this function cannot correctly obtain the modified value.
|
||||
else if (metaDatas == null)
|
||||
{
|
||||
MetaDataHelper.ForceUpdateMaterialMetadataCache(material);
|
||||
}
|
||||
// Edit
|
||||
else
|
||||
{
|
||||
OnValidate(metaDatas);
|
||||
if (!hasChange) hasChange = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} //namespace LWGUI
|
||||
}
|
||||
@ -10,10 +10,10 @@ namespace LWGUI
|
||||
{
|
||||
public class PersetDynamicData
|
||||
{
|
||||
public ShaderPropertyPreset.Preset preset;
|
||||
public LwguiShaderPropertyPreset.Preset preset;
|
||||
public MaterialProperty property;
|
||||
|
||||
public PersetDynamicData(ShaderPropertyPreset.Preset preset, MaterialProperty property)
|
||||
public PersetDynamicData(LwguiShaderPropertyPreset.Preset preset, MaterialProperty property)
|
||||
{
|
||||
this.preset = preset;
|
||||
this.property = property;
|
||||
@ -30,6 +30,7 @@ namespace LWGUI
|
||||
public bool hasChildrenModified = false; // Are Children properties modified in the material?
|
||||
public bool hasRevertChanged = false; // Used to call property EndChangeCheck()
|
||||
public bool isShowing = true; // ShowIf() result
|
||||
public bool isAnimated = false; // Material Parameter Animation preview in Timeline is activated
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -37,21 +38,25 @@ namespace LWGUI
|
||||
/// </summary>
|
||||
public class PerMaterialData
|
||||
{
|
||||
public Dictionary<string, PropertyDynamicData> propDynamicDatas = new Dictionary<string, PropertyDynamicData>();
|
||||
public MaterialProperty[] props = null;
|
||||
public Material material = null;
|
||||
public List<PersetDynamicData> activePresetDatas = new List<PersetDynamicData>();
|
||||
public int modifiedCount = 0;
|
||||
public Dictionary<string, bool> cachedModifiedProperties = null;
|
||||
public bool forceInit = true;
|
||||
public Dictionary<string, PropertyDynamicData> propDynamicDatas = new Dictionary<string, PropertyDynamicData>();
|
||||
public MaterialProperty[] props = null;
|
||||
public Material material = null;
|
||||
public Material defaultMaterialWithPresetOverride = null;
|
||||
public MaterialProperty[] defaultPropertiesWithPresetOverride = null;
|
||||
public List<PersetDynamicData> activePresetDatas = new List<PersetDynamicData>();
|
||||
public int modifiedCount = 0;
|
||||
public Dictionary<string, bool> cachedModifiedProperties = null;
|
||||
public bool forceInit = true;
|
||||
|
||||
public PerMaterialData(Shader shader, Material material, MaterialProperty[] props, PerShaderData perShaderData)
|
||||
public PerMaterialData(Shader shader, Material material, MaterialEditor editor, MaterialProperty[] props, PerShaderData perShaderData)
|
||||
{
|
||||
Init(shader, material, props, perShaderData);
|
||||
Init(shader, material, editor, props, perShaderData);
|
||||
}
|
||||
|
||||
public void Init(Shader shader, Material material, MaterialProperty[] props, PerShaderData perShaderData)
|
||||
public void Init(Shader shader, Material material, MaterialEditor editor, MaterialProperty[] props, PerShaderData perShaderData)
|
||||
{
|
||||
forceInit = false;
|
||||
|
||||
// Reset Datas
|
||||
this.props = props;
|
||||
this.material = material;
|
||||
@ -75,7 +80,7 @@ namespace LWGUI
|
||||
|
||||
{
|
||||
// Apply presets to default material
|
||||
var defaultMaterial = UnityEngine.Object.Instantiate(
|
||||
defaultMaterialWithPresetOverride = UnityEngine.Object.Instantiate(
|
||||
#if UNITY_2022_1_OR_NEWER
|
||||
material.parent
|
||||
? material.parent
|
||||
@ -85,20 +90,20 @@ namespace LWGUI
|
||||
);
|
||||
|
||||
foreach (var activePresetData in activePresetDatas)
|
||||
activePresetData.preset.ApplyToDefaultMaterial(defaultMaterial);
|
||||
activePresetData.preset.ApplyToDefaultMaterial(defaultMaterialWithPresetOverride);
|
||||
|
||||
var defaultProperties = MaterialEditor.GetMaterialProperties(new[] { defaultMaterial });
|
||||
Debug.Assert(defaultProperties.Length == props.Length);
|
||||
defaultPropertiesWithPresetOverride = MaterialEditor.GetMaterialProperties(new[] { defaultMaterialWithPresetOverride });
|
||||
Debug.Assert(defaultPropertiesWithPresetOverride.Length == props.Length);
|
||||
|
||||
// Init propDynamicDatas
|
||||
for (int i = 0; i < props.Length; i++)
|
||||
{
|
||||
var hasModified = !Helper.PropertyValueEquals(props[i], defaultProperties[i]);
|
||||
var hasModified = !Helper.PropertyValueEquals(props[i], defaultPropertiesWithPresetOverride[i]);
|
||||
if (hasModified) modifiedCount++;
|
||||
propDynamicDatas.Add(props[i].name, new PropertyDynamicData()
|
||||
{
|
||||
property = props[i],
|
||||
defualtProperty = defaultProperties[i],
|
||||
defualtProperty = defaultPropertiesWithPresetOverride[i],
|
||||
hasModified = hasModified
|
||||
});
|
||||
}
|
||||
@ -158,21 +163,33 @@ namespace LWGUI
|
||||
// Get ShowIf() results
|
||||
ShowIfDecorator.GetShowIfResult(propStaticData, propDynamicData, this);
|
||||
}
|
||||
|
||||
forceInit = false;
|
||||
}
|
||||
|
||||
public void Update(Shader shader, Material material, MaterialProperty[] props, PerShaderData perShaderData)
|
||||
public void Update(Shader shader, Material material, MaterialEditor editor, MaterialProperty[] props, PerShaderData perShaderData)
|
||||
{
|
||||
if (forceInit)
|
||||
{
|
||||
Init(shader, material, props, perShaderData);
|
||||
return;
|
||||
Init(shader, material, editor, props, perShaderData);
|
||||
}
|
||||
|
||||
foreach (var prop in props)
|
||||
else
|
||||
{
|
||||
propDynamicDatas[prop.name].property = prop;
|
||||
foreach (var prop in props)
|
||||
{
|
||||
propDynamicDatas[prop.name].property = prop;
|
||||
}
|
||||
}
|
||||
|
||||
// Check animated
|
||||
var renderer = editor.GetRendererForAnimationMode();
|
||||
if (renderer != null)
|
||||
{
|
||||
forceInit = true;
|
||||
foreach (var prop in props)
|
||||
{
|
||||
ReflectionHelper.MaterialAnimationUtility_OverridePropertyColor(prop, renderer, out var color);
|
||||
if (color != Color.white)
|
||||
propDynamicDatas[prop.name].isAnimated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -31,6 +31,9 @@ namespace LWGUI
|
||||
public bool IsDefaultDisplayMode() { return !(showAllAdvancedProperties || showAllHiddenProperties || showOnlyModifiedProperties || showOnlyModifiedGroups); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The static metadata of Material Property is only related to Shader.
|
||||
/// </summary>
|
||||
public partial class PropertyStaticData
|
||||
{
|
||||
public string name = string.Empty;
|
||||
@ -55,14 +58,14 @@ namespace LWGUI
|
||||
public string conditionalDisplayKeyword = string.Empty; // [Group(groupName_conditionalDisplayKeyword)]
|
||||
|
||||
// Drawers
|
||||
public IBasePresetDrawer presetDrawer = null;
|
||||
public IPresetDrawer presetDrawer = null;
|
||||
public List<IBaseDrawer> baseDrawers = null;
|
||||
|
||||
// Metadata
|
||||
public List<string> extraPropNames = new List<string>(); // Other Props that have been associated
|
||||
public string helpboxMessages = string.Empty;
|
||||
public string tooltipMessages = string.Empty;
|
||||
public ShaderPropertyPreset propertyPresetAsset = null; // The Referenced Preset Asset
|
||||
public LwguiShaderPropertyPreset propertyPresetAsset = null; // The Referenced Preset Asset
|
||||
|
||||
public void AddExtraProperty(string propName)
|
||||
{
|
||||
@ -109,8 +112,8 @@ namespace LWGUI
|
||||
{
|
||||
var drawer = ReflectionHelper.GetPropertyDrawer(shader, prop, out var decoratorDrawers);
|
||||
|
||||
if (drawer is IBasePresetDrawer)
|
||||
propStaticData.presetDrawer = drawer as IBasePresetDrawer;
|
||||
if (drawer is IPresetDrawer)
|
||||
propStaticData.presetDrawer = drawer as IPresetDrawer;
|
||||
|
||||
var baseDrawer = drawer as IBaseDrawer;
|
||||
if (baseDrawer != null)
|
||||
|
||||
418
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Editor/ScriptableObject/LwguiRampAtlas.cs
vendored
Normal file
418
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Editor/ScriptableObject/LwguiRampAtlas.cs
vendored
Normal file
@ -0,0 +1,418 @@
|
||||
// Copyright (c) Jason Ma
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using LWGUI.LwguiGradientEditor;
|
||||
using LWGUI.Runtime.LwguiGradient;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
|
||||
namespace LWGUI
|
||||
{
|
||||
[CreateAssetMenu(fileName = "LWGUI_RampAtlas.asset", menuName = "LWGUI/Ramp Atlas", order = 84)]
|
||||
public class LwguiRampAtlas : ScriptableObject
|
||||
{
|
||||
[Serializable]
|
||||
public class Ramp
|
||||
{
|
||||
public string name = "New Ramp";
|
||||
public LwguiGradient gradient = LwguiGradient.white;
|
||||
public ColorSpace colorSpace = ColorSpace.Gamma;
|
||||
public LwguiGradient.ChannelMask channelMask = LwguiGradient.ChannelMask.All;
|
||||
public LwguiGradient.GradientTimeRange timeRange = LwguiGradient.GradientTimeRange.One;
|
||||
}
|
||||
|
||||
public const string RampAtlasSOExtensionName = "asset";
|
||||
public const string RampAtlasTextureExtensionName = "tga";
|
||||
|
||||
public int rampAtlasWidth = 256;
|
||||
public int rampAtlasHeight = 4;
|
||||
public bool rampAtlasSRGB = true;
|
||||
|
||||
[NonSerialized] public Texture2D rampAtlasTexture = null;
|
||||
|
||||
[SerializeField] private List<Ramp> _ramps = new List<Ramp>();
|
||||
public List<Ramp> ramps
|
||||
{
|
||||
get => _ramps ?? new List<Ramp>();
|
||||
|
||||
set => _ramps = value ?? new List<Ramp>();
|
||||
}
|
||||
|
||||
[SerializeField] private bool _saveTextureToggle;
|
||||
private string _rampAtlasSOPath = string.Empty;
|
||||
private string _rampAtlasTexturePath = string.Empty;
|
||||
|
||||
public void InitData()
|
||||
{
|
||||
if (AssetDatabase.Contains(this))
|
||||
{
|
||||
_rampAtlasSOPath = AssetDatabase.GetAssetPath(this);
|
||||
_rampAtlasTexturePath = Path.ChangeExtension(_rampAtlasSOPath, RampAtlasTextureExtensionName);
|
||||
}
|
||||
}
|
||||
|
||||
public bool LoadTexture()
|
||||
{
|
||||
if (!AssetDatabase.Contains(this))
|
||||
return false;
|
||||
|
||||
// Try to load
|
||||
rampAtlasTexture = AssetDatabase.LoadAssetAtPath<Texture2D>(_rampAtlasTexturePath);
|
||||
|
||||
// Create
|
||||
if (!rampAtlasTexture)
|
||||
{
|
||||
CreateRampAtlasTexture();
|
||||
rampAtlasTexture = AssetDatabase.LoadAssetAtPath<Texture2D>(_rampAtlasTexturePath);
|
||||
}
|
||||
|
||||
if (!rampAtlasTexture)
|
||||
{
|
||||
Debug.LogError($"LWGUI: Can NOT create a Ramp Atlas Texture at path: { _rampAtlasTexturePath }");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public Color[] GetPixels()
|
||||
{
|
||||
Color[] pixels = Enumerable.Repeat(Color.white, rampAtlasWidth * rampAtlasHeight).ToArray();
|
||||
int currentIndex = 0;
|
||||
foreach (var ramp in ramps)
|
||||
{
|
||||
ramp.gradient.GetPixels(ref pixels, ref currentIndex, rampAtlasWidth, 1, ramp.channelMask);
|
||||
}
|
||||
|
||||
return pixels;
|
||||
}
|
||||
|
||||
public Texture2D[] GetTexture2Ds(LwguiGradient.ChannelMask channelMask = LwguiGradient.ChannelMask.All)
|
||||
{
|
||||
Texture2D[] textures = new Texture2D[ramps.Count];
|
||||
for (int i = 0; i < ramps.Count; i++)
|
||||
{
|
||||
var ramp = ramps[i];
|
||||
textures[i] = Instantiate(ramp.gradient?.GetPreviewRampTexture(rampAtlasWidth, 1, ramp.colorSpace, ramp.channelMask & channelMask));
|
||||
textures[i].name = ramp.name;
|
||||
}
|
||||
|
||||
return textures;
|
||||
}
|
||||
|
||||
public Ramp GetRamp(int index)
|
||||
{
|
||||
if (index < ramps.Count && index >= 0)
|
||||
{
|
||||
return ramps[index] ?? new Ramp();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void CreateRampAtlasTexture()
|
||||
{
|
||||
var rampAtlasTexture = new Texture2D(rampAtlasWidth, rampAtlasHeight, TextureFormat.RGBA32, false, !rampAtlasSRGB);
|
||||
rampAtlasTexture.SetPixels(GetPixels());
|
||||
rampAtlasTexture.wrapMode = TextureWrapMode.Clamp;
|
||||
rampAtlasTexture.name = Path.GetFileName(_rampAtlasTexturePath);
|
||||
rampAtlasTexture.Apply();
|
||||
|
||||
SaveTexture(rampAtlasTexture);
|
||||
|
||||
AssetDatabase.ImportAsset(_rampAtlasTexturePath);
|
||||
RampHelper.SetRampTextureImporter(_rampAtlasTexturePath, true, !rampAtlasSRGB, EditorJsonUtility.ToJson(this));
|
||||
}
|
||||
|
||||
public void SaveTexture(Texture2D rampAtlasTexture = null, string targetRelativePath = null, bool checkoutAndForceWrite = false)
|
||||
{
|
||||
targetRelativePath ??= _rampAtlasTexturePath;
|
||||
rampAtlasTexture ??= this.rampAtlasTexture;
|
||||
if (!rampAtlasTexture || string.IsNullOrEmpty(targetRelativePath))
|
||||
return;
|
||||
|
||||
var absPath = Helper.ProjectPath + targetRelativePath;
|
||||
if (File.Exists(absPath))
|
||||
{
|
||||
var existRampTexture = AssetDatabase.LoadAssetAtPath<Texture2D>(targetRelativePath);
|
||||
if (!VersionControlHelper.IsWriteable(existRampTexture))
|
||||
{
|
||||
if (checkoutAndForceWrite)
|
||||
{
|
||||
if (!VersionControlHelper.Checkout(targetRelativePath))
|
||||
{
|
||||
Debug.LogError($"LWGUI: Can NOT write the Ramp Atlas Texture to path: { absPath }");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
File.WriteAllBytes(absPath, rampAtlasTexture.EncodeToTGA());
|
||||
SaveTextureUserData(targetRelativePath);
|
||||
|
||||
Debug.Log($"LWGUI: Saved the Ramp Atlas Texture at path: { absPath }");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void SaveTextureUserData(string targetRelativePath = null)
|
||||
{
|
||||
targetRelativePath ??= _rampAtlasTexturePath;
|
||||
if (!string.IsNullOrEmpty(targetRelativePath))
|
||||
{
|
||||
var importer = AssetImporter.GetAtPath(targetRelativePath);
|
||||
if (importer)
|
||||
{
|
||||
importer.userData = EditorJsonUtility.ToJson(this);
|
||||
importer.SaveAndReimport();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SaveRampAtlasSO()
|
||||
{
|
||||
AssetDatabase.SaveAssetIfDirty(this);
|
||||
}
|
||||
|
||||
public void UpdateTexturePixels()
|
||||
{
|
||||
if (!rampAtlasTexture)
|
||||
return;
|
||||
|
||||
LwguiGradientWindow.RegisterSerializedObjectUndo(this);
|
||||
rampAtlasTexture.Reinitialize(rampAtlasWidth, rampAtlasHeight);
|
||||
rampAtlasTexture.SetPixels(GetPixels());
|
||||
rampAtlasTexture.Apply();
|
||||
}
|
||||
|
||||
public void DiscardChanges()
|
||||
{
|
||||
var importer = AssetImporter.GetAtPath(_rampAtlasTexturePath);
|
||||
if (!importer)
|
||||
return;
|
||||
|
||||
EditorJsonUtility.FromJsonOverwrite(importer.userData, this);
|
||||
InitData();
|
||||
AssetDatabase.ImportAsset(_rampAtlasTexturePath, ImportAssetOptions.ForceUpdate);
|
||||
LoadTexture();
|
||||
EditorUtility.ClearDirty(this);
|
||||
}
|
||||
|
||||
public void ConvertColorSpace(ColorSpace targetColorSpace)
|
||||
{
|
||||
foreach (var ramp in ramps)
|
||||
{
|
||||
if (ramp.colorSpace != targetColorSpace)
|
||||
{
|
||||
ramp.colorSpace = targetColorSpace;
|
||||
ramp.gradient.ConvertColorSpaceWithoutCopy(
|
||||
targetColorSpace != ColorSpace.Gamma
|
||||
? ColorSpace.Linear
|
||||
: ColorSpace.Gamma);
|
||||
}
|
||||
}
|
||||
|
||||
rampAtlasSRGB = targetColorSpace == ColorSpace.Gamma;
|
||||
RampHelper.SetRampTextureImporter(_rampAtlasTexturePath, true, !rampAtlasSRGB, EditorJsonUtility.ToJson(this));
|
||||
UpdateTexturePixels();
|
||||
SaveTexture();
|
||||
}
|
||||
|
||||
[ContextMenu("Convert Gamma To Linear")]
|
||||
public void ConvertGammaToLinear()
|
||||
{
|
||||
ConvertColorSpace(ColorSpace.Linear);
|
||||
}
|
||||
|
||||
[ContextMenu("Convert Linear To Gamma")]
|
||||
public void ConvertLinearToGamma()
|
||||
{
|
||||
ConvertColorSpace(ColorSpace.Gamma);
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
InitData();
|
||||
LoadTexture();
|
||||
}
|
||||
|
||||
private void OnValidate()
|
||||
{
|
||||
// Skip at the end of compilation
|
||||
if (Event.current == null
|
||||
// Skip when editing Text Field
|
||||
|| EditorGUIUtility.editingTextField)
|
||||
return;
|
||||
|
||||
InitData();
|
||||
|
||||
if (!LoadTexture())
|
||||
return;
|
||||
|
||||
UpdateTexturePixels();
|
||||
SaveTexture();
|
||||
}
|
||||
|
||||
public static Texture LoadRampAtlasTexture(LwguiRampAtlas rampAtlasSO)
|
||||
{
|
||||
if (!rampAtlasSO || !AssetDatabase.Contains(rampAtlasSO))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var soPath = Path.ChangeExtension(AssetDatabase.GetAssetPath(rampAtlasSO), RampAtlasTextureExtensionName);
|
||||
return AssetDatabase.LoadAssetAtPath<Texture>(soPath);
|
||||
}
|
||||
|
||||
public static LwguiRampAtlas LoadRampAtlasSO(Texture texture)
|
||||
{
|
||||
if (!texture || !AssetDatabase.Contains(texture))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var soPath = Path.ChangeExtension(AssetDatabase.GetAssetPath(texture), RampAtlasSOExtensionName);
|
||||
return AssetDatabase.LoadAssetAtPath<LwguiRampAtlas>(soPath);
|
||||
}
|
||||
|
||||
public static LwguiRampAtlas CreateRampAtlasSO(MaterialProperty rampAtlasProp, LWGUIMetaDatas metaDatas)
|
||||
{
|
||||
if (rampAtlasProp == null || metaDatas == null)
|
||||
return null;
|
||||
|
||||
var shader = metaDatas.GetShader();
|
||||
|
||||
// Get default ramps
|
||||
RampAtlasDrawer targetRampAtlasDrawer = null;
|
||||
List<(int defaultIndex, RampAtlasIndexerDrawer indexerDrawer)> defaultRampAtlasIndexerDrawers = new ();
|
||||
// Unity Bug: The cache of MaterialPropertyHandler must be cleared first, otherwise the default value cannot be obtained correctly.
|
||||
ReflectionHelper.InvalidatePropertyCache(shader);
|
||||
for (int i = 0; i < metaDatas.perMaterialData.defaultPropertiesWithPresetOverride.Length; i++)
|
||||
{
|
||||
var prop = metaDatas.perMaterialData.defaultPropertiesWithPresetOverride[i];
|
||||
var drawer = ReflectionHelper.GetPropertyDrawer(shader, prop);
|
||||
if (drawer == null)
|
||||
continue;
|
||||
|
||||
if (drawer is RampAtlasDrawer rampAtlasDrawer && prop.name == rampAtlasProp.name)
|
||||
targetRampAtlasDrawer = rampAtlasDrawer;
|
||||
|
||||
if (drawer is RampAtlasIndexerDrawer rampAtlasIndexerDrawer && rampAtlasIndexerDrawer.rampAtlasPropName == rampAtlasProp.name)
|
||||
defaultRampAtlasIndexerDrawers.Add(((int)prop.GetNumericValue(), rampAtlasIndexerDrawer));
|
||||
}
|
||||
|
||||
if (targetRampAtlasDrawer == null)
|
||||
{
|
||||
Debug.LogError($"LWGUI: Can NOT find RampAtlasDrawer { rampAtlasProp.name } in Shader { shader }");
|
||||
return null;
|
||||
}
|
||||
|
||||
// Init Ramp Atlas
|
||||
var newRampAtlasSO = ScriptableObject.CreateInstance<LwguiRampAtlas>();
|
||||
newRampAtlasSO.name = targetRampAtlasDrawer.defaultFileName;
|
||||
newRampAtlasSO.rampAtlasWidth = targetRampAtlasDrawer.defaultAtlasWidth;
|
||||
newRampAtlasSO.rampAtlasHeight = targetRampAtlasDrawer.defaultAtlasHeight;
|
||||
newRampAtlasSO.rampAtlasSRGB = targetRampAtlasDrawer.defaultAtlasSRGB;
|
||||
|
||||
if (defaultRampAtlasIndexerDrawers.Count > 0)
|
||||
{
|
||||
defaultRampAtlasIndexerDrawers.Sort(((x, y) => x.defaultIndex.CompareTo(y.defaultIndex)));
|
||||
|
||||
// Set Ramps Count
|
||||
var maxIndex = defaultRampAtlasIndexerDrawers.Max((tuple => tuple.defaultIndex));
|
||||
for (int i = 0; i < maxIndex + 1; i++)
|
||||
{
|
||||
newRampAtlasSO.ramps.Add(new LwguiRampAtlas.Ramp());
|
||||
if (newRampAtlasSO.ramps.Count >= newRampAtlasSO.rampAtlasHeight)
|
||||
newRampAtlasSO.rampAtlasHeight *= 2;
|
||||
}
|
||||
|
||||
// Set Ramps Default Value
|
||||
for (int i = 0; i < defaultRampAtlasIndexerDrawers.Count; i++)
|
||||
{
|
||||
var defaultRampAtlasIndexerDrawer = defaultRampAtlasIndexerDrawers[i];
|
||||
var ramp = newRampAtlasSO.ramps[defaultRampAtlasIndexerDrawer.defaultIndex];
|
||||
var drawer = defaultRampAtlasIndexerDrawer.indexerDrawer;
|
||||
ramp.name = drawer.defaultRampName;
|
||||
ramp.colorSpace = drawer.colorSpace;
|
||||
ramp.channelMask = drawer.viewChannelMask;
|
||||
ramp.timeRange = drawer.timeRange;
|
||||
}
|
||||
}
|
||||
|
||||
return SaveRampAtlasSOToAsset(newRampAtlasSO, targetRampAtlasDrawer.rootPath, targetRampAtlasDrawer.defaultFileName);
|
||||
}
|
||||
|
||||
public static LwguiRampAtlas CloneRampAtlasSO(LwguiRampAtlas rampAtlasSO)
|
||||
{
|
||||
if (!rampAtlasSO)
|
||||
return null;
|
||||
|
||||
var newRampAtlasSO = Instantiate(rampAtlasSO);
|
||||
var rootPath = Path.GetDirectoryName(rampAtlasSO._rampAtlasSOPath);
|
||||
var defaultFileName = Path.GetFileName(rampAtlasSO._rampAtlasSOPath);
|
||||
|
||||
if (SaveRampAtlasSOToAsset(newRampAtlasSO, rootPath, defaultFileName))
|
||||
{
|
||||
newRampAtlasSO.InitData();
|
||||
newRampAtlasSO.LoadTexture();
|
||||
return newRampAtlasSO;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static LwguiRampAtlas SaveRampAtlasSOToAsset(LwguiRampAtlas rampAtlasSO, string rootPath, string defaultFileName)
|
||||
{
|
||||
if (!rampAtlasSO)
|
||||
return null;
|
||||
|
||||
// Save Ramp Atlas
|
||||
string createdFileRelativePath = string.Empty;
|
||||
while (true)
|
||||
{
|
||||
// TODO: Warning:
|
||||
// PropertiesGUI() is being called recursively. If you want to render the default gui for shader properties then call PropertiesDefaultGUI() instead
|
||||
var absPath = EditorUtility.SaveFilePanel("Create a Ramp Atlas SO", rootPath, defaultFileName, "asset");
|
||||
|
||||
if (absPath.StartsWith(Helper.ProjectPath))
|
||||
{
|
||||
createdFileRelativePath = absPath.Replace(Helper.ProjectPath, string.Empty);
|
||||
break;
|
||||
}
|
||||
else if (absPath != string.Empty)
|
||||
{
|
||||
var retry = EditorUtility.DisplayDialog("Invalid Path", "Please select the subdirectory of '" + Helper.ProjectPath + "'", "Retry", "Cancel");
|
||||
if (!retry) break;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(createdFileRelativePath))
|
||||
{
|
||||
AssetDatabase.CreateAsset(rampAtlasSO, createdFileRelativePath);
|
||||
rampAtlasSO.InitData();
|
||||
rampAtlasSO.LoadTexture();
|
||||
return rampAtlasSO;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2b294e53fae84d85a53542a47c4a1481
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,311 @@
|
||||
// Copyright (c) Jason Ma
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEditor;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace LWGUI
|
||||
{
|
||||
[CreateAssetMenu(fileName = "LWGUI_ShaderPropertyPreset.asset", menuName = "LWGUI/Shader Property Preset", order = 84)]
|
||||
public class LwguiShaderPropertyPreset : ScriptableObject
|
||||
{
|
||||
public enum PropertyType
|
||||
{
|
||||
Color,
|
||||
Vector,
|
||||
Float,
|
||||
Range,
|
||||
Texture,
|
||||
Integer,
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class PropertyValue
|
||||
{
|
||||
public PropertyValue(MaterialProperty prop)
|
||||
{
|
||||
CopyFromMaterialProperty(prop);
|
||||
}
|
||||
|
||||
public string propertyName;
|
||||
public PropertyType propertyType;
|
||||
public float floatValue;
|
||||
public int intValue;
|
||||
public Color colorValue;
|
||||
public Vector4 vectorValue;
|
||||
public Texture textureValue;
|
||||
|
||||
private int propertyNameID = -1;
|
||||
|
||||
public void Apply(Material material, bool isDefaultMaterial, PerMaterialData perMaterialData = null)
|
||||
{
|
||||
if (propertyNameID == -1 || !material.HasProperty(propertyNameID))
|
||||
propertyNameID = Shader.PropertyToID(propertyName);
|
||||
if (!material.HasProperty(propertyNameID))
|
||||
{
|
||||
// Legacy
|
||||
var propertyNameLower = propertyName.ToLower();
|
||||
switch (propertyNameLower)
|
||||
{
|
||||
case "renderqueue":
|
||||
material.renderQueue = (int)floatValue;
|
||||
return;
|
||||
default:
|
||||
// Debug.LogWarning("Unable to find Preset Property: " + propertyName + " in Material: " + material + "!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (isDefaultMaterial)
|
||||
{
|
||||
switch (propertyType)
|
||||
{
|
||||
case PropertyType.Color:
|
||||
material.SetColor(propertyNameID, colorValue);
|
||||
break;
|
||||
case PropertyType.Vector:
|
||||
material.SetVector(propertyNameID, vectorValue);
|
||||
break;
|
||||
case PropertyType.Float:
|
||||
case PropertyType.Range:
|
||||
material.SetFloat(propertyNameID, floatValue);
|
||||
break;
|
||||
case PropertyType.Integer:
|
||||
material.SetInteger(propertyNameID, intValue);
|
||||
break;
|
||||
case PropertyType.Texture:
|
||||
material.SetTexture(propertyNameID, textureValue);
|
||||
break;
|
||||
}
|
||||
|
||||
UnityEditorExtension.ApplyMaterialPropertyAndDecoratorDrawers(material);
|
||||
}
|
||||
// is Property Primary Material
|
||||
else if (perMaterialData != null)
|
||||
{
|
||||
var propDynamicData = perMaterialData.propDynamicDatas[propertyName];
|
||||
var prop = propDynamicData.property;
|
||||
switch (propertyType)
|
||||
{
|
||||
case PropertyType.Color:
|
||||
prop.colorValue = colorValue;
|
||||
break;
|
||||
case PropertyType.Vector:
|
||||
prop.vectorValue = vectorValue;
|
||||
break;
|
||||
case PropertyType.Float:
|
||||
case PropertyType.Range:
|
||||
prop.floatValue = floatValue;
|
||||
break;
|
||||
case PropertyType.Integer:
|
||||
prop.intValue = intValue;
|
||||
break;
|
||||
case PropertyType.Texture:
|
||||
prop.textureValue = textureValue;
|
||||
break;
|
||||
}
|
||||
|
||||
propDynamicData.hasRevertChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void CopyFromMaterialProperty(MaterialProperty prop)
|
||||
{
|
||||
propertyName = prop.name;
|
||||
switch (prop.GetPropertyType())
|
||||
{
|
||||
case ShaderPropertyType.Color:
|
||||
propertyType = PropertyType.Color;
|
||||
colorValue = prop.colorValue;
|
||||
break;
|
||||
case ShaderPropertyType.Vector:
|
||||
propertyType = PropertyType.Vector;
|
||||
vectorValue = prop.vectorValue;
|
||||
break;
|
||||
case ShaderPropertyType.Float:
|
||||
propertyType = PropertyType.Float;
|
||||
floatValue = prop.floatValue;
|
||||
break;
|
||||
case ShaderPropertyType.Int:
|
||||
propertyType = PropertyType.Integer;
|
||||
intValue = prop.intValue;
|
||||
break;
|
||||
case ShaderPropertyType.Range:
|
||||
propertyType = PropertyType.Range;
|
||||
floatValue = prop.floatValue;
|
||||
break;
|
||||
case ShaderPropertyType.Texture:
|
||||
propertyType = PropertyType.Texture;
|
||||
textureValue = prop.textureValue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnValidate()
|
||||
{
|
||||
propertyNameID = -1;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class Preset
|
||||
{
|
||||
public string presetName;
|
||||
public List<PropertyValue> propertyValues = new List<PropertyValue>();
|
||||
public List<string> enabledKeywords = new List<string>();
|
||||
public List<string> disabledKeywords = new List<string>();
|
||||
public List<string> enabledPasses = new List<string>();
|
||||
public List<string> disabledPasses = new List<string>();
|
||||
public int renderQueue = -1;
|
||||
|
||||
|
||||
public void ApplyToDefaultMaterial(Material material)
|
||||
{
|
||||
foreach (var propertyValue in propertyValues)
|
||||
propertyValue.Apply(material, true);
|
||||
foreach (var enabledKeyword in enabledKeywords)
|
||||
material.EnableKeyword(enabledKeyword);
|
||||
foreach (var disabledKeyword in disabledKeywords)
|
||||
material.DisableKeyword(disabledKeyword);
|
||||
|
||||
Helper.SetShaderPassEnabled(new Object[] { material }, enabledPasses.Select(s => s.ToUpper()).ToArray(), true);
|
||||
Helper.SetShaderPassEnabled(new Object[] { material }, disabledPasses.Select(s => s.ToUpper()).ToArray(), false);
|
||||
|
||||
if (renderQueue >= 0)
|
||||
material.renderQueue = renderQueue;
|
||||
}
|
||||
|
||||
public void ApplyToEditingMaterial(MaterialEditor editor, PerMaterialData perMaterialData)
|
||||
{
|
||||
for (int i = 0; i < editor.targets.Length; i++)
|
||||
{
|
||||
var material = editor.targets[i] as Material;
|
||||
foreach (var propertyValue in propertyValues)
|
||||
propertyValue.Apply(material, false, i == 0 ? perMaterialData : null);
|
||||
foreach (var enabledKeyword in enabledKeywords)
|
||||
{
|
||||
material.EnableKeyword(enabledKeyword);
|
||||
}
|
||||
foreach (var disabledKeyword in disabledKeywords)
|
||||
{
|
||||
material.DisableKeyword(disabledKeyword);
|
||||
}
|
||||
|
||||
if (renderQueue >= 0)
|
||||
material.renderQueue = renderQueue;
|
||||
}
|
||||
|
||||
Helper.SetShaderPassEnabled(editor.targets, enabledPasses.Select(s => s.ToUpper()).ToArray(), true);
|
||||
Helper.SetShaderPassEnabled(editor.targets, disabledPasses.Select(s => s.ToUpper()).ToArray(), false);
|
||||
}
|
||||
|
||||
public void ApplyKeywordsAndPassesToMaterials(Object[] materials)
|
||||
{
|
||||
for (int i = 0; i < materials.Length; i++)
|
||||
{
|
||||
var material = materials[i] as Material;
|
||||
foreach (var enabledKeyword in enabledKeywords)
|
||||
material.EnableKeyword(enabledKeyword);
|
||||
foreach (var disabledKeyword in disabledKeywords)
|
||||
material.DisableKeyword(disabledKeyword);
|
||||
}
|
||||
|
||||
Helper.SetShaderPassEnabled(materials, enabledPasses.Select(s => s.ToUpper()).ToArray(), true);
|
||||
Helper.SetShaderPassEnabled(materials, disabledPasses.Select(s => s.ToUpper()).ToArray(), false);
|
||||
}
|
||||
|
||||
public PropertyValue GetPropertyValue(string propName)
|
||||
{
|
||||
PropertyValue result = null;
|
||||
if (propertyValues != null)
|
||||
{
|
||||
foreach (var propertyValue in propertyValues)
|
||||
{
|
||||
if (propertyValue.propertyName == propName)
|
||||
{
|
||||
result = propertyValue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void AddOrUpdate(MaterialProperty prop)
|
||||
{
|
||||
var propertyValue = GetPropertyValue(prop.name);
|
||||
if (propertyValue != null)
|
||||
propertyValue.CopyFromMaterialProperty(prop);
|
||||
else
|
||||
propertyValues.Add(new PropertyValue(prop));
|
||||
}
|
||||
|
||||
public void AddOrUpdateIncludeExtraProperties(LWGUIMetaDatas metaDatas, MaterialProperty prop)
|
||||
{
|
||||
AddOrUpdate(prop);
|
||||
foreach (var extraPropName in metaDatas.GetPropStaticData(prop).extraPropNames)
|
||||
{
|
||||
AddOrUpdate(metaDatas.GetProperty(extraPropName));
|
||||
}
|
||||
}
|
||||
|
||||
public void Remove(string propName)
|
||||
{
|
||||
var propertyValue = GetPropertyValue(propName);
|
||||
if (propertyValue != null)
|
||||
propertyValues.Remove(propertyValue);
|
||||
}
|
||||
|
||||
public void RemoveIncludeExtraProperties(LWGUIMetaDatas metaDatas, string propName)
|
||||
{
|
||||
Remove(propName);
|
||||
foreach (var extraPropName in metaDatas.GetPropStaticData(propName).extraPropNames)
|
||||
{
|
||||
Remove(metaDatas.GetProperty(extraPropName).name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[SerializeField]
|
||||
private List<Preset> presets;
|
||||
|
||||
public List<Preset> GetPresets() => presets;
|
||||
|
||||
public int GetPresetCount() => presets?.Count ?? 0;
|
||||
|
||||
public Preset GetPreset(int index)
|
||||
{
|
||||
if (presets == null)
|
||||
return null;
|
||||
|
||||
if (index < presets.Count)
|
||||
{
|
||||
return presets[index];
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError($"LWGUI: Index ({ index }) is out of range when accessing PresetFile: { name }");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Preset GetPreset(float index) => GetPreset((int)index);
|
||||
|
||||
private void OnValidate()
|
||||
{
|
||||
// Update All Material Default Values
|
||||
MetaDataHelper.ReleaseAllShadersMetadataCache();
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (PresetHelper.IsInitComplete)
|
||||
PresetHelper.AddPreset(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 42dccf97e5104fe4382a89f9bf084932
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -266,8 +266,8 @@ namespace LWGUI
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (PresetHelper.IsInitComplete)
|
||||
PresetHelper.AddPreset(this);
|
||||
// Legacy class - PresetHelper.AddPreset is not compatible with this type
|
||||
// Use LwguiShaderPropertyPreset instead
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
3
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Editor/Timeline.meta
vendored
Normal file
3
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Editor/Timeline.meta
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4dbe822af8af4057a776320d7ae07018
|
||||
timeCreated: 1741593487
|
||||
3
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Editor/Timeline/Editor.meta
vendored
Normal file
3
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Editor/Timeline/Editor.meta
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6ed1eb9a44434bc4bf43ca612b5a0218
|
||||
timeCreated: 1741922369
|
||||
@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "LWGUI.Timeline.Editor",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"LWGUI",
|
||||
"LWGUI.Timeline",
|
||||
"LWGUI.Runtime.Timeline",
|
||||
"Unity.Timeline",
|
||||
"Unity.Timeline.Editor"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [
|
||||
{
|
||||
"name": "com.unity.timeline",
|
||||
"expression": "1.0.0",
|
||||
"define": "MATERIAL_KEYWORDS_TRACK_REQUIRES_TIMELINE"
|
||||
}
|
||||
],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8f8c453ec76f458e82f3ada63010427a
|
||||
timeCreated: 1741922383
|
||||
@ -0,0 +1,52 @@
|
||||
// Copyright (c) Jason Ma
|
||||
|
||||
#if MATERIAL_KEYWORDS_TRACK_REQUIRES_TIMELINE
|
||||
|
||||
using UnityEditor.Timeline;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Timeline;
|
||||
using LWGUI.Timeline;
|
||||
using LWGUI.Runtime.Timeline;
|
||||
using UnityEngine.Playables;
|
||||
|
||||
namespace LWGUI.Timeline
|
||||
{
|
||||
// Editor used by the TimelineEditor to customize the view of a MaterialKeywordToggleTrack
|
||||
[CustomTimelineEditor(typeof(MaterialKeywordToggleTrack))]
|
||||
public class MaterialKeywordToggleTrackEditor : TrackEditor
|
||||
{
|
||||
public override void OnTrackChanged(TrackAsset track)
|
||||
{
|
||||
base.OnTrackChanged(track);
|
||||
|
||||
if (!VersionControlHelper.IsWriteable(track))
|
||||
return;
|
||||
|
||||
var targetToggleTrack = track as MaterialKeywordToggleTrack;
|
||||
if (targetToggleTrack == null
|
||||
|| targetToggleTrack.srcAnimationTrack == null
|
||||
|| targetToggleTrack.srcAnimationClip == null
|
||||
|| string.IsNullOrEmpty(targetToggleTrack.propName)
|
||||
)
|
||||
return;
|
||||
|
||||
var directors = Object.FindObjectsByType<PlayableDirector>(FindObjectsInactive.Exclude, FindObjectsSortMode.None);
|
||||
foreach (var director in directors)
|
||||
{
|
||||
var targetRenderer = director.GetGenericBinding(targetToggleTrack) as Renderer;
|
||||
var rootAnimator = director.GetGenericBinding(targetToggleTrack.srcAnimationTrack) as Animator;
|
||||
if (targetRenderer == null || rootAnimator == null)
|
||||
continue;
|
||||
|
||||
if (TimelineHelper.GetMaterialPropertyEditorCurveFromAnimationClip(targetRenderer, targetToggleTrack.propName, rootAnimator, targetToggleTrack.srcAnimationClip,
|
||||
out var srcAnimationCurve))
|
||||
{
|
||||
TimelineHelper.CopyAnimationCurveToMaterialKeywordToggleTrack(targetToggleTrack.srcAnimationTrack, srcAnimationCurve, targetToggleTrack);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3289a7f5d9294768a330ba684d33097d
|
||||
timeCreated: 1741863250
|
||||
28
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Editor/Timeline/LWGUI.Timeline.asmdef
vendored
Normal file
28
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Editor/Timeline/LWGUI.Timeline.asmdef
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "LWGUI.Timeline",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"LWGUI.Runtime",
|
||||
"LWGUI.Runtime.Timeline",
|
||||
"Unity.InternalAPIEditorBridge.020",
|
||||
"Unity.Timeline",
|
||||
"Unity.Timeline.Editor"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [
|
||||
{
|
||||
"name": "com.unity.timeline",
|
||||
"expression": "1.0.0",
|
||||
"define": "MATERIAL_KEYWORDS_TRACK_REQUIRES_TIMELINE"
|
||||
}
|
||||
],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e09eeece654a40cf8607f14dca2cc342
|
||||
timeCreated: 1741593491
|
||||
222
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Editor/Timeline/TimelineHelper.cs
vendored
Normal file
222
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Editor/Timeline/TimelineHelper.cs
vendored
Normal file
@ -0,0 +1,222 @@
|
||||
// Copyright (c) Jason Ma
|
||||
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.Playables;
|
||||
|
||||
#if MATERIAL_KEYWORDS_TRACK_REQUIRES_TIMELINE
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Timeline;
|
||||
using LWGUI.Runtime.Timeline;
|
||||
using UnityEditor.Timeline;
|
||||
#endif
|
||||
|
||||
namespace LWGUI.Timeline
|
||||
{
|
||||
public static class TimelineHelper
|
||||
{
|
||||
private const string _GroupTrackName_Base = "LWGUI Tracks";
|
||||
private const string _GroupTrackName_Toggle = "LWGUI Material Keyword Toggle Tracks";
|
||||
private const string _AnimationCurveName_Toggle = "LWGUI Material Keyword Toggle Animation Curve";
|
||||
|
||||
public static void SetKeywordToggleToTimeline(MaterialProperty prop, MaterialEditor editor, string keywordName)
|
||||
{
|
||||
#if MATERIAL_KEYWORDS_TRACK_REQUIRES_TIMELINE
|
||||
// Check
|
||||
{
|
||||
if (editor == null || string.IsNullOrEmpty(keywordName) || keywordName == "_")
|
||||
return;
|
||||
|
||||
var renderer = editor.GetRendererForAnimationMode();
|
||||
if (renderer == null)
|
||||
return;
|
||||
|
||||
ReflectionHelper.MaterialAnimationUtility_OverridePropertyColor(prop, renderer, out Color color);
|
||||
if (color != AnimationMode.recordedPropertyColor)
|
||||
return;
|
||||
}
|
||||
|
||||
var directors = Object.FindObjectsByType<PlayableDirector>(FindObjectsInactive.Exclude, FindObjectsSortMode.None);
|
||||
|
||||
foreach (var renderer in editor.GetMeshRenderersByMaterialEditor())
|
||||
{
|
||||
var parentAnimators = renderer.GetComponentsInParent<Animator>();
|
||||
|
||||
Debug.Assert(parentAnimators != null
|
||||
&& parentAnimators.Length > 0,
|
||||
$"LWGUI: Unable to find parent Animators for MaterialProperty({ prop.name }) and Material({(editor.target as Material).name })!");
|
||||
|
||||
PlayableDirector targetDirector = null;
|
||||
MaterialKeywordToggleTrack targetToggleTrack = null;
|
||||
GroupTrack targetGroupTrack = null;
|
||||
GroupTrack baseGroupTrack = null;
|
||||
TimelineAsset targetTimelineAsset = null;
|
||||
AnimationTrack srcAnimationTrack = null;
|
||||
Animator rootAnimator = null;
|
||||
|
||||
// Find the existing track
|
||||
foreach (var director in directors)
|
||||
{
|
||||
if (director == null || director.playableAsset == null)
|
||||
continue;
|
||||
|
||||
var timelineAsset = director.playableAsset as TimelineAsset;
|
||||
List<TrackAsset> allTrackAssets = new List<TrackAsset>();
|
||||
|
||||
foreach (var rootTrack in timelineAsset.GetRootTracks())
|
||||
{
|
||||
FindAllSubTracksRecursively(rootTrack, allTrackAssets);
|
||||
}
|
||||
|
||||
foreach (var trackAsset in allTrackAssets)
|
||||
{
|
||||
if (trackAsset is AnimationTrack animationTrack)
|
||||
{
|
||||
var bindedAnimator = director.GetGenericBinding(animationTrack);
|
||||
if (parentAnimators.Contains(bindedAnimator))
|
||||
{
|
||||
srcAnimationTrack = animationTrack;
|
||||
targetDirector = director;
|
||||
targetTimelineAsset = timelineAsset;
|
||||
rootAnimator = bindedAnimator as Animator;
|
||||
}
|
||||
}
|
||||
|
||||
if (trackAsset is MaterialKeywordToggleTrack materialKeywordTrack
|
||||
&& director.GetGenericBinding(materialKeywordTrack) == renderer
|
||||
&& materialKeywordTrack.keywordName == keywordName)
|
||||
{
|
||||
targetToggleTrack = materialKeywordTrack;
|
||||
}
|
||||
|
||||
if (trackAsset is GroupTrack groupTrack)
|
||||
{
|
||||
if (groupTrack.name == _GroupTrackName_Toggle)
|
||||
targetGroupTrack = groupTrack;
|
||||
if (groupTrack.name == _GroupTrackName_Base)
|
||||
baseGroupTrack = groupTrack;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Assert(targetDirector != null
|
||||
&& targetTimelineAsset != null
|
||||
&& srcAnimationTrack != null
|
||||
&& rootAnimator != null,
|
||||
$"LWGUI: Unable to find the existing Animation Track for MaterialProperty({ prop.name }) and Material({(editor.target as Material).name })!");
|
||||
|
||||
// Create a track
|
||||
if (targetToggleTrack == null)
|
||||
{
|
||||
if (baseGroupTrack == null)
|
||||
{
|
||||
baseGroupTrack = targetTimelineAsset.CreateTrack<GroupTrack>();
|
||||
baseGroupTrack.name = _GroupTrackName_Base;
|
||||
}
|
||||
|
||||
if (targetGroupTrack == null)
|
||||
{
|
||||
targetGroupTrack = targetTimelineAsset.CreateTrack<GroupTrack>();
|
||||
targetGroupTrack.name = _GroupTrackName_Toggle;
|
||||
targetGroupTrack.SetGroup(baseGroupTrack);
|
||||
}
|
||||
|
||||
targetToggleTrack = targetTimelineAsset.CreateTrack<MaterialKeywordToggleTrack>();
|
||||
targetToggleTrack.keywordName = keywordName;
|
||||
targetToggleTrack.propName = prop.name;
|
||||
targetToggleTrack.srcAnimationTrack = srcAnimationTrack;
|
||||
targetToggleTrack.SetGroup(targetGroupTrack);
|
||||
targetDirector.SetGenericBinding(targetToggleTrack, renderer);
|
||||
}
|
||||
|
||||
// Find the Animation Curve
|
||||
AnimationClip srcAnimationClip = srcAnimationTrack.infiniteClip ?? srcAnimationTrack.curves;
|
||||
if (srcAnimationClip != null && GetMaterialPropertyEditorCurveFromAnimationClip(renderer, prop.name, rootAnimator, srcAnimationClip,
|
||||
out var srcAnimationCurve))
|
||||
{
|
||||
targetToggleTrack.srcAnimationClip = srcAnimationClip;
|
||||
|
||||
CopyAnimationCurveToMaterialKeywordToggleTrack(srcAnimationTrack, srcAnimationCurve, targetToggleTrack);
|
||||
}
|
||||
|
||||
TimelineEditor.Refresh(RefreshReason.ContentsAddedOrRemoved | RefreshReason.ContentsModified);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MATERIAL_KEYWORDS_TRACK_REQUIRES_TIMELINE
|
||||
public static bool CopyAnimationCurveToMaterialKeywordToggleTrack(AnimationTrack srcAnimationTrack, AnimationCurve srcAnimationCurve,
|
||||
MaterialKeywordToggleTrack dstToggleTrack)
|
||||
{
|
||||
if (srcAnimationCurve == null || dstToggleTrack == null)
|
||||
return false;
|
||||
|
||||
var clips = dstToggleTrack.GetClips().ToList();
|
||||
if (clips.Count > 1)
|
||||
{
|
||||
foreach (var clip in clips)
|
||||
{
|
||||
dstToggleTrack.DeleteClip(clip);
|
||||
}
|
||||
}
|
||||
|
||||
TimelineClip currentClip = null;
|
||||
if (!dstToggleTrack.GetClips().Any())
|
||||
{
|
||||
currentClip = dstToggleTrack.CreateClip<MaterialKeywordTogglePlayableAsset>();
|
||||
}
|
||||
else
|
||||
{
|
||||
currentClip = dstToggleTrack.GetClips().ToArray()[0];
|
||||
}
|
||||
|
||||
if (currentClip == null || currentClip.asset is not MaterialKeywordTogglePlayableAsset)
|
||||
return false;
|
||||
|
||||
currentClip.start = srcAnimationTrack.start;
|
||||
currentClip.duration = srcAnimationTrack.duration;
|
||||
|
||||
if (!currentClip.hasCurves)
|
||||
currentClip.CreateCurves($"{ dstToggleTrack.keywordName } ({ _AnimationCurveName_Toggle })");
|
||||
|
||||
// Bind to MaterialKeywordPlayableBehaviour.value
|
||||
var binding = EditorCurveBinding.FloatCurve(string.Empty, typeof(MaterialKeywordTogglePlayableAsset), "value");
|
||||
AnimationUtility.SetEditorCurve(currentClip.curves, binding, srcAnimationCurve);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool GetMaterialPropertyEditorCurveFromAnimationClip(Renderer renderer, string propName, Animator rootAnimator, AnimationClip srcAnimationClip,
|
||||
out AnimationCurve outAnimationCurve)
|
||||
{
|
||||
outAnimationCurve = null;
|
||||
|
||||
var bindings = AnimationUtility.GetCurveBindings(srcAnimationClip);
|
||||
foreach (var binding in bindings)
|
||||
{
|
||||
var animatedObj = AnimationUtility.GetAnimatedObject(rootAnimator.gameObject, binding);
|
||||
if (animatedObj == renderer
|
||||
&& binding.propertyName == "material." + propName)
|
||||
{
|
||||
outAnimationCurve = AnimationUtility.GetEditorCurve(srcAnimationClip, binding);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void FindAllSubTracksRecursively(TrackAsset trackAsset, List<TrackAsset> outTrackAssets)
|
||||
{
|
||||
outTrackAssets ??= new List<TrackAsset>();
|
||||
outTrackAssets.Add(trackAsset);
|
||||
foreach (var childTrack in trackAsset.GetChildTracks())
|
||||
{
|
||||
FindAllSubTracksRecursively(childTrack, outTrackAssets);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9d1ff48409644223af93bcf82b379a3b
|
||||
timeCreated: 1741747578
|
||||
BIN
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/README.md
(Stored with Git LFS)
vendored
BIN
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/README.md
(Stored with Git LFS)
vendored
Binary file not shown.
BIN
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/README_CN.md
(Stored with Git LFS)
vendored
BIN
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/README_CN.md
(Stored with Git LFS)
vendored
Binary file not shown.
@ -21,7 +21,7 @@ namespace LWGUI.Runtime.LwguiGradient
|
||||
Num = 4
|
||||
}
|
||||
|
||||
[Flags]
|
||||
[Flags] // Flags Attribute must be used to support bit operations
|
||||
public enum ChannelMask
|
||||
{
|
||||
None = 0,
|
||||
@ -30,7 +30,7 @@ namespace LWGUI.Runtime.LwguiGradient
|
||||
Blue = 1 << 2,
|
||||
Alpha = 1 << 3,
|
||||
RGB = Red | Green | Blue,
|
||||
All = RGB | Alpha
|
||||
All = ~0
|
||||
}
|
||||
|
||||
public enum GradientTimeRange
|
||||
@ -61,6 +61,49 @@ namespace LWGUI.Runtime.LwguiGradient
|
||||
|
||||
// The complete data is stored by RGBA Curves and can be converted into Texture
|
||||
[SerializeField] private List<AnimationCurve> _curves;
|
||||
|
||||
public List<AnimationCurve> rawCurves
|
||||
{
|
||||
get
|
||||
{
|
||||
_curves ??= new List<AnimationCurve>();
|
||||
if (_curves.Count < (int)Channel.Num)
|
||||
{
|
||||
for (int c = 0; c < (int)Channel.Num; c++)
|
||||
{
|
||||
if (c == _curves.Count)
|
||||
_curves.Add(defaultCurve);
|
||||
}
|
||||
}
|
||||
|
||||
return _curves;
|
||||
}
|
||||
set => SetRgbaCurves(value);
|
||||
}
|
||||
|
||||
public AnimationCurve redCurve
|
||||
{
|
||||
get => rawCurves[(int)Channel.Red] ?? defaultCurve;
|
||||
set => SetCurve(value, ChannelMask.Red);
|
||||
}
|
||||
|
||||
public AnimationCurve greenCurve
|
||||
{
|
||||
get => rawCurves[(int)Channel.Green] ?? defaultCurve;
|
||||
set => SetCurve(value, ChannelMask.Green);
|
||||
}
|
||||
|
||||
public AnimationCurve blueCurve
|
||||
{
|
||||
get => rawCurves[(int)Channel.Blue] ?? defaultCurve;
|
||||
set => SetCurve(value, ChannelMask.Blue);
|
||||
}
|
||||
|
||||
public AnimationCurve alphaCurve
|
||||
{
|
||||
get => rawCurves[(int)Channel.Alpha] ?? defaultCurve;
|
||||
set => SetCurve(value, ChannelMask.Alpha);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@ -248,7 +291,7 @@ namespace LWGUI.Runtime.LwguiGradient
|
||||
if (!IsChannelIndexInMask(c, channelMask))
|
||||
continue;
|
||||
|
||||
_curves[c].AddKey(key);
|
||||
rawCurves[c].AddKey(key);
|
||||
}
|
||||
|
||||
}
|
||||
@ -261,60 +304,28 @@ namespace LWGUI.Runtime.LwguiGradient
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<AnimationCurve> rawCurves
|
||||
{
|
||||
get => _curves;
|
||||
set => SetRgbaCurves(value);
|
||||
}
|
||||
|
||||
public AnimationCurve redCurve
|
||||
{
|
||||
get => _curves[(int)Channel.Red] ?? defaultCurve;
|
||||
set => SetCurve(value, ChannelMask.Red);
|
||||
}
|
||||
|
||||
public AnimationCurve greenCurve
|
||||
{
|
||||
get => _curves[(int)Channel.Green] ?? defaultCurve;
|
||||
set => SetCurve(value, ChannelMask.Green);
|
||||
}
|
||||
|
||||
public AnimationCurve blueCurve
|
||||
{
|
||||
get => _curves[(int)Channel.Blue] ?? defaultCurve;
|
||||
set => SetCurve(value, ChannelMask.Blue);
|
||||
}
|
||||
|
||||
public AnimationCurve alphaCurve
|
||||
{
|
||||
get => _curves[(int)Channel.Alpha] ?? defaultCurve;
|
||||
set => SetCurve(value, ChannelMask.Alpha);
|
||||
}
|
||||
|
||||
|
||||
public Color Evaluate(float time, ChannelMask channelMask = ChannelMask.All, GradientTimeRange timeRange = GradientTimeRange.One)
|
||||
{
|
||||
time /= (int)timeRange;
|
||||
|
||||
if (channelMask == ChannelMask.Alpha)
|
||||
{
|
||||
var alpha = _curves[(int)Channel.Alpha].Evaluate(time);
|
||||
var alpha = rawCurves[(int)Channel.Alpha].Evaluate(time);
|
||||
return new Color(alpha, alpha, alpha, 1);
|
||||
}
|
||||
|
||||
return new Color(
|
||||
IsChannelIndexInMask((int)Channel.Red, channelMask) ? _curves[(int)Channel.Red].Evaluate(time) : 0,
|
||||
IsChannelIndexInMask((int)Channel.Green, channelMask) ? _curves[(int)Channel.Green].Evaluate(time) : 0,
|
||||
IsChannelIndexInMask((int)Channel.Blue, channelMask) ? _curves[(int)Channel.Blue].Evaluate(time) : 0,
|
||||
IsChannelIndexInMask((int)Channel.Alpha, channelMask) ? _curves[(int)Channel.Alpha].Evaluate(time) : 1);
|
||||
IsChannelIndexInMask((int)Channel.Red, channelMask) ? rawCurves[(int)Channel.Red].Evaluate(time) : 0,
|
||||
IsChannelIndexInMask((int)Channel.Green, channelMask) ? rawCurves[(int)Channel.Green].Evaluate(time) : 0,
|
||||
IsChannelIndexInMask((int)Channel.Blue, channelMask) ? rawCurves[(int)Channel.Blue].Evaluate(time) : 0,
|
||||
IsChannelIndexInMask((int)Channel.Alpha, channelMask) ? rawCurves[(int)Channel.Alpha].Evaluate(time) : 1);
|
||||
}
|
||||
|
||||
public void SetLinearTangentMode()
|
||||
{
|
||||
for (int c = 0; c < (int)Channel.Num; c++)
|
||||
{
|
||||
_curves[c].SetLinearTangents();
|
||||
rawCurves[c].SetLinearTangents();
|
||||
}
|
||||
}
|
||||
|
||||
@ -336,6 +347,23 @@ namespace LWGUI.Runtime.LwguiGradient
|
||||
return pixels;
|
||||
}
|
||||
|
||||
public void GetPixels(ref Color[] outputPixels, ref int currentIndex, int width, int height, ChannelMask channelMask = ChannelMask.All)
|
||||
{
|
||||
if (outputPixels == null || currentIndex >= outputPixels.Length)
|
||||
return;
|
||||
|
||||
for (var x = 0; x < width; x++)
|
||||
{
|
||||
var u = x / (float)width;
|
||||
var col = Evaluate(u, channelMask);
|
||||
for (int i = 0; i < height; i++)
|
||||
{
|
||||
if (currentIndex < outputPixels.Length)
|
||||
outputPixels[currentIndex ++] = col;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Texture2D GetPreviewRampTexture(int width = 256, int height = 1, ColorSpace colorSpace = ColorSpace.Gamma, ChannelMask channelMask = ChannelMask.All)
|
||||
{
|
||||
if (LwguiGradientHelper.TryGetRampPreview(this, width, height, colorSpace, channelMask, out var cachedPreview))
|
||||
@ -492,9 +520,39 @@ namespace LWGUI.Runtime.LwguiGradient
|
||||
|
||||
public Gradient ToGradient(int maxGradientKeyCount = 8)
|
||||
{
|
||||
return new LwguiMergedColorCurves(_curves).ToGradient(maxGradientKeyCount);
|
||||
return new LwguiMergedColorCurves(rawCurves).ToGradient(maxGradientKeyCount);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Gamma <=> Linear
|
||||
|
||||
public LwguiGradient ConvertColorSpaceWithoutCopy(ColorSpace targetColorSpace)
|
||||
{
|
||||
for (int c = 0; c < (int)Channel.Num; c++)
|
||||
{
|
||||
if (c != (int)Channel.Alpha)
|
||||
{
|
||||
var keys = rawCurves[c].keys;
|
||||
for (int i = 0; i < keys.Length; i++)
|
||||
{
|
||||
if (targetColorSpace == ColorSpace.Gamma)
|
||||
keys[i].value = Mathf.LinearToGammaSpace(keys[i].value);
|
||||
else
|
||||
keys[i].value = Mathf.GammaToLinearSpace(keys[i].value);
|
||||
}
|
||||
|
||||
rawCurves[c].keys = keys;
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public LwguiGradient gamma => new LwguiGradient(this).ConvertColorSpaceWithoutCopy(ColorSpace.Gamma);
|
||||
|
||||
public LwguiGradient linear => new LwguiGradient(this).ConvertColorSpaceWithoutCopy(ColorSpace.Linear);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
12
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Runtime/RuntimeHelper.cs
vendored
Normal file
12
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Runtime/RuntimeHelper.cs
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
// Copyright (c) Jason Ma
|
||||
|
||||
namespace LWGUI.Runtime
|
||||
{
|
||||
public static class RuntimeHelper
|
||||
{
|
||||
public static bool IsBitEnabled(int intValue, int bitIndex) => (intValue & 1U << bitIndex) > 0;
|
||||
|
||||
public static int SetBitEnabled(int intValue, int bitIndex, bool enabled)
|
||||
=> enabled ? intValue | (int)(1U << bitIndex) : intValue ^ (int)(1U << bitIndex);
|
||||
}
|
||||
}
|
||||
3
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Runtime/RuntimeHelper.cs.meta
vendored
Normal file
3
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Runtime/RuntimeHelper.cs.meta
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a19e5812ea8041189f11f71becdacc65
|
||||
timeCreated: 1747294166
|
||||
3
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Runtime/Timeline.meta
vendored
Normal file
3
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Runtime/Timeline.meta
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 481e97f295ef467ca1418f794f3df2a4
|
||||
timeCreated: 1741335390
|
||||
@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "LWGUI.Runtime.Timeline",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"Unity.Timeline"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [
|
||||
{
|
||||
"name": "com.unity.timeline",
|
||||
"expression": "1.0.0",
|
||||
"define": "MATERIAL_KEYWORDS_TRACK_REQUIRES_TIMELINE"
|
||||
}
|
||||
],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f10f42f427ca48b45af8e3d035229d3a
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8685e0ce73a24fc5ac00a916682ec7f8
|
||||
timeCreated: 1741858576
|
||||
@ -0,0 +1,30 @@
|
||||
// Copyright (c) Jason Ma
|
||||
|
||||
#if MATERIAL_KEYWORDS_TRACK_REQUIRES_TIMELINE
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace LWGUI.Runtime.Timeline
|
||||
{
|
||||
// Represents the serialized data for a clip on the MaterialKeywordToggleTrack
|
||||
[Serializable]
|
||||
public class MaterialKeywordTogglePlayableAsset : PlayableAsset, ITimelineClipAsset
|
||||
{
|
||||
public MaterialKeywordTogglePlayableBehaviour template = new ();
|
||||
|
||||
// Implementation of ITimelineClipAsset. This specifies the capabilities of this timeline clip inside the editor.
|
||||
public ClipCaps clipCaps => ClipCaps.None;
|
||||
|
||||
// Creates the playable that represents the instance of this clip.
|
||||
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
|
||||
{
|
||||
// Using a template will clone the serialized values
|
||||
return ScriptPlayable<MaterialKeywordTogglePlayableBehaviour>.Create(graph, template);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5a38fd00a4ee4dbd9c0e7ab158f2013d
|
||||
timeCreated: 1741593842
|
||||
@ -0,0 +1,19 @@
|
||||
// Copyright (c) Jason Ma
|
||||
|
||||
#if MATERIAL_KEYWORDS_TRACK_REQUIRES_TIMELINE
|
||||
|
||||
using System;
|
||||
using UnityEngine.Playables;
|
||||
|
||||
namespace LWGUI.Runtime.Timeline
|
||||
{
|
||||
// Runtime representation of a MaterialKeywordToggleClip.
|
||||
// The Serializable attribute is required to be animated by timeline, and used as a template.
|
||||
[Serializable]
|
||||
public class MaterialKeywordTogglePlayableBehaviour : PlayableBehaviour
|
||||
{
|
||||
public float value;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7ce1592356ba46b28ca0f037104c1b5e
|
||||
timeCreated: 1741593842
|
||||
@ -0,0 +1,48 @@
|
||||
// Copyright (c) Jason Ma
|
||||
|
||||
#if MATERIAL_KEYWORDS_TRACK_REQUIRES_TIMELINE
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace LWGUI.Runtime.Timeline
|
||||
{
|
||||
/// <summary>
|
||||
/// When recording material parameter animation, Keyword changes are automatically captured and the track is added to the Timeline Asset.
|
||||
/// The Keyword state is set according to the float value during runtime.
|
||||
///
|
||||
/// Supports Toggle-type Drawer with Keyword.
|
||||
/// </summary>
|
||||
[TrackColor(127.0f * 0.7f / 255.0f, 214.0f * 0.7f / 255.0f, 252.0f * 0.7f / 255.0f)]
|
||||
[TrackClipType(typeof(MaterialKeywordTogglePlayableAsset))]
|
||||
[TrackBindingType(typeof(Renderer))]
|
||||
public class MaterialKeywordToggleTrack : TrackAsset
|
||||
{
|
||||
public string keywordName;
|
||||
public string propName;
|
||||
public AnimationTrack srcAnimationTrack = null;
|
||||
public AnimationClip srcAnimationClip = null;
|
||||
|
||||
// Creates a runtime instance of the track, represented by a PlayableBehaviour.
|
||||
// The runtime instance performs mixing on the timeline clips.
|
||||
public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
foreach (var clip in GetClips())
|
||||
{
|
||||
clip.displayName = keywordName + " (Enabled Material Keyword)";
|
||||
}
|
||||
#endif
|
||||
|
||||
var template = new MaterialKeywordToggleTrackBehaviour
|
||||
{
|
||||
keywordName = keywordName
|
||||
};
|
||||
|
||||
return ScriptPlayable<MaterialKeywordToggleTrackBehaviour>.Create(graph, template, inputCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 526a1c6b17ba42aa9d8af998102a01d5
|
||||
timeCreated: 1741593842
|
||||
@ -0,0 +1,87 @@
|
||||
// Copyright (c) Jason Ma
|
||||
|
||||
#if MATERIAL_KEYWORDS_TRACK_REQUIRES_TIMELINE
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
|
||||
namespace LWGUI.Runtime.Timeline
|
||||
{
|
||||
// The runtime instance of a the MaterialKeywordToggleTrack. It is responsible for blending and setting the final data
|
||||
public class MaterialKeywordToggleTrackBehaviour : PlayableBehaviour
|
||||
{
|
||||
public string keywordName;
|
||||
|
||||
private bool _defaultEnabled;
|
||||
private Renderer _targetRenderer;
|
||||
|
||||
// Called every frame that the timeline is evaluated. ProcessFrame is invoked after its' inputs.
|
||||
public override void ProcessFrame(Playable playable, FrameData info, object playerData)
|
||||
{
|
||||
SetDefaults(playerData as Renderer);
|
||||
if (_targetRenderer == null || string.IsNullOrEmpty(keywordName))
|
||||
return;
|
||||
|
||||
bool enabled = false;
|
||||
for (int i = 0; i < playable.GetInputCount(); i++)
|
||||
{
|
||||
float inputWeight = playable.GetInputWeight(i);
|
||||
ScriptPlayable<MaterialKeywordTogglePlayableBehaviour> inputPlayable = (ScriptPlayable<MaterialKeywordTogglePlayableBehaviour>)playable.GetInput(i);
|
||||
MaterialKeywordTogglePlayableBehaviour input = inputPlayable.GetBehaviour();
|
||||
|
||||
enabled = inputWeight > 0 && input.value > 0;
|
||||
|
||||
if (enabled)
|
||||
break;
|
||||
}
|
||||
|
||||
foreach (var mat in Application.isPlaying ? _targetRenderer.materials : _targetRenderer.sharedMaterials)
|
||||
{
|
||||
if (enabled)
|
||||
mat.EnableKeyword(keywordName);
|
||||
else
|
||||
mat.DisableKeyword(keywordName);
|
||||
}
|
||||
}
|
||||
|
||||
// Invoked when the playable graph is destroyed, typically when PlayableDirector.Stop is called or the timeline
|
||||
// is complete.
|
||||
public override void OnPlayableDestroy(Playable playable)
|
||||
{
|
||||
RestoreDefaults();
|
||||
_targetRenderer = null;
|
||||
}
|
||||
|
||||
private void SetDefaults(Renderer renderer)
|
||||
{
|
||||
if (renderer == _targetRenderer)
|
||||
return;
|
||||
|
||||
_targetRenderer = renderer;
|
||||
if (_targetRenderer != null && !string.IsNullOrEmpty(keywordName))
|
||||
{
|
||||
var mat = Application.isPlaying ? _targetRenderer.material : _targetRenderer.sharedMaterial;
|
||||
if (mat != null)
|
||||
{
|
||||
_defaultEnabled = mat.IsKeywordEnabled(keywordName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void RestoreDefaults()
|
||||
{
|
||||
if (_targetRenderer == null || string.IsNullOrEmpty(keywordName))
|
||||
return;
|
||||
|
||||
foreach (var mat in Application.isPlaying ? _targetRenderer.materials : _targetRenderer.sharedMaterials)
|
||||
{
|
||||
if (_defaultEnabled)
|
||||
mat.EnableKeyword(keywordName);
|
||||
else
|
||||
mat.DisableKeyword(keywordName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 91e9cf71c8a5458d93d522b59d7badfe
|
||||
timeCreated: 1741593842
|
||||
BIN
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_RampAtlas.asset
(Stored with Git LFS)
vendored
Normal file
BIN
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_RampAtlas.asset
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
8
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_RampAtlas.asset.meta
vendored
Normal file
8
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_RampAtlas.asset.meta
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cad9250226f9d224ea9ef2054ffa834c
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_RampAtlas.tga
(Stored with Git LFS)
vendored
Normal file
BIN
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_RampAtlas.tga
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
130
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_RampAtlas.tga.meta
vendored
Normal file
130
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_RampAtlas.tga.meta
vendored
Normal file
@ -0,0 +1,130 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cfbe5a628e96c0d4bae3645ad922a368
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 1
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: 4
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Server
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData: '{"MonoBehaviour":{"m_Enabled":true,"m_EditorHideFlags":0,"m_Name":"LWGUI_RampAtlas","m_EditorClassIdentifier":"","rampAtlasWidth":256,"rampAtlasHeight":8,"rampAtlasSRGB":true,"_ramps":[{"name":"Default
|
||||
Ramp","gradient":{"_curves":[{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4},{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.0,"inSlope":0.0,"outSlope":1.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":1.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4},{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.0,"inSlope":0.0,"outSlope":1.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":1.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4},{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}]},"colorSpace":0,"channelMask":15,"timeRange":1},{"name":"Default
|
||||
Ramp","gradient":{"_curves":[{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":-0.00004999999873689376,"value":0.0,"inSlope":0.0,"outSlope":0.9999500513076782,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.9999500513076782,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4},{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":-0.00004999999873689376,"value":0.9492826461791992,"inSlope":0.0,"outSlope":0.05071482062339783,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.05071482062339783,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4},{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":-0.00004999999873689376,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4},{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}]},"colorSpace":0,"channelMask":15,"timeRange":1},{"name":"New
|
||||
Ramp","gradient":{"_curves":[{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4},{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4},{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4},{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}]},"colorSpace":0,"channelMask":-1,"timeRange":1},{"name":"Green","gradient":{"_curves":[{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4},{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.0,"inSlope":0.0,"outSlope":1.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":1.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4},{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4},{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}]},"colorSpace":1,"channelMask":10,"timeRange":24}],"_saveTextureToggle":false}}'
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
118
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_SampleDrawerA.mat
vendored
Normal file
118
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_SampleDrawerA.mat
vendored
Normal file
@ -0,0 +1,118 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: LWGUI_SampleDrawerA
|
||||
m_Shader: {fileID: 4800000, guid: ded91f399f8343d4f9b0cf33eda0088d, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords:
|
||||
- KEY2
|
||||
- _KEYWORD
|
||||
- _ZWRITE_ON
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: 3000
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _Ramp:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _Ramp2:
|
||||
m_Texture: {fileID: 2800000, guid: fad186cbfd0faf2488e2edb774c6d08f, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _RampAtlas:
|
||||
m_Texture: {fileID: 2800000, guid: a515311e7e4a4694191895bf48c01468, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _normal:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _tex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints:
|
||||
- _Stencil: 172
|
||||
- _StencilWithDescription: 0
|
||||
m_Floats:
|
||||
- _BlendMode: 1
|
||||
- _ColorMask: 15
|
||||
- _Cull: 2
|
||||
- _DstBlend: 10
|
||||
- _PresetGroup: 0
|
||||
- _Queue: 2000
|
||||
- _RampAtlasIndex0: 0
|
||||
- _RampAtlasIndex1: 2
|
||||
- _RampAtlasIndex2: 3
|
||||
- _RampAtlasIndexer: 0
|
||||
- _SrcBlend: 5
|
||||
- _ZTest: 4
|
||||
- _ZWrite: 0
|
||||
- _blendMode: 1
|
||||
- _enum: 1
|
||||
- _enum1: 0
|
||||
- _enum2: 0
|
||||
- _enum3: 0
|
||||
- _enum3_range: 0
|
||||
- _enumFloat1: 0
|
||||
- _enumFloat2: 0
|
||||
- _enumFloat3: 0
|
||||
- _enumFloat4_range: 0
|
||||
- _float: 1
|
||||
- _float2: 1.17
|
||||
- _float3: 2
|
||||
- _float30: 2
|
||||
- _float31: 2
|
||||
- _float32: 2
|
||||
- _float33: 2
|
||||
- _float34: 2
|
||||
- _float35: 2
|
||||
- _float36: 2
|
||||
- _float4: 2
|
||||
- _float_keyword: 0
|
||||
- _float_tooltip_helpbox: 0
|
||||
- _group: 0
|
||||
- _group2: 1
|
||||
- _group3: 1
|
||||
- _group4: 1
|
||||
- _group5: 1
|
||||
- _group6: 1
|
||||
- _group7: 1
|
||||
- _group8: 1
|
||||
- _powerSlider: 39.1
|
||||
- _toggle: 0
|
||||
- _toggle_keyword: 0
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 0.5529412}
|
||||
- _Color00: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Color001: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Color0012: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Color11: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Color1122: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Color11222: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Color112223: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _hdr: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _mColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _mColor1: {r: 1, g: 0, b: 0, a: 1}
|
||||
- _mColor2: {r: 0.68301886, g: 1, b: 0.68301886, a: 1}
|
||||
- _mColor3: {r: 0, g: 0, b: 1, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
8
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_SampleDrawerA.mat.meta
vendored
Normal file
8
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_SampleDrawerA.mat.meta
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ddde4f59ff87bc842838b9aae66978c8
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
117
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_SampleDrawerA1.mat
vendored
Normal file
117
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_SampleDrawerA1.mat
vendored
Normal file
@ -0,0 +1,117 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: LWGUI_SampleDrawerA1
|
||||
m_Shader: {fileID: 4800000, guid: ded91f399f8343d4f9b0cf33eda0088d, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords:
|
||||
- KEY2
|
||||
- _KEYWORD
|
||||
- _ZWRITE_ON
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: 3000
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _Ramp:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _Ramp2:
|
||||
m_Texture: {fileID: 2800000, guid: 7e050a45dc871a549a2530bd4acf96ba, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _RampAtlas:
|
||||
m_Texture: {fileID: 2800000, guid: 5d501ab9fed726e4baa7d838819327e9, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _normal:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _tex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints:
|
||||
- _Stencil: 0
|
||||
- _StencilWithDescription: 0
|
||||
m_Floats:
|
||||
- _BlendMode: 1
|
||||
- _ColorMask: 15
|
||||
- _Cull: 2
|
||||
- _DstBlend: 10
|
||||
- _PresetGroup: 0
|
||||
- _Queue: 2000
|
||||
- _RampAtlasIndex0: 0
|
||||
- _RampAtlasIndex1: 2
|
||||
- _RampAtlasIndexer: 0
|
||||
- _SrcBlend: 5
|
||||
- _ZTest: 4
|
||||
- _ZWrite: 0
|
||||
- _blendMode: 1
|
||||
- _enum: 1
|
||||
- _enum1: 0
|
||||
- _enum2: 0
|
||||
- _enum3: 0
|
||||
- _enum3_range: 0
|
||||
- _enumFloat1: 0
|
||||
- _enumFloat2: 0
|
||||
- _enumFloat3: 0
|
||||
- _enumFloat4_range: 0
|
||||
- _float: 1
|
||||
- _float2: 1.17
|
||||
- _float3: 2
|
||||
- _float30: 2
|
||||
- _float31: 2
|
||||
- _float32: 2
|
||||
- _float33: 2
|
||||
- _float34: 2
|
||||
- _float35: 2
|
||||
- _float36: 2
|
||||
- _float4: 2
|
||||
- _float_keyword: 0
|
||||
- _float_tooltip_helpbox: 0
|
||||
- _group: 0
|
||||
- _group2: 1
|
||||
- _group3: 1
|
||||
- _group4: 1
|
||||
- _group5: 1
|
||||
- _group6: 1
|
||||
- _group7: 1
|
||||
- _group8: 1
|
||||
- _powerSlider: 39.1
|
||||
- _toggle: 0
|
||||
- _toggle_keyword: 0
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 0.5529412}
|
||||
- _Color00: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Color001: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Color0012: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Color11: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Color1122: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Color11222: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Color112223: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _hdr: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _mColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _mColor1: {r: 1, g: 0, b: 0, a: 1}
|
||||
- _mColor2: {r: 0.68301886, g: 1, b: 0.68301886, a: 1}
|
||||
- _mColor3: {r: 0, g: 0, b: 1, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
8
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_SampleDrawerA1.mat.meta
vendored
Normal file
8
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_SampleDrawerA1.mat.meta
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5c1027b710f71c44582d6fd0db0b9ca0
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
142
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_SampleDrawerB.mat
vendored
Normal file
142
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_SampleDrawerB.mat
vendored
Normal file
@ -0,0 +1,142 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: LWGUI_SampleDrawerB
|
||||
m_Shader: {fileID: 4800000, guid: 7ee048c9536c0344bb8b4860595a4d9b, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords:
|
||||
- _GROUP_ON
|
||||
- _KEY2
|
||||
- _KEY3
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: 3000
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _AdvancedImage:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _AdvancedTex0:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _AdvancedTex1:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _LinearRamp:
|
||||
m_Texture: {fileID: 2800000, guid: 6293a417776889843b0c6d20f25677be, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _Ramp:
|
||||
m_Texture: {fileID: 2800000, guid: 87addb69bcbcc9b4ea7336eff8d6a52b, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _Tex:
|
||||
m_Texture: {fileID: 2800000, guid: 5366ba78a5c67fb498c8b4db71177ac2, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _normal:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _sRGBRamp:
|
||||
m_Texture: {fileID: 2800000, guid: fad186cbfd0faf2488e2edb774c6d08f, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _tex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _tex_channel:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _tex_color:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _tex_float:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _tex_range:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _tex_single_line:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _tex_toggle:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AdvancedFloat: 0
|
||||
- _AdvancedImage: 0
|
||||
- _AdvancedRange0: 0.252
|
||||
- _Advancedfloat0: 0.12
|
||||
- _Advancedfloat1: 0.13
|
||||
- _Advancedfloat3: 0.21
|
||||
- _Advancedfloat4: 0
|
||||
- _Advancedfloat7: 0.24
|
||||
- _button0: 0
|
||||
- _enum: 1
|
||||
- _float: -0.46
|
||||
- _float1: -0.05
|
||||
- _float2: -0.08
|
||||
- _float3: 0
|
||||
- _float4: 2
|
||||
- _floatN: 0
|
||||
- _float_helpbox: 1
|
||||
- _float_tooltip: 1
|
||||
- _group: 1
|
||||
- _group1: 0
|
||||
- _group2: 0
|
||||
- _group3: 0
|
||||
- _key13_PowerSlider: 0.199
|
||||
- _key1_Float1: 0
|
||||
- _key2_Float2: 0
|
||||
- _key3_Float3: -0.34
|
||||
- _key3_Float3_Range: 0.329
|
||||
- _key3_Float4_PowerSlider: 0
|
||||
- _key3_Int_Range: 1
|
||||
- _minMaxSlider: 1
|
||||
- _preset: 0
|
||||
- _preset1: 0
|
||||
- _preset_toggle: 0
|
||||
- _range: 0.42
|
||||
- _rangeEnd: 0.70471865
|
||||
- _rangeStart: 0.20471871
|
||||
- _textureFloat1: 1
|
||||
- _toggle: 0
|
||||
- _toggle1: 1
|
||||
m_Colors:
|
||||
- _AdvancedColor0: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _AdvancedColor7: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _color: {r: 1, g: 0.5886792, b: 0.5886792, a: 1}
|
||||
- _color1: {r: 0, g: 1, b: 0.296113, a: 0}
|
||||
- _mColor: {r: 0.6132076, g: 0.4014774, b: 0.4014774, a: 1}
|
||||
- _mColor1: {r: 1, g: 0, b: 0, a: 1}
|
||||
- _mColor2: {r: 0, g: 1, b: 0, a: 1}
|
||||
- _mColor3: {r: 0, g: 0, b: 1, a: 1}
|
||||
- _textureChannelMask: {r: 0, g: 1, b: 0, a: 0}
|
||||
- _textureChannelMask1: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _vector1: {r: 1.32, g: 1, b: 1, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
8
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_SampleDrawerB.mat.meta
vendored
Normal file
8
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_SampleDrawerB.mat.meta
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d9611311befa11f4f944025e015b7f24
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
139
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_SampleDrawerB1.mat
vendored
Normal file
139
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_SampleDrawerB1.mat
vendored
Normal file
@ -0,0 +1,139 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: LWGUI_SampleDrawerB1
|
||||
m_Shader: {fileID: 4800000, guid: 7ee048c9536c0344bb8b4860595a4d9b, type: 3}
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords:
|
||||
- _KEY1
|
||||
- _KEY2
|
||||
- _KEY3
|
||||
- _KEYWORD
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _AdvancedImage:
|
||||
m_Texture: {fileID: 2800000, guid: 63de4a0dcb29d454c89e31d4e6d0d8db, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _AdvancedTex0:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _AdvancedTex1:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _LinearRamp:
|
||||
m_Texture: {fileID: 2800000, guid: 6293a417776889843b0c6d20f25677be, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _Ramp:
|
||||
m_Texture: {fileID: 2800000, guid: fad186cbfd0faf2488e2edb774c6d08f, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _Tex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _normal:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _sRGBRamp:
|
||||
m_Texture: {fileID: 2800000, guid: fad186cbfd0faf2488e2edb774c6d08f, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _tex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _tex_channel:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _tex_color:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _tex_float:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _tex_range:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _tex_single_line:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _tex_toggle:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AdvancedFloat: 0
|
||||
- _AdvancedRange0: 0.62
|
||||
- _Advancedfloat0: 0.54
|
||||
- _Advancedfloat1: 0.45
|
||||
- _Advancedfloat3: 1.56
|
||||
- _Advancedfloat4: 0
|
||||
- _Advancedfloat7: 3.21
|
||||
- _enum: 1
|
||||
- _float: 0.53
|
||||
- _float1: 1
|
||||
- _float2: -0.57
|
||||
- _float3: 0
|
||||
- _float4: 0
|
||||
- _floatN: 0
|
||||
- _float_helpbox: 1
|
||||
- _float_tooltip: 1.91
|
||||
- _group: 0
|
||||
- _group1: 1
|
||||
- _group2: 0
|
||||
- _group3: 0
|
||||
- _key13_PowerSlider: 0
|
||||
- _key1_Float1: 0
|
||||
- _key2_Float2: 0
|
||||
- _key3_Float3: 0
|
||||
- _key3_Float3_Range: 0.137
|
||||
- _key3_Float4_PowerSlider: 0.0033800516
|
||||
- _key3_Int_Range: 0
|
||||
- _minMaxSlider: 1
|
||||
- _preset: 1
|
||||
- _preset1: 0
|
||||
- _range: 0
|
||||
- _rangeEnd: 0.87684953
|
||||
- _rangeStart: 0.1898573
|
||||
- _rangeStart1: 0
|
||||
- _rangeStart2: 0
|
||||
- _textureFloat1: 1
|
||||
- _toggle: 0
|
||||
- _toggle1: 0
|
||||
m_Colors:
|
||||
- _AdvancedColor0: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _AdvancedColor7: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _color: {r: 1, g: 0, b: 0, a: 1}
|
||||
- _color1: {r: 0.7, g: 0.7, b: 1, a: 1}
|
||||
- _mColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _mColor1: {r: 1, g: 0, b: 0, a: 1}
|
||||
- _mColor2: {r: 0, g: 1, b: 0, a: 1}
|
||||
- _mColor3: {r: 0, g: 0, b: 1, a: 1}
|
||||
- _textureChannelMask: {r: 0, g: 1, b: 0, a: 0}
|
||||
- _textureChannelMask1: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _vector1: {r: 0.34, g: 1, b: 1, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
8
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_SampleDrawerB1.mat.meta
vendored
Normal file
8
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/LWGUI_SampleDrawerB1.mat.meta
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6379fbe32817f7847b8e0dcd9556c223
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -20,11 +20,12 @@ TextureImporter:
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 1
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMasterTextureLimit: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
@ -63,6 +64,7 @@ TextureImporter:
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
@ -75,6 +77,7 @@ TextureImporter:
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
@ -87,6 +90,7 @@ TextureImporter:
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
@ -99,6 +103,7 @@ TextureImporter:
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
@ -115,9 +120,8 @@ TextureImporter:
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
spritePackingTag:
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData: '{"_curves":[{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.0,"inSlope":0.0,"outSlope":1.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":1.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4},{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.0,"inSlope":0.0,"outSlope":1.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":1.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4},{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.0,"inSlope":0.0,"outSlope":1.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":1.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4},{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}]}#{"_curves":[{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.0,"inSlope":0.0,"outSlope":1.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":1.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4},{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.0,"inSlope":0.0,"outSlope":1.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":1.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4},{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.0,"inSlope":0.0,"outSlope":1.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":1.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4},{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":69,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}]}'
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
BIN
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/RampMap_sRGB.png
(Stored with Git LFS)
vendored
BIN
Assets/External/NiloToonURP/Editor/ShaderGUI/LWGUI-main/Test/RampMap_sRGB.png
(Stored with Git LFS)
vendored
Binary file not shown.
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user