Skip to content

Commit

Permalink
Material randomizer.
Browse files Browse the repository at this point in the history
  • Loading branch information
agm-114 committed Sep 28, 2024
1 parent 52f4716 commit d62ce59
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions AGMLIB/Editor/MaterialRandomizer.cs
Original file line number Diff line number Diff line change
@@ -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<Material> Materials = new(2);
public MeshRenderer Target;

public void Awake()
{
//Debug.LogError("Randomizing: " + Materials.Count());
Target.material = Materials[new Random().Next(Materials.Count())];
}
}
}

0 comments on commit d62ce59

Please sign in to comment.