111
This commit is contained in:
8
Assets/ThirdParty/Tools/SetMaterialsPropertris/Editor.meta
vendored
Normal file
8
Assets/ThirdParty/Tools/SetMaterialsPropertris/Editor.meta
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a44644e9d0a59044581e8abbc7612d1f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
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:
|
||||
43
Assets/ThirdParty/Tools/SetMaterialsPropertris/SetMaterialsPropertris.cs
vendored
Normal file
43
Assets/ThirdParty/Tools/SetMaterialsPropertris/SetMaterialsPropertris.cs
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class SetMaterialsPropertris : MonoBehaviour
|
||||
{
|
||||
public Transform root;
|
||||
|
||||
//Rainny
|
||||
//public Color waterColor = Color.white;
|
||||
public Vector4 waterNoiseScale = new Vector4(3,3, 2, 10);
|
||||
public Texture2D waterWaveNormal;
|
||||
public Vector4 waterWaveNormalScale = new Vector4(0.2f, 0.2f, 0, 0);
|
||||
public float waterWaveNoiseScale = 0.3f;
|
||||
public Vector4 waterWaveSpeedDir = new Vector4(0.1f, 0, 0, 0.1f);
|
||||
public Texture2D rippleMask;
|
||||
public float rippleScaleA = 25;
|
||||
public float rippleScaleB = 50;
|
||||
public float rippleMaskStength = 0.5f;
|
||||
public float rainny = 0;
|
||||
|
||||
//Snownny
|
||||
public Color snowColor = Color.white;
|
||||
public Vector4 snowNoiseScale = new Vector4(2, 2, 2, 10);
|
||||
public Texture2D snowNormalTex = null;
|
||||
public float snowNormalStrength = 1;
|
||||
public float snownny = 1;
|
||||
|
||||
public List<Material> materialsCheck = new List<Material>();
|
||||
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
11
Assets/ThirdParty/Tools/SetMaterialsPropertris/SetMaterialsPropertris.cs.meta
vendored
Normal file
11
Assets/ThirdParty/Tools/SetMaterialsPropertris/SetMaterialsPropertris.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4c162ba9d5a69a64aa3463dcb3bff890
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user