예제 #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
    void updateBattery()
    {
        Transform   progress = power.Find("progress");
        SpriteMgr   sm       = progress.GetComponent <SpriteMgr>();
        UISprite    sp       = progress.GetComponent <UISprite>();
        BatteryInfo info     = AnysdkMgr.GetBatteryInfo();

        sm.setIndex(info.state == "charging" ? 1 : 0);
        sp.fillAmount = (float)info.power / 100;
    }
예제 #4
0
    public void onBtnShareClicked()
    {
        UIButton btn = btn_share.GetComponent <UIButton>();

        btn.isEnabled = false;

        AnysdkMgr.GetInstance().shareImg(false, () => {
            btn.isEnabled = true;
        });
    }
예제 #5
0
    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);
    }
예제 #6
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);
    }
예제 #7
0
    public void onBtnIcon()
    {
        Debug.Log("onBtnIcon");

        AnysdkMgr.pick((ret, path) => {
            if (0 != ret)
            {
                return;
            }

            pickPath = path;
            Debug.Log("after pick " + path);
            ImageLoader.GetInstance().LoadLocalImage(path, icon);
        });
    }
예제 #8
0
    public void onBtnIcon()
    {
        Debug.Log("onBtnIcon");

        if (!mAdmin)
        {
            return;
        }

        AnysdkMgr.pick((ret, path) => {
            if (0 != ret)
            {
                return;
            }

            Debug.Log("after pick " + path);
            saveIcon(path);
        });
    }
예제 #9
0
    void updateNetwork()
    {
        Transform   state = network.Find("state");
        Transform   wifi  = network.Find("wifi");
        SpriteMgr   sm    = wifi.GetComponent <SpriteMgr>();
        UILabel     desc  = state.GetComponent <UILabel>();
        NetworkInfo info  = AnysdkMgr.GetNetworkInfo();

        bool isWifi = info.type == "wifi";

        wifi.gameObject.SetActive(isWifi);
        state.gameObject.SetActive(!isWifi);

        if (isWifi)
        {
            sm.setIndex(info.strength - 1);
        }
        else
        {
            desc.text = info.type;
        }
    }
예제 #10
0
 public void onBtnShareClicked()
 {
     AnysdkMgr.GetInstance().shareImg(false, null);
 }
예제 #11
0
파일: Login.cs 프로젝트: isoundy000/shmj3d
 public void onBtnLoginClicked()
 {
     AnysdkMgr.Login();
 }
예제 #12
0
파일: Login.cs 프로젝트: isoundy000/shmj3d
    void Awake()
    {
        AnysdkMgr.setPortait();

        StartCoroutine(LoadAsset());
    }
예제 #13
0
 void Awake()
 {
     mInstance = this;
 }
예제 #14
0
 void Start()
 {
     AnysdkMgr.setPortait();
     StartCoroutine("BeginLoading");
 }
예제 #15
0
    void Awake()
    {
        AnysdkMgr.setLandscape();

        StartCoroutine(LoadAssets());
    }