public void RefreshUI(int _innings, rep_message_start_game _playInfo) { this.innings = _innings; this.playInfo = _playInfo; //初始界面状态 SetUIState(0); //我的头像 if (!string.IsNullOrEmpty(PlayerData.userIcon)) { var headIcon = transform.Find("PlayerInfo/LeftHeadImage/Mask/Image").GetComponent <Image>(); StartCoroutine(Function.DownloadImage(headIcon, PlayerData.userIcon)); } //对手头像 struct_player_info opponentInfo = this.playInfo.PlayerInfo; if (!string.IsNullOrEmpty(opponentInfo.UserIcon)) { var headIcon = transform.Find("PlayerInfo/RightHeadImage/Mask/Image").GetComponent <Image>(); StartCoroutine(Function.DownloadImage(headIcon, opponentInfo.UserIcon)); } //加载玩法prefab play_data playData = PlayDataConfig.Instance.GetDataByID(this.playInfo.PlayId); UIManager.OpenUI(playData.PrefabPath, playUI, (uiObj) => { playBase = uiObj.transform.GetComponent <PlayBase>(); playBase.answerFinish = AnswerFinish; }); }
static int StartPlay(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); PlayBase obj = (PlayBase)ToLua.CheckObject <PlayBase>(L, 1); obj.StartPlay(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int GetPlayID(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); PlayBase obj = (PlayBase)ToLua.CheckObject <PlayBase>(L, 1); int o = obj.GetPlayID(); LuaDLL.lua_pushinteger(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int set_answerFinish(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); PlayBase obj = (PlayBase)o; System.Action <bool, int> arg0 = (System.Action <bool, int>)ToLua.CheckDelegate <System.Action <bool, int> >(L, 2); obj.answerFinish = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index answerFinish on a nil value")); } }
static int get_answerFinish(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); PlayBase obj = (PlayBase)o; System.Action <bool, int> ret = obj.answerFinish; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index answerFinish on a nil value")); } }