小白求教!!1请问哪里错了,我想写一个点击物体出现文本再点击就消失
using UnityEngine;
using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
// Use this for initialization
void Start () {
}
bool isTrue=false;
void OnMouseDown(){
isTrue=true;
}
void OnGUI(){
if(isTrue){
GUI.TextArea(new Rect(100, 100, 300, 200), "尉迟恭和秦叔宝", 200);
}
}
void OnMouseDown(){
isTrue=!isTrue;
}
// Update is called once per frame
void Update () {
}
}