アセット選定
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using UnityEditor;
|
||||
|
||||
namespace CTI {
|
||||
|
||||
public class CTI_URPTransDrawer : MaterialPropertyDrawer {
|
||||
|
||||
public override void OnGUI (Rect position, MaterialProperty prop, string label, MaterialEditor editor) {
|
||||
|
||||
// Needed since Unity 2019
|
||||
EditorGUIUtility.labelWidth = 0;
|
||||
|
||||
Vector4 vec4value = prop.vectorValue;
|
||||
|
||||
GUILayout.Space(-18);
|
||||
EditorGUI.BeginChangeCheck();
|
||||
EditorGUILayout.BeginVertical();
|
||||
vec4value.x = EditorGUILayout.Slider("Strength", vec4value.x, 0.0f, 10.0f);
|
||||
vec4value.y = EditorGUILayout.Slider("Power", vec4value.y, 0.0f, 10.0f);
|
||||
EditorGUILayout.EndVertical();
|
||||
if (EditorGUI.EndChangeCheck ()) {
|
||||
prop.vectorValue = vec4value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 44905e65e363a6a419889f4a78adebd6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,29 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using UnityEditor;
|
||||
|
||||
namespace CTI {
|
||||
|
||||
public class CTI_URPWindDrawer : MaterialPropertyDrawer {
|
||||
|
||||
public override void OnGUI (Rect position, MaterialProperty prop, string label, MaterialEditor editor) {
|
||||
|
||||
// Needed since Unity 2019
|
||||
EditorGUIUtility.labelWidth = 0;
|
||||
|
||||
Vector4 vec4value = prop.vectorValue;
|
||||
|
||||
GUILayout.Space(-18);
|
||||
EditorGUI.BeginChangeCheck();
|
||||
EditorGUILayout.BeginVertical();
|
||||
vec4value.x = EditorGUILayout.Slider("Primary Strength", vec4value.x, 0.0f, 10.0f);
|
||||
vec4value.y = EditorGUILayout.Slider("Scondary Strength", vec4value.y, 0.0f, 10.0f);
|
||||
vec4value.z = EditorGUILayout.Slider("Edge Flutter", vec4value.z, 0.0f, 4.0f);
|
||||
EditorGUILayout.EndVertical();
|
||||
if (EditorGUI.EndChangeCheck ()) {
|
||||
prop.vectorValue = vec4value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f42df5657a0798b43bbc873e443c636d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,32 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
public class CTI_URP_ShaderGUI : ShaderGUI {
|
||||
|
||||
protected Color avrgCol = Color.gray;
|
||||
|
||||
public override void OnGUI (MaterialEditor materialEditor, MaterialProperty[] properties)
|
||||
{
|
||||
|
||||
base.OnGUI (materialEditor, properties);
|
||||
Material targetMat = materialEditor.target as Material;
|
||||
|
||||
// Bark texture2D
|
||||
if (targetMat.HasProperty("_BumpOcclusionMap")) {
|
||||
if ( targetMat.GetTexture("_BumpOcclusionMap") == null) {
|
||||
targetMat.SetTexture("_BumpOcclusionMap", Resources.Load("CTI_Default_NST") as Texture2D );
|
||||
}
|
||||
}
|
||||
|
||||
// Leaves
|
||||
if (targetMat.HasProperty("_BumpSpecMap")){
|
||||
if (targetMat.GetTexture("_BumpSpecMap") == null) {
|
||||
targetMat.SetTexture("_BumpSpecMap", Resources.Load("CTI_Default_NST") as Texture2D );
|
||||
}
|
||||
}
|
||||
|
||||
GUILayout.Space(8);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 453e1b0bc24ec68468e6655e08e28b09
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user