首页 > 其他分享 >37, 点击模型弹出界面 onmousedown

37, 点击模型弹出界面 onmousedown

时间:2022-12-02 10:57:42浏览次数:35  
标签:200 void 37 GUILayout onmousedown 点击 flag Label

OnMousedown事件只会被该脚本附加上的GameObject监控到,并且该GameObject需要有碰撞器才能实现触发该事件。

 using UnityEngine;
using System.Collections;

public class ObjectInfo : MonoBehaviour {
private bool flag;
void Start(){
flag = false;

}
void onm ouseDown(){
flag = true;
}
void OnGUI(){
if(flag){
GUI.Box (new Rect (800, 20, 200, 200), "流量信息");
GUILayout.BeginArea (new Rect (800, 40, 200, 200));
GUILayout.Label ("最大流量");
GUILayout.Label ("3Qma");
GUILayout.Label ("当前流量");
GUILayout.Label ("2.13Qma");
GUILayout.EndArea();
}
}
}

标签:200,void,37,GUILayout,onmousedown,点击,flag,Label
From: https://www.cnblogs.com/dandansang/p/16943706.html

相关文章