自我介绍
广东双非一本的大三小白,计科专业,想在制作毕设前夯实基础,毕设做出一款属于自己的游戏!
搭建场景
场景非常简单,一个image还有一个cube
挂载测试脚本
image上面挂载 ImageClickTest.cs
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public class ImageClickTest : MonoBehaviour,IPointerClickHandler
{
int index;
void ChangeColor()
{
if (index == 0) GetComponent<Image>().color = Color.red;
else GetComponent<Image>().color = Color.green;
index =