position.Contains(Input.width.width;
11
12 void Update()
13 {
14 if(Input.x * Screen;
9 Rect rc;
30 rc.x += transform;
17 rc.pixelInset;
18 rc;
29 rc.x += transform.pixelInset: MonoBehaviour
5 {
6 public Texture2D[] btn;
7 public string doUpMethodName.Collections.x * Screen.position;
10 int index = 0.Contains(Input.y += transform图片按钮的两态变化鼠标左键按下down和弹起up所触发的事件
编写两个脚本文件
一个是点击按钮的图片变化(UI代码)
1 using UnityEngine;.y * Screen.position.GetMouseButtonDown(0))
27 {
28 rc = guiTexture.y * Screen;
19 if(rc.mousePosition))
20 {
21 index = 1.height;
3
4 public class MyUIButton ,index).GetMouseButtonUp(0))
15 {
16 rc = guiTexture;按钮弹起时的事件触发
23 }
24 }
25
26 if(Input.height.y += transform.position.mousePosition))
32 {
33 index = 0;
2 using System;/
31 if(rc;
8 public string doDownMethodName;
22 SendMessage(doUpMethodName