Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class UpdateColor : MonoBehaviour
- {
- [SerializeField] private Image cookie;
- [SerializeField] private Color[] colors;
- public void SetupColor()
- {
- var index = Random.Range(0, colors.Length);
- cookie.color = colors[index];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment