Color Dice based on Item

This commit is contained in:
brausjonas
2023-04-14 23:01:04 +02:00
parent d63c43deb5
commit 481f0d1577
12 changed files with 255 additions and 34 deletions
+11 -1
View File
@@ -12,12 +12,20 @@ public class Dice : MonoBehaviour
[SerializeField] private Rigidbody rb;
private bool started;
private float timeLastNumberChanged = 0;
//0 = default, 1 = double dice, 2 = red
[SerializeField] private Material[] materials;
private Renderer renderer;
public void SetMaterial(int mat)
{
renderer.material = materials[mat];
}
private void Start()
{
rb.useGravity = false;
gameObject.SetActive(false);
renderer = GetComponent<Renderer>();
}
private void Update()
@@ -66,4 +74,6 @@ public class Dice : MonoBehaviour
t.text = random.ToString();
}
}
}