- 最后登录
- 2017-5-15
- 注册时间
- 2012-3-1
- 阅读权限
- 90
- 积分
- 32973
  
- 纳金币
- 32806
- 精华
- 12
|
MainWindow窗体的代码:
using UnityEngine;
using System.Collections;
using Bitverse.Unity.Gui;
public class mainDemo : MonoBehaviour {
BitWindow mainwin=null;
BitWindow logwin=null;
BitWindow regwin=null;
private BitEditorStage _form;
// Use this for initialization
void Start () {
_form=gameObject.GetComponent<BitEditorStage>();
Component[] windows = gameObject.GetComponents(typeof(BitWindow));
//Component[] windows = GameObject.Find("main_win");
logwin=(BitWindow)GameObject.Find("log").GetComponent(typeof(BitWindow));
regwin=(BitWindow)GameObject.Find("reg").GetComponent(typeof(BitWindow));
for(int i=0;i<windows.Length;i++)
{
if(windows.name=="main_win"){
mainwin=(BitWindow)windows;
}
if(windows.name=="log"){
logwin=(BitWindow)windows;
}
}
if(mainwin==null){
Debug.LogError("mainwin window not found");
return;
}
if(logwin==null){
Debug.LogError("logwin window not found");
return;
}
if(regwin==null){
Debug.LogError("regwin window not found");
return;
}
BitButton b1=mainwin.FindControl<BitButton>("log");
b1.MouseClick+=hideClick;
BitButton b2=mainwin.FindControl<BitButton>("reg");
b2.MouseClick+=hideClickReg;
}
private void hideClick(object sender,MouseEventArgs e)
{
logwin.Visible=***e;
}
private void hideClickReg(object sender,MouseEventArgs e)
{
regwin.Visible=***e;
//regwin.Visible=***e;
}
// Update is called once per frame
void Update () {
}
}
复制代码
LoginWindow窗体代码:
using UnityEngine;
using System.Collections;
using Bitverse.Unity.Gui;
public class logDemo : MonoBehaviour {
BitWindow logwin=null;
void Awake(){
logwin=(BitWindow)GameObject.Find("log").GetComponent(typeof(BitWindow));
logwin.Visible=false;
}
// Use this for initialization
void Start () {
//logwin=(BitWindow)gameObject.GetComponent(typeof(BitWindow));
if(logwin==null){
Debug.LogError("logwin window not found");
return;
}
BitButton b1=logwin.FindControl<BitButton>("btexit");
b1.MouseClick+=hideClick;
}
private void hideClick(object sender,MouseEventArgs e)
{
logwin.Visible=false;
}
// Update is called once per frame
void Update () {
}
}
|
|