Eriknem

colormodel

Nov 11th, 2020
994
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.38 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using UnityEngine.EventSystems;
  6.  
  7.  
  8. public class ChangeColorModel : MonoBehaviour
  9. {
  10.  
  11.     public MeshRenderer meshModel;
  12.  
  13.     public void ChangeColor()
  14.     {
  15.         meshModel.material.color = EventSystem.current.currentSelectedGameObject.GetComponent<Image>().color;
  16.     }
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment