コード例 #1
0
    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;
        });
    }
コード例 #2
0
 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));
     }
 }
コード例 #3
0
 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));
     }
 }
コード例 #4
0
    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"));
        }
    }
コード例 #5
0
    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"));
        }
    }