From d62ce5992e9c03ee32c83bb3339f90ff825a1ece Mon Sep 17 00:00:00 2001 From: agm-114 Date: Sat, 28 Sep 2024 12:46:13 +0530 Subject: [PATCH] Material randomizer. --- AGMLIB/Editor/MaterialRandomizer.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 AGMLIB/Editor/MaterialRandomizer.cs diff --git a/AGMLIB/Editor/MaterialRandomizer.cs b/AGMLIB/Editor/MaterialRandomizer.cs new file mode 100644 index 0000000..eef34e5 --- /dev/null +++ b/AGMLIB/Editor/MaterialRandomizer.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using Random = System.Random; + +namespace AGMLIB.Editor +{ + public class MaterialRandomizer : MonoBehaviour + { + public List Materials = new(2); + public MeshRenderer Target; + + public void Awake() + { + //Debug.LogError("Randomizing: " + Materials.Count()); + Target.material = Materials[new Random().Next(Materials.Count())]; + } + } +}