111
This commit is contained in:
81
Assets/ThirdParty/Tools/SetMaterialsPropertris/Editor/SetMaterialsPropertrisEditor.cs
vendored
Normal file
81
Assets/ThirdParty/Tools/SetMaterialsPropertris/Editor/SetMaterialsPropertrisEditor.cs
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(SetMaterialsPropertris))]
|
||||
public class SetMaterialsPropertrisEditor : Editor
|
||||
{
|
||||
SetMaterialsPropertris inst;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
inst = (SetMaterialsPropertris)target;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
base.OnInspectorGUI();
|
||||
|
||||
//
|
||||
if(GUILayout.Button("Do it", GUILayout.Height(50)))
|
||||
{
|
||||
inst.materialsCheck.Clear();
|
||||
|
||||
foreach (Transform t in inst.root.GetComponentsInChildren<Transform>())
|
||||
{
|
||||
if(t.gameObject.activeSelf && t.GetComponent<MeshRenderer>())
|
||||
{
|
||||
foreach (Material mat in t.GetComponent<MeshRenderer>().sharedMaterials)
|
||||
{
|
||||
if (mat != null && mat.shader != null &&
|
||||
(mat.shader == Shader.Find("ASE/LandScape") || mat.shader == Shader.Find("ASE/Stone") || mat.shader == Shader.Find("ASE/Building")))
|
||||
{
|
||||
inst.materialsCheck.Add(mat);
|
||||
asdasdasd(mat);
|
||||
}
|
||||
|
||||
if (mat != null && mat.shader != null &&
|
||||
(mat.shader == Shader.Find("Shader Graphs/Tree") || mat.shader == Shader.Find("Shader Graphs/Grass") || mat.shader == Shader.Find("Shader Graphs/Flower")))
|
||||
{
|
||||
inst.materialsCheck.Add(mat);
|
||||
asdasdasssssd(mat);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Log("Done!");
|
||||
}
|
||||
}
|
||||
|
||||
void asdasdasd(Material material)
|
||||
{
|
||||
//Rainny
|
||||
//material.SetColor("_WaterColor", inst.waterColor);
|
||||
material.SetVector("_WaterNoiseScale", inst.waterNoiseScale);
|
||||
material.SetTexture("_WaterWaveNormal", inst.waterWaveNormal);
|
||||
material.SetVector("_WaterWaveNormalScale", inst.waterWaveNormalScale);
|
||||
material.SetFloat("_WaterWaveNoiseScale", inst.waterWaveNoiseScale);
|
||||
material.SetVector("_WaterWaveSpeedDir", inst.waterWaveSpeedDir);
|
||||
material.SetTexture("_RippleMask", inst.rippleMask);
|
||||
material.SetFloat("_RippleScaleA", inst.rippleScaleA);
|
||||
material.SetFloat("_RippleScaleB", inst.rippleScaleB);
|
||||
material.SetFloat("_RippleMaskStength", inst.rippleMaskStength);
|
||||
material.SetFloat("_Rainny", inst.rainny);
|
||||
|
||||
//Snownny
|
||||
material.SetColor("_SnowColor", inst.snowColor);
|
||||
material.SetVector("_SnowNoiseScale", inst.snowNoiseScale);
|
||||
material.SetTexture("_SnowNormalTex", inst.snowNormalTex);
|
||||
material.SetFloat("_SnowNormalStrength", inst.snowNormalStrength);
|
||||
material.SetFloat("_Snownny", inst.snownny);
|
||||
}
|
||||
|
||||
void asdasdasssssd(Material material)
|
||||
{
|
||||
//Snownny
|
||||
material.SetColor("_SnowColor", inst.snowColor);
|
||||
material.SetFloat("_Snownny", inst.snownny);
|
||||
}
|
||||
}
|
||||
11
Assets/ThirdParty/Tools/SetMaterialsPropertris/Editor/SetMaterialsPropertrisEditor.cs.meta
vendored
Normal file
11
Assets/ThirdParty/Tools/SetMaterialsPropertris/Editor/SetMaterialsPropertrisEditor.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 530ea4726f6bb534baaa4dc38feb54cb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user