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); }
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); }); }
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; }
public void onBtnShareClicked() { UIButton btn = btn_share.GetComponent <UIButton>(); btn.isEnabled = false; AnysdkMgr.GetInstance().shareImg(false, () => { btn.isEnabled = true; }); }
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); }
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); }
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); }); }
public void onBtnIcon() { Debug.Log("onBtnIcon"); if (!mAdmin) { return; } AnysdkMgr.pick((ret, path) => { if (0 != ret) { return; } Debug.Log("after pick " + path); saveIcon(path); }); }
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; } }
public void onBtnShareClicked() { AnysdkMgr.GetInstance().shareImg(false, null); }
public void onBtnLoginClicked() { AnysdkMgr.Login(); }
void Awake() { AnysdkMgr.setPortait(); StartCoroutine(LoadAsset()); }
void Awake() { mInstance = this; }
void Start() { AnysdkMgr.setPortait(); StartCoroutine("BeginLoading"); }
void Awake() { AnysdkMgr.setLandscape(); StartCoroutine(LoadAssets()); }