relive() 공개 메소드

public relive ( Byte type ) : void
type Byte
리턴 void
예제 #1
0
    void OnGUI()
    {
        if (ui_state == 1)
        {
            onSelAvatarUI();
        }
        else if (ui_state == 2)
        {
            createPlayer();
            if (showReliveGUI)
            {
                if (GUI.Button(new Rect(Screen.width / 2 - 100, Screen.height / 2, 200, 30), "Relive(复活)"))
                {
                    if (KBEngineApp.app.entity_type == "Avatar")
                    {
                        KBEngine.Avatar avatar = (KBEngine.Avatar)KBEngineApp.app.player();
                        if (avatar != null)
                        {
                            avatar.relive(1);
                        }
                    }
                }
            }
        }
        else
        {
            onLoginUI();
        }

        GUI.contentColor = labelColor;
        GUI.Label(new Rect((Screen.width / 2) - 100, 40, 400, 100), labelMsg);
    }
예제 #2
0
    void OnGUI()
    {
        if (ui_state == 1)
        {
            onSelAvatarUI();
        }
        else if (ui_state == 2)
        {
            createPlayer();
            if (showReliveGUI)
            {
                if (GUI.Button(new Rect(Screen.width / 2 - 100, Screen.height / 2, 200, 30), "Relive(复活)"))
                {
                    if (KBEngineApp.app.entity_type == "Avatar")
                    {
                        KBEngine.Avatar avatar = (KBEngine.Avatar)KBEngineApp.app.player();
                        if (avatar != null)
                        {
                            avatar.relive(1);
                        }
                    }
                }
            }

            UnityEngine.GameObject obj = UnityEngine.GameObject.Find("player(Clone)");
            if (obj != null)
            {
                GUI.Label(new Rect((Screen.width / 2) - 100, 20, 400, 100), "position=" + obj.transform.position.ToString());
            }
        }
        else
        {
            onLoginUI();
        }

        if (KBEngineApp.app != null && KBEngineApp.app.serverVersion != "" &&
            KBEngineApp.app.serverVersion != KBEngineApp.app.clientVersion)
        {
            labelColor = Color.red;
            labelMsg   = "version not match(curr=" + KBEngineApp.app.clientVersion + ", srv=" + KBEngineApp.app.serverVersion + " )(版本不匹配)";
        }
        else if (KBEngineApp.app != null && KBEngineApp.app.serverScriptVersion != "" &&
                 KBEngineApp.app.serverScriptVersion != KBEngineApp.app.clientScriptVersion)
        {
            labelColor = Color.red;
            labelMsg   = "scriptVersion not match(curr=" + KBEngineApp.app.clientScriptVersion + ", srv=" + KBEngineApp.app.serverScriptVersion + " )(脚本版本不匹配)";
        }

        GUI.contentColor = labelColor;
        GUI.Label(new Rect((Screen.width / 2) - 100, 40, 400, 100), labelMsg);
    }
예제 #3
0
    void onWorldUI()
    {
        if (showReliveGUI)
        {
            if (GUI.Button(new Rect(Screen.width / 2 - 100, Screen.height / 2, 200, 30), "Relive(复活)"))
            {
                if (KBEngineApp.app.entity_type == "Avatar")
                {
                    KBEngine.Avatar avatar = (KBEngine.Avatar)KBEngineApp.app.player();
                    if (avatar != null)
                    {
                        avatar.relive(1);
                    }
                }
            }
        }

        UnityEngine.GameObject obj = UnityEngine.GameObject.Find("player(Clone)");
        if (obj != null)
        {
            GUI.Label(new Rect((Screen.width / 2) - 100, 20, 400, 100), "position=" + obj.transform.position.ToString());
        }
    }