|
[code=javascript]var maxTime: float = 1;
private var dTime: float = 0;
private var isHide: boolean = false;
function OnGUI() {
if (dTime == 0) {
if (GUI.Button(Rect(10, 10, 100, 20), "HideOrNot")) {
dTime = maxTime;
}
}
if (dTime > 0 && dTime < maxTime) {
if (GUI.Button(Rect(10, 10, 100, 20), "HideOrNot")) {
dTime = 0;
VisibleOrNot();
}
}
}
function Update() {
if (dTime > 0 && dTime != 0) dTime = dTime - Time.deltaTime * 2;
if (dTime < 0) dTime = 0;
}[/code] |
评分
-
查看全部评分
|