Abdula_2314124

Untitled

Mar 18th, 2024
698
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.37 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5.  
  6. public class UpdateColor : MonoBehaviour
  7. {
  8.     [SerializeField] private Image cookie;
  9.     [SerializeField] private Color[] colors;
  10.     public void SetupColor()
  11.     {
  12.         var index = Random.Range(0, colors.Length);
  13.         cookie.color = colors[index];
  14.     }
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment