chore: 외부 에셋 권한 및 줄바꿈 재기록 반영

- Assets/External 하위 샘플 및 서드파티 에셋 파일의 실행 비트 변경을 별도 커밋으로 분리
- PolygonGeneric, SidekickCharacters, Synty 도구 자산 전반의 줄바꿈 및 재직렬화 차이를 그대로 보존
- 프로젝트 고유 로직 변경과 분리해 이후 히스토리에서 외부 에셋 노이즈 범위를 식별하기 쉽게 정리
This commit is contained in:
2026-04-06 14:04:09 +09:00
parent c8edf838fd
commit cf103baf57
140 changed files with 15090 additions and 14829 deletions

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

0
Assets/External/Models/PolygonGeneric/Materials/Skybox_01.mat.meta vendored Normal file → Executable file
View File

View File

70
Assets/External/Models/PolygonGeneric/Scripts/Generic_SimpleRotate.cs vendored Normal file → Executable file
View File

@@ -1,35 +1,35 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Generic_SimpleRotate : MonoBehaviour
{
public bool rotX;
public float rotXSpeed = 50f;
public bool rotY;
public float rotYSpeed = 50f;
public bool rotZ;
public float rotZSpeed = 50f;
// Update is called once per frame
void Update()
{
if (rotX == true)
{
transform.Rotate(Vector3.left * Time.deltaTime * rotXSpeed);
}
if (rotY == true)
{
transform.Rotate(Vector3.up * Time.deltaTime * rotYSpeed);
}
if (rotZ == true)
{
transform.Rotate(Vector3.back * Time.deltaTime * rotZSpeed);
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Generic_SimpleRotate : MonoBehaviour
{
public bool rotX;
public float rotXSpeed = 50f;
public bool rotY;
public float rotYSpeed = 50f;
public bool rotZ;
public float rotZSpeed = 50f;
// Update is called once per frame
void Update()
{
if (rotX == true)
{
transform.Rotate(Vector3.left * Time.deltaTime * rotXSpeed);
}
if (rotY == true)
{
transform.Rotate(Vector3.up * Time.deltaTime * rotYSpeed);
}
if (rotZ == true)
{
transform.Rotate(Vector3.back * Time.deltaTime * rotZSpeed);
}
}
}

View File

View File

@@ -1,31 +1,31 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Generic_SimpleTranslate : MonoBehaviour
{
public bool moveX;
public float moveXSpeed = 2f;
public bool moveY;
public float moveYSpeed = 2f;
public bool moveZ;
public float moveZSpeed = 2f;
void Update()
{
if (moveX == true)
{
transform.Translate(Vector3.left * Time.deltaTime * moveXSpeed);
}
if (moveY == true)
{
transform.Translate(Vector3.up * Time.deltaTime * moveYSpeed);
}
if (moveZ == true)
{
transform.Translate(Vector3.back * Time.deltaTime * moveZSpeed);
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Generic_SimpleTranslate : MonoBehaviour
{
public bool moveX;
public float moveXSpeed = 2f;
public bool moveY;
public float moveYSpeed = 2f;
public bool moveZ;
public float moveZSpeed = 2f;
void Update()
{
if (moveX == true)
{
transform.Translate(Vector3.left * Time.deltaTime * moveXSpeed);
}
if (moveY == true)
{
transform.Translate(Vector3.up * Time.deltaTime * moveYSpeed);
}
if (moveZ == true)
{
transform.Translate(Vector3.back * Time.deltaTime * moveZSpeed);
}
}
}

View File

88
Assets/External/Models/PolygonGeneric/Scripts/Generic_WaterBob.cs vendored Normal file → Executable file
View File

@@ -1,44 +1,44 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Generic_WaterBob : MonoBehaviour
{
public float bobbingHeight = 0.08f; // The height the object will bob up and down
public float bobbingSpeed = 1.5f; // The speed of the bobbing motion
public float rotationAmount = 0.8f; // The amount of rotation applied to the object
public bool randomOffset = true; // Determines if random offsets are applied to speed and rotation
public Vector2 randomRange = new Vector2(0.1f, 1f); // The range for the random offset
private Vector3 startPos;
private Quaternion startRotation;
void Start()
{
startPos = transform.position;
startRotation = transform.rotation; // Save the initial rotation
if (randomOffset)
{
bobbingSpeed += UnityEngine.Random.Range(randomRange.x, randomRange.y);
rotationAmount += UnityEngine.Random.Range(randomRange.x, randomRange.y);
}
}
void Update()
{
// Calculate the vertical bobbing motion
float newY = startPos.y + Mathf.Sin(Time.time * bobbingSpeed) * bobbingHeight;
Vector3 newPos = new Vector3(transform.position.x, newY, transform.position.z);
transform.position = newPos;
// Calculate rotation offsets based on time
float rotationX = Mathf.Sin(Time.time * bobbingSpeed * 0.5f) * rotationAmount;
float rotationY = Mathf.Sin(Time.time * bobbingSpeed * 0.7f) * rotationAmount;
float rotationZ = Mathf.Sin(Time.time * bobbingSpeed * 0.9f) * rotationAmount;
// Apply the incremental rotation as an offset to the existing rotation
Quaternion incrementalRotation = Quaternion.Euler(rotationX, rotationY, rotationZ);
transform.rotation = startRotation * incrementalRotation;
}
}
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Generic_WaterBob : MonoBehaviour
{
public float bobbingHeight = 0.08f; // The height the object will bob up and down
public float bobbingSpeed = 1.5f; // The speed of the bobbing motion
public float rotationAmount = 0.8f; // The amount of rotation applied to the object
public bool randomOffset = true; // Determines if random offsets are applied to speed and rotation
public Vector2 randomRange = new Vector2(0.1f, 1f); // The range for the random offset
private Vector3 startPos;
private Quaternion startRotation;
void Start()
{
startPos = transform.position;
startRotation = transform.rotation; // Save the initial rotation
if (randomOffset)
{
bobbingSpeed += UnityEngine.Random.Range(randomRange.x, randomRange.y);
rotationAmount += UnityEngine.Random.Range(randomRange.x, randomRange.y);
}
}
void Update()
{
// Calculate the vertical bobbing motion
float newY = startPos.y + Mathf.Sin(Time.time * bobbingSpeed) * bobbingHeight;
Vector3 newPos = new Vector3(transform.position.x, newY, transform.position.z);
transform.position = newPos;
// Calculate rotation offsets based on time
float rotationX = Mathf.Sin(Time.time * bobbingSpeed * 0.5f) * rotationAmount;
float rotationY = Mathf.Sin(Time.time * bobbingSpeed * 0.7f) * rotationAmount;
float rotationZ = Mathf.Sin(Time.time * bobbingSpeed * 0.9f) * rotationAmount;
// Apply the incremental rotation as an offset to the existing rotation
Quaternion incrementalRotation = Quaternion.Euler(rotationX, rotationY, rotationZ);
transform.rotation = startRotation * incrementalRotation;
}
}

View File

View File

@@ -1,204 +1,204 @@
using UnityEditor;
public class PolygonShaderGUI : ShaderGUI
{
private bool _showBaseTexture = false;
private bool _showOverlayTexture = false;
private bool _showAlphaTexture = false;
private bool _showNormalTexture = false;
private bool _showTriplanar = false;
private bool _showNormalTriplanar = false;
private bool _showEmissionTexture = false;
private bool _showSnow = false;
private bool _showWave = false;
private bool CreatePropertyGroup(string title, string[] groupProperties, bool foldout, MaterialEditor materialEditor, MaterialProperty[] allProperties)
{
foldout = EditorGUILayout.BeginFoldoutHeaderGroup(foldout, title);
if (foldout)
{
foreach (string property in groupProperties)
{
MaterialProperty propertyReference = FindProperty(property, allProperties);
materialEditor.ShaderProperty(propertyReference, propertyReference.displayName, 1);
}
}
EditorGUILayout.EndFoldoutHeaderGroup();
return foldout;
}
override public void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties)
{
EditorGUILayout.LabelField("Basic Parameters", EditorStyles.boldLabel);
// Ungrouped Basic Parameters
string[] shaderProperties =
{
"_Color_Tint",
"_Metallic",
"_Smoothness",
"_Metallic_Smoothness_Texture",
"_Ambient_Occlusion",
"_Specular_Color",
"_Alpha_Transparency"
};
foreach (string property in shaderProperties)
{
MaterialProperty propertyReference = FindProperty(property, properties);
materialEditor.ShaderProperty(propertyReference, propertyReference.displayName, 0);
}
EditorGUILayout.Separator();
// Base Texture Parameters
shaderProperties = new[]
{
"_Enable_Base_Texture",
"_Base_Texture",
"_Base_Tiling",
"_Base_Offset"
};
_showBaseTexture = CreatePropertyGroup("Base Texture", shaderProperties, _showBaseTexture, materialEditor, properties);
// Alpha Texture Parameters
shaderProperties = new[]
{
"_Enable_Alpha_Texture",
"_Alpha_Texture",
"_Alpha_Tiling",
"_Alpha_Offset"
};
_showAlphaTexture = CreatePropertyGroup("Alpha Texture", shaderProperties, _showAlphaTexture, materialEditor, properties);
// Normal Texture Parameters
shaderProperties = new[]
{
"_Enable_Normal_Texture",
"_Normal_Texture",
"_Normal_Tiling",
"_Normal_Offset"
};
_showNormalTexture = CreatePropertyGroup("Normal Texture", shaderProperties, _showNormalTexture, materialEditor, properties);
// Emission Texture Parameters
shaderProperties = new[]
{
"_Enable_Emission_Texture",
"_Emission_Texture",
"_Emission_Tiling",
"_Emission_Offset"
};
_showEmissionTexture = CreatePropertyGroup("Emission Texture", shaderProperties, _showEmissionTexture, materialEditor, properties);
EditorGUILayout.Separator();
EditorGUILayout.LabelField("Advanced Parameters", EditorStyles.boldLabel);
// Overlay Texture Parameters
shaderProperties = new[]
{
"_Enable_Overlay_Texture",
"_Overlay_Texture",
"_Overlay_Tiling",
"_Overlay_Offset",
"_OVERLAY_UV_CHANNEL",
"_Overlay_Intensity"
};
_showOverlayTexture = CreatePropertyGroup("Overlay Texture", shaderProperties, _showOverlayTexture, materialEditor, properties);
// Triplanar Texture Parameters
shaderProperties = new[]
{
"_Enable_Triplanar_Texture",
"_Triplanar_Texture_Top",
"_Triplanar_Tiling_Top",
"_Triplanar_Offset_Top",
"_Triplanar_Texture_Bottom",
"_Triplanar_Tiling_Bottom",
"_Triplanar_Offset_Bottom",
"_Triplanar_Texture_Side",
"_Triplanar_Tiling_Side",
"_Triplanar_Offset_Side",
"_Triplanar_Top_To_Side_Difference",
"_Triplanar_Fade", "_Triplanar_Intensity"
};
_showTriplanar = CreatePropertyGroup("Triplanar Texture", shaderProperties, _showTriplanar, materialEditor, properties);
// Triplanar Normal Texture Parameters
shaderProperties = new[]
{
"_Enable_Triplanar_Normals",
"_Triplanar_Normal_Texture_Top",
"_Triplanar_Normal_Intensity_Top",
"_Triplanar_Normal_Tiling_Top",
"_Triplanar_Normal_Offset_Top",
"_Triplanar_Normal_Texture_Bottom",
"_Triplanar_Normal_Intensity_Bottom",
"_Triplanar_Normal_Tiling_Bottom",
"_Triplanar_Normal_Offset_Bottom",
"_Triplanar_Normal_Texture_Side",
"_Triplanar_Normal_Intensity_Side",
"_Triplanar_Normal_Tiling_Side",
"_Triplanar_Normal_Offset_Side",
"_Triplanar_Normal_Top_To_Side_Difference",
"_Triplanar_Normal_Fade"
};
_showNormalTriplanar = CreatePropertyGroup("Triplanar Normal Texture", shaderProperties, _showNormalTriplanar, materialEditor, properties);
// Snow Parameters
shaderProperties = new[]
{
"_Enable_Snow",
"_Snow_Metallic",
"_Snow_Smoothness",
"_Snow_Level",
"_Snow_Transition",
"_Snow_Transition_Threshold",
"_Snow_Transition_Threshold_Steps",
"_Snow_Transition_Threshold_Step_Count",
"_Snow_Angle_Threshold",
"_Snow_Color",
"_Sea_Level",
"_Snow_Edge_Noise",
"_Snow_Noise_Tiling",
"_Snow_Noise_Offset",
"_Snow_Noise_Fade",
"_Snow_Noise_Top_To_Side_Difference",
"_Snow_Normal_Texture",
"_Snow_Overrides_Normals",
"_Snow_Normal_Intensity",
"_Snow_Normal_Tiling",
"_Snow_Normal_Offset",
"_Snow_Normal_Fade",
"_Snow_Metallic_Smoothness_Texture",
"_Snow_Metallic_Smoothness_Tiling",
"_Snow_Metallic_Smoothness_Offset"
};
_showSnow = CreatePropertyGroup("Snow", shaderProperties, _showSnow, materialEditor, properties);
// Wave Parameters
shaderProperties = new[]
{
"_Enable_Wave",
"_Wave_Direction_Vector",
"_Wave_Scale",
"_Wave_Noise_Tiling",
"_Wave_Speed",
"_Fade_Wave_To_Object_Origin",
"_Fade_Wave_Scale",
"_Fade_Wave_Vertical_Offset",
"_Wave_Object_Offset"
};
_showWave = CreatePropertyGroup("Wave", shaderProperties, _showWave, materialEditor, properties);
}
}
using UnityEditor;
public class PolygonShaderGUI : ShaderGUI
{
private bool _showBaseTexture = false;
private bool _showOverlayTexture = false;
private bool _showAlphaTexture = false;
private bool _showNormalTexture = false;
private bool _showTriplanar = false;
private bool _showNormalTriplanar = false;
private bool _showEmissionTexture = false;
private bool _showSnow = false;
private bool _showWave = false;
private bool CreatePropertyGroup(string title, string[] groupProperties, bool foldout, MaterialEditor materialEditor, MaterialProperty[] allProperties)
{
foldout = EditorGUILayout.BeginFoldoutHeaderGroup(foldout, title);
if (foldout)
{
foreach (string property in groupProperties)
{
MaterialProperty propertyReference = FindProperty(property, allProperties);
materialEditor.ShaderProperty(propertyReference, propertyReference.displayName, 1);
}
}
EditorGUILayout.EndFoldoutHeaderGroup();
return foldout;
}
override public void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties)
{
EditorGUILayout.LabelField("Basic Parameters", EditorStyles.boldLabel);
// Ungrouped Basic Parameters
string[] shaderProperties =
{
"_Color_Tint",
"_Metallic",
"_Smoothness",
"_Metallic_Smoothness_Texture",
"_Ambient_Occlusion",
"_Specular_Color",
"_Alpha_Transparency"
};
foreach (string property in shaderProperties)
{
MaterialProperty propertyReference = FindProperty(property, properties);
materialEditor.ShaderProperty(propertyReference, propertyReference.displayName, 0);
}
EditorGUILayout.Separator();
// Base Texture Parameters
shaderProperties = new[]
{
"_Enable_Base_Texture",
"_Base_Texture",
"_Base_Tiling",
"_Base_Offset"
};
_showBaseTexture = CreatePropertyGroup("Base Texture", shaderProperties, _showBaseTexture, materialEditor, properties);
// Alpha Texture Parameters
shaderProperties = new[]
{
"_Enable_Alpha_Texture",
"_Alpha_Texture",
"_Alpha_Tiling",
"_Alpha_Offset"
};
_showAlphaTexture = CreatePropertyGroup("Alpha Texture", shaderProperties, _showAlphaTexture, materialEditor, properties);
// Normal Texture Parameters
shaderProperties = new[]
{
"_Enable_Normal_Texture",
"_Normal_Texture",
"_Normal_Tiling",
"_Normal_Offset"
};
_showNormalTexture = CreatePropertyGroup("Normal Texture", shaderProperties, _showNormalTexture, materialEditor, properties);
// Emission Texture Parameters
shaderProperties = new[]
{
"_Enable_Emission_Texture",
"_Emission_Texture",
"_Emission_Tiling",
"_Emission_Offset"
};
_showEmissionTexture = CreatePropertyGroup("Emission Texture", shaderProperties, _showEmissionTexture, materialEditor, properties);
EditorGUILayout.Separator();
EditorGUILayout.LabelField("Advanced Parameters", EditorStyles.boldLabel);
// Overlay Texture Parameters
shaderProperties = new[]
{
"_Enable_Overlay_Texture",
"_Overlay_Texture",
"_Overlay_Tiling",
"_Overlay_Offset",
"_OVERLAY_UV_CHANNEL",
"_Overlay_Intensity"
};
_showOverlayTexture = CreatePropertyGroup("Overlay Texture", shaderProperties, _showOverlayTexture, materialEditor, properties);
// Triplanar Texture Parameters
shaderProperties = new[]
{
"_Enable_Triplanar_Texture",
"_Triplanar_Texture_Top",
"_Triplanar_Tiling_Top",
"_Triplanar_Offset_Top",
"_Triplanar_Texture_Bottom",
"_Triplanar_Tiling_Bottom",
"_Triplanar_Offset_Bottom",
"_Triplanar_Texture_Side",
"_Triplanar_Tiling_Side",
"_Triplanar_Offset_Side",
"_Triplanar_Top_To_Side_Difference",
"_Triplanar_Fade", "_Triplanar_Intensity"
};
_showTriplanar = CreatePropertyGroup("Triplanar Texture", shaderProperties, _showTriplanar, materialEditor, properties);
// Triplanar Normal Texture Parameters
shaderProperties = new[]
{
"_Enable_Triplanar_Normals",
"_Triplanar_Normal_Texture_Top",
"_Triplanar_Normal_Intensity_Top",
"_Triplanar_Normal_Tiling_Top",
"_Triplanar_Normal_Offset_Top",
"_Triplanar_Normal_Texture_Bottom",
"_Triplanar_Normal_Intensity_Bottom",
"_Triplanar_Normal_Tiling_Bottom",
"_Triplanar_Normal_Offset_Bottom",
"_Triplanar_Normal_Texture_Side",
"_Triplanar_Normal_Intensity_Side",
"_Triplanar_Normal_Tiling_Side",
"_Triplanar_Normal_Offset_Side",
"_Triplanar_Normal_Top_To_Side_Difference",
"_Triplanar_Normal_Fade"
};
_showNormalTriplanar = CreatePropertyGroup("Triplanar Normal Texture", shaderProperties, _showNormalTriplanar, materialEditor, properties);
// Snow Parameters
shaderProperties = new[]
{
"_Enable_Snow",
"_Snow_Metallic",
"_Snow_Smoothness",
"_Snow_Level",
"_Snow_Transition",
"_Snow_Transition_Threshold",
"_Snow_Transition_Threshold_Steps",
"_Snow_Transition_Threshold_Step_Count",
"_Snow_Angle_Threshold",
"_Snow_Color",
"_Sea_Level",
"_Snow_Edge_Noise",
"_Snow_Noise_Tiling",
"_Snow_Noise_Offset",
"_Snow_Noise_Fade",
"_Snow_Noise_Top_To_Side_Difference",
"_Snow_Normal_Texture",
"_Snow_Overrides_Normals",
"_Snow_Normal_Intensity",
"_Snow_Normal_Tiling",
"_Snow_Normal_Offset",
"_Snow_Normal_Fade",
"_Snow_Metallic_Smoothness_Texture",
"_Snow_Metallic_Smoothness_Tiling",
"_Snow_Metallic_Smoothness_Offset"
};
_showSnow = CreatePropertyGroup("Snow", shaderProperties, _showSnow, materialEditor, properties);
// Wave Parameters
shaderProperties = new[]
{
"_Enable_Wave",
"_Wave_Direction_Vector",
"_Wave_Scale",
"_Wave_Noise_Tiling",
"_Wave_Speed",
"_Fade_Wave_To_Object_Origin",
"_Fade_Wave_Scale",
"_Fade_Wave_Vertical_Offset",
"_Wave_Object_Offset"
};
_showWave = CreatePropertyGroup("Wave", shaderProperties, _showWave, materialEditor, properties);
}
}

View File

@@ -1,145 +1,145 @@
using UnityEditor;
public class PolygonTransparencyShaderGUI : ShaderGUI
{
private bool _showBaseTexture = false;
private bool _showOverlayTexture = false;
private bool _showAlphaTexture = false;
private bool _showNormalTexture = false;
private bool _showEmissionTexture = false;
private bool _showSnow = false;
private bool CreatePropertyGroup(string title, string[] groupProperties, bool foldout, MaterialEditor materialEditor, MaterialProperty[] allProperties)
{
foldout = EditorGUILayout.BeginFoldoutHeaderGroup(foldout, title);
if (foldout)
{
foreach (string property in groupProperties)
{
MaterialProperty propertyReference = FindProperty(property, allProperties);
materialEditor.ShaderProperty(propertyReference, propertyReference.displayName, 1);
}
}
EditorGUILayout.EndFoldoutHeaderGroup();
return foldout;
}
override public void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties)
{
EditorGUILayout.LabelField("Basic Parameters", EditorStyles.boldLabel);
// Ungrouped Basic Parameters
string[] shaderProperties =
{
"_Color_Tint",
"_Metallic",
"_Smoothness",
"_Metallic_Smoothness_Texture",
"_Ambient_Occlusion",
"_Alpha_Transparency",
"_Alpha_Clip_Threshold"
};
foreach (string property in shaderProperties)
{
MaterialProperty propertyReference = FindProperty(property, properties);
materialEditor.ShaderProperty(propertyReference, propertyReference.displayName, 0);
}
EditorGUILayout.Separator();
// Base Texture Parameters
shaderProperties = new[]
{
"_Enable_Base_Texture",
"_Base_Texture",
"_Base_Tiling",
"_Base_Offset"
};
_showBaseTexture = CreatePropertyGroup("Base Texture", shaderProperties, _showBaseTexture, materialEditor, properties);
// Alpha Texture Parameters
shaderProperties = new[]
{
"_Enable_Alpha_Texture",
"_Alpha_Texture",
"_Alpha_Tiling",
"_Alpha_Offset"
};
_showAlphaTexture = CreatePropertyGroup("Alpha Texture", shaderProperties, _showAlphaTexture, materialEditor, properties);
// Normal Texture Parameters
shaderProperties = new[]
{
"_Enable_Normal_Texture",
"_Normal_Texture",
"_Normal_Tiling",
"_Normal_Offset"
};
_showNormalTexture = CreatePropertyGroup("Normal Texture", shaderProperties, _showNormalTexture, materialEditor, properties);
// Emission Texture Parameters
shaderProperties = new[]
{
"_Enable_Emission_Texture",
"_Emission_Texture",
"_Emission_Tiling",
"_Emission_Offset"
};
_showEmissionTexture = CreatePropertyGroup("Emission Texture", shaderProperties, _showEmissionTexture, materialEditor, properties);
EditorGUILayout.Separator();
EditorGUILayout.LabelField("Advanced Parameters", EditorStyles.boldLabel);
// Overlay Texture Parameters
shaderProperties = new[]
{
"_Enable_Overlay_Texture",
"_Overlay_Texture",
"_Overlay_Tiling",
"_Overlay_Offset",
"_OVERLAY_UV_CHANNEL",
"_Overlay_Intensity"
};
_showOverlayTexture = CreatePropertyGroup("Overlay Texture", shaderProperties, _showOverlayTexture, materialEditor, properties);
// Snow Parameters
shaderProperties = new[]
{
"_Enable_Snow",
"_Snow_Metallic",
"_Snow_Smoothness",
"_Snow_Level",
"_Snow_Transition",
"_Snow_Transition_Threshold",
"_Snow_Transition_Threshold_Steps",
"_Snow_Transition_Threshold_Step_Count",
"_Snow_Angle_Threshold",
"_Snow_Color",
"_Sea_Level",
"_Snow_Edge_Noise",
"_Snow_Noise_Tiling",
"_Snow_Noise_Offset",
"_Snow_Noise_Fade",
"_Snow_Noise_Top_To_Side_Difference",
"_Snow_Normal_Texture",
"_Snow_Overrides_Normals",
"_Snow_Normal_Intensity",
"_Snow_Normal_Tiling",
"_Snow_Normal_Offset",
"_Snow_Normal_Fade",
"_Snow_Metallic_Smoothness_Texture",
"_Snow_Metallic_Smoothness_Tiling",
"_Snow_Metallic_Smoothness_Offset"
};
_showSnow = CreatePropertyGroup("Snow", shaderProperties, _showSnow, materialEditor, properties);
}
}
using UnityEditor;
public class PolygonTransparencyShaderGUI : ShaderGUI
{
private bool _showBaseTexture = false;
private bool _showOverlayTexture = false;
private bool _showAlphaTexture = false;
private bool _showNormalTexture = false;
private bool _showEmissionTexture = false;
private bool _showSnow = false;
private bool CreatePropertyGroup(string title, string[] groupProperties, bool foldout, MaterialEditor materialEditor, MaterialProperty[] allProperties)
{
foldout = EditorGUILayout.BeginFoldoutHeaderGroup(foldout, title);
if (foldout)
{
foreach (string property in groupProperties)
{
MaterialProperty propertyReference = FindProperty(property, allProperties);
materialEditor.ShaderProperty(propertyReference, propertyReference.displayName, 1);
}
}
EditorGUILayout.EndFoldoutHeaderGroup();
return foldout;
}
override public void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties)
{
EditorGUILayout.LabelField("Basic Parameters", EditorStyles.boldLabel);
// Ungrouped Basic Parameters
string[] shaderProperties =
{
"_Color_Tint",
"_Metallic",
"_Smoothness",
"_Metallic_Smoothness_Texture",
"_Ambient_Occlusion",
"_Alpha_Transparency",
"_Alpha_Clip_Threshold"
};
foreach (string property in shaderProperties)
{
MaterialProperty propertyReference = FindProperty(property, properties);
materialEditor.ShaderProperty(propertyReference, propertyReference.displayName, 0);
}
EditorGUILayout.Separator();
// Base Texture Parameters
shaderProperties = new[]
{
"_Enable_Base_Texture",
"_Base_Texture",
"_Base_Tiling",
"_Base_Offset"
};
_showBaseTexture = CreatePropertyGroup("Base Texture", shaderProperties, _showBaseTexture, materialEditor, properties);
// Alpha Texture Parameters
shaderProperties = new[]
{
"_Enable_Alpha_Texture",
"_Alpha_Texture",
"_Alpha_Tiling",
"_Alpha_Offset"
};
_showAlphaTexture = CreatePropertyGroup("Alpha Texture", shaderProperties, _showAlphaTexture, materialEditor, properties);
// Normal Texture Parameters
shaderProperties = new[]
{
"_Enable_Normal_Texture",
"_Normal_Texture",
"_Normal_Tiling",
"_Normal_Offset"
};
_showNormalTexture = CreatePropertyGroup("Normal Texture", shaderProperties, _showNormalTexture, materialEditor, properties);
// Emission Texture Parameters
shaderProperties = new[]
{
"_Enable_Emission_Texture",
"_Emission_Texture",
"_Emission_Tiling",
"_Emission_Offset"
};
_showEmissionTexture = CreatePropertyGroup("Emission Texture", shaderProperties, _showEmissionTexture, materialEditor, properties);
EditorGUILayout.Separator();
EditorGUILayout.LabelField("Advanced Parameters", EditorStyles.boldLabel);
// Overlay Texture Parameters
shaderProperties = new[]
{
"_Enable_Overlay_Texture",
"_Overlay_Texture",
"_Overlay_Tiling",
"_Overlay_Offset",
"_OVERLAY_UV_CHANNEL",
"_Overlay_Intensity"
};
_showOverlayTexture = CreatePropertyGroup("Overlay Texture", shaderProperties, _showOverlayTexture, materialEditor, properties);
// Snow Parameters
shaderProperties = new[]
{
"_Enable_Snow",
"_Snow_Metallic",
"_Snow_Smoothness",
"_Snow_Level",
"_Snow_Transition",
"_Snow_Transition_Threshold",
"_Snow_Transition_Threshold_Steps",
"_Snow_Transition_Threshold_Step_Count",
"_Snow_Angle_Threshold",
"_Snow_Color",
"_Sea_Level",
"_Snow_Edge_Noise",
"_Snow_Noise_Tiling",
"_Snow_Noise_Offset",
"_Snow_Noise_Fade",
"_Snow_Noise_Top_To_Side_Difference",
"_Snow_Normal_Texture",
"_Snow_Overrides_Normals",
"_Snow_Normal_Intensity",
"_Snow_Normal_Tiling",
"_Snow_Normal_Offset",
"_Snow_Normal_Fade",
"_Snow_Metallic_Smoothness_Texture",
"_Snow_Metallic_Smoothness_Tiling",
"_Snow_Metallic_Smoothness_Offset"
};
_showSnow = CreatePropertyGroup("Snow", shaderProperties, _showSnow, materialEditor, properties);
}
}