// Use this for initialization void Start() { _uislots = GetComponent <UISlots>(); _btn_luaEntrance = _uislots.GetObject(0).GetComponent <Button>(); _input_x = _uislots.GetObject(1).GetComponent <InputField>(); _input_y = _uislots.GetObject(2).GetComponent <InputField>(); _btn_change = _uislots.GetObject(3).GetComponent <Button>(); Text _user_agent = _uislots.GetObject(4).GetComponent <Text>(); _user_agent.text = string.Concat(System.Net.Dns.GetHostName()); IPAddress[] ipadress = Dns.GetHostAddresses(Dns.GetHostName()); for (int i = 0; i < ipadress.Length; i++) { _user_agent.text += "\n" + ipadress[i].ToString(); } _user_agent.text = string.Empty; _btn_change.onClick.AddListener(() => { print(_input_x.text); print(_input_y.text); if (!string.IsNullOrEmpty(_input_x.text) && !string.IsNullOrEmpty(_input_y.text)) { Screen.SetResolution(int.Parse(_input_x.text), int.Parse(_input_y.text), true, 60); } }); }
static int _m_GetObject(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UISlots gen_to_be_invoked = (UISlots)translator.FastGetCSObj(L, 1); { int _index = LuaAPI.xlua_tointeger(L, 2); UnityEngine.GameObject gen_ret = gen_to_be_invoked.GetObject(_index); translator.Push(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }