コード例 #1
0
ファイル: Login.cs プロジェクト: isoundy000/shmj3d
    IEnumerator LoadAsset()
    {
/*
 *              var request = AssetBundleManager.LoadAssetAsync("ab_ui_prefabs_logincenter", "Center", typeof(GameObject));
 *              if (request == null)
 *                      yield break;
 *
 *              yield return StartCoroutine(request);
 *
 *              GameObject prefab = request.GetAsset<GameObject>();
 *
 *              if (prefab != null)
 *                      GameObject.Instantiate(prefab, transform);
 */
        var request = AssetBundleManager.LoadAssetAsync("ab_ui_prefabs_version", "version", typeof(TextAsset));

        if (request == null)
        {
            yield break;
        }

        yield return(StartCoroutine(request));

        string text = request.GetAsset <TextAsset> ().text.Trim();

        transform.Find("version").GetComponent <UILabel>().text = text;

        bool wechat = AnysdkMgr.GetInstance().CheckWechat();
        bool native = AnysdkMgr.isNative();
        bool guest  = !native || text.EndsWith("S");

        btnLogin.SetActive(wechat);
        btnGuest.SetActive(guest);
    }
コード例 #2
0
    public static void share_club(int club_id, bool tl)
    {
        Debug.Log("share_club: " + club_id);
        if (club_id == 0)
        {
            return;
        }

        string title = "<雀达麻友圈>";
        NetMgr nm    = NetMgr.GetInstance();

        nm.request_apis("get_club_detail", "club_id", club_id, data => {
            GetClubDetail ret = JsonUtility.FromJson <GetClubDetail> (data.ToString());
            if (ret.errcode != 0)
            {
                Debug.Log("get_club_detail fail");
                return;
            }

            string content = ret.data.name + "俱乐部(ID:" + club_id + ")邀请您加入\n" + ret.data.desc;

            Dictionary <string, object> args = new Dictionary <string, object>();
            args.Add("club", club_id);

            AnysdkMgr.GetInstance().share(title, content, args, tl);
        });
    }
コード例 #3
0
    public void onBtnShareClicked()
    {
        UIButton btn = btn_share.GetComponent <UIButton>();

        btn.isEnabled = false;

        AnysdkMgr.GetInstance().shareImg(false, () => {
            btn.isEnabled = true;
        });
    }
コード例 #4
0
ファイル: MainViewMgr.cs プロジェクト: isoundy000/shmj3d
    void onBtnInviteClicked()
    {
        RoomMgr rm      = RoomMgr.GetInstance();
        string  title   = "<雀达麻友圈> - 房间分享";
        string  content = "房号:" + rm.info.roomid + " 玩法:" + rm.getWanfa();
        Dictionary <string, object> args = new Dictionary <string, object>();

        args.Add("room", rm.info.roomid);

        AnysdkMgr.GetInstance().share(title, content, args);
    }
コード例 #5
0
    public bool checkQuery()
    {
        AnysdkMgr am    = AnysdkMgr.GetInstance();
        string    query = am.GetQuery();

        if (query == null || query.Length == 0)
        {
            return(false);
        }

        Dictionary <string, string> ps = PUtils.parseQuery(query);

        string roomid = "";
        int    clubid = 0;
        int    gameid = 0;

        PUtils.setTimeout(() => {
            am.ClearQuery();
        }, 0.1f);

        if (ps.ContainsKey("room"))
        {
            roomid = ps["room"];
        }

        if (ps.ContainsKey("club"))
        {
            clubid = int.Parse(ps["club"]);
        }

        if (ps.ContainsKey("game"))
        {
            gameid = int.Parse(ps["game"]);
        }

        if (roomid != "")
        {
            enterRoom(roomid);
        }
        else if (clubid > 0)
        {
            enterClub(clubid);
        }
        else if (gameid > 0)
        {
            enterGame(gameid);
        }

        return(true);
    }
コード例 #6
0
 public void onBtnShareClicked()
 {
     AnysdkMgr.GetInstance().shareImg(false, null);
 }