You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/SurfaceMaterialRandom.cs

21 lines
443 B
C#

3 months ago
using SRF;
using UnityEngine;
using static D2D.Utilities.CommonGameplayFacade;
public class SurfaceMaterialRandom : MonoBehaviour
{
[SerializeField] private MeshRenderer[] meshRenderers;
private Material currentMaterial;
private void Awake()
{
currentMaterial = _gameData.groundMaterials.Random();
foreach (var item in meshRenderers)
{
item.material = currentMaterial;
}
}
}