예제 #1
0
    private void OnGUI()
    {
        GUI.Label(new Rect(80, 90, 320, 20), "MousePos=" + _mousePos.ToString());
        GUI.Label(new Rect(80, 110, 320, 20), "LookPos=" + _lookPos.ToString());

        strSpaceId = GUI.TextField(new Rect(80, 130, 45, 24), strSpaceId);
        if (GUI.Button(new Rect(130, 130, 60, 24), "传送"))
        {
            byte spaceId;
            if (byte.TryParse(strSpaceId, out spaceId))
            {
                KBEngine.Avatar avatar = (KBEngine.Avatar)KBEngineApp.app.player();
                if (avatar != null)
                {
                    avatar.teleport(spaceId);
                }
            }
        }

        UnityEngine.GameObject obj = UnityEngine.GameObject.Find("player(Clone)");
        if (obj != null)
        {
            GUI.Label(new Rect(240, 20, 400, 100), "id=" + KBEngineApp.app.entity_id + ", position=" + obj.transform.position.ToString());
            Camera.main.fieldOfView = GUI.VerticalSlider(new Rect(Screen.width - 140, 20, 100, 400), Camera.main.fieldOfView, 90.0f, 10.0f);
        }
    }