public void setIconItemSK(int id, string tilte, string noiDung) { this.id = id; this.content = noiDung; del.gameObject.SetActive(false); check.gameObject.SetActive(false); if (isRead == 0) { LoadAssetBundle.LoadSprite(icon, Res.AS_UI, "icon_thu_dong"); //icon.sprite = icon_mail[0]; } else { //icon.sprite = icon_mail[1]; LoadAssetBundle.LoadSprite(icon, Res.AS_UI, "icon_thu_mo"); } if (content.Length > 20) { lb_content.text = (content.Substring(0, 20) + "..."); } else { lb_content.text = (content); } }
public void setIconItemTN(int id, string guiTu, string guiLuc, string noiDung, sbyte isRead) { this.id = id; content = noiDung; this.guiTu = guiTu; this.guiLuc = guiLuc; this.isRead = isRead; del.gameObject.SetActive(true); check.gameObject.SetActive(false); if (isRead == 0) { LoadAssetBundle.LoadSprite(icon, Res.AS_UI, "icon_thu_dong"); //icon.sprite = icon_mail[0]; } else { //icon.sprite = icon_mail[1]; LoadAssetBundle.LoadSprite(icon, Res.AS_UI, "icon_thu_mo"); } icon.SetNativeSize(); if (noiDung.Length > 20) { lb_content.text = (noiDung.Substring(0, 20) + "..."); } else { lb_content.text = (noiDung); } }
IEnumerator LoadIconGame(GameObject objPre) { yield return(new WaitForEndOfFrame()); // bool isLoad = false; for (int i = 0; i < GameConfig.NUM_GAME; i++) { // isLoad = false; GameObject itemGame = Instantiate(objPre); itemGame.transform.SetParent(tf_parent); itemGame.transform.localScale = Vector3.zero; itemGame.name = i + ""; itemGame.GetComponent <UIButton>()._onClick.AddListener(delegate { OnClickGame(itemGame); }); itemGame.transform.DOScale(1, 0.1f); LoadAssetBundle.LoadSprite(itemGame.GetComponent <Image> (), BundleName.ICON_GAME, UIName.UI_GAME [i]); //, ()=>{ // isLoad = true; // }); // listGame.Add(itemGame); // yield return new WaitUntil (()=>isLoad); // yield return new WaitForSeconds (0.1f); } Destroy(objPre); }
public override void setLoaiBai(int type) { base.setLoaiBai(type); if (type < 0 || type > 8) { return; } //if (pos != 0) { sp_typeCard.StopAllCoroutines(); sp_typeCard.gameObject.SetActive(true); LoadAssetBundle.LoadSprite(sp_typeCard, Res.AS_UI, Res.TypeCard_Name[type], () => { sp_typeCard.SetNativeSize(); }); //sp_typeCard.sprite = GameControl.instance.list_typecards[type]; sp_typeCard.gameObject.transform.localPosition = new Vector3(0, -50, 0); sp_typeCard.gameObject.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f); sp_typeCard.transform.DOLocalMoveY(-20, 0.5f); //TweenPosition.Begin (sp_typeCard.gameObject, 0.5f, new Vector3 (0, -20, 0)); StartCoroutine(setVisible(sp_typeCard.gameObject, 2.5f)); //} else { //if (pos == 0) { // if (((Xito)casinoStage).listTypeCard != null) // ((Xito)casinoStage).listTypeCard.setTg(type); //} }
public void SetImageChip(long moneyChip, UnityAction callback = null) { string nameChip = ""; if (moneyChip >= GameConfig.BetMoney * 20) { nameChip = "chipto5"; } else if (moneyChip >= GameConfig.BetMoney * 10) { nameChip = "chipto4"; } else if (moneyChip >= GameConfig.BetMoney * 5) { nameChip = "chipto3"; } else if (moneyChip >= GameConfig.BetMoney) { nameChip = "chipto2"; } else { nameChip = "chipto1"; } LoadAssetBundle.LoadSprite(img_chip, BundleName.CHIP, IsChipSum? (nameChip + "a") : nameChip, () => { if (callback != null) { callback.Invoke(); } }); }
public void SetChip(long money) { MoneyChip = money; string nameImg; if (money > GameConfig.BetMoney * 20) { nameImg = "muccuoc4"; } else if (money > GameConfig.BetMoney * 10) { nameImg = "muccuoc3"; } else if (money > GameConfig.BetMoney * 5) { nameImg = "muccuoc2"; } else { nameImg = "muccuoc1"; } if (money == 0) { gameObject.SetActive(false); } else { gameObject.SetActive(true); //lb_sochip.text = "" + BaseInfo.formatMoneyDetailDot(money); LoadAssetBundle.LoadSprite(img_chip, BundleName.UI, nameImg); } }
public void updateAvataName() { lb_name.text = (BaseInfo.gI().mainInfo.displayname); //lb_id.text = "ID:" + BaseInfo.gI().mainInfo.userid; int idAvata = BaseInfo.gI().mainInfo.idAvata; string link_avata = BaseInfo.gI().mainInfo.link_Avatar; int num_star = BaseInfo.gI().mainInfo.level_vip; lb_xu.text = "" + BaseInfo.formatMoneyNormal(BaseInfo.gI().mainInfo.moneyVip) + Res.MONEY_VIP; www = null; if (link_avata != "") { www = new WWW(link_avata); isOne = false; imgAvata.gameObject.SetActive(false); rawAvata.gameObject.SetActive(true); } else if (idAvata > 0) { imgAvata.gameObject.SetActive(true); rawAvata.gameObject.SetActive(false); // spriteAvata.spriteName = idAvata + ""; //imgAvata.sprite = Res.getAvataByID(idAvata);//Res.list_avata[idAvata + 1]; LoadAssetBundle.LoadSprite(imgAvata, Res.AS_UI_AVATA, "" + idAvata); } }
public void loadAva() { if (isLoad) { LoadAssetBundle.LoadPrefab(Res.AS_PREFABS, Res.AS_PREFABS_BUTTON_AVATA, (prefabsAB) => { GameObject obj = prefabsAB; obj.transform.parent = tblAva.transform; obj.transform.localScale = Vector3.one; LoadAssetBundle.LoadSprite(obj.GetComponent <Button>().image, Res.AS_UI_AVATA, 1 + ""); obj.name = "" + 1; obj.GetComponent <Button>().onClick.AddListener(delegate { ClickAva(obj); }); for (int i = 1; i < Res.AVATA_COUNT; i++) { GameObject btn = Instantiate(obj) as GameObject; btn.transform.parent = tblAva.transform; btn.transform.localScale = Vector3.one; //btn.GetComponent<Button>().image.sprite = Res.getAvataByID(i+1); LoadAssetBundle.LoadSprite(btn.GetComponent <Button>().image, Res.AS_UI_AVATA, (i + 1) + ""); btn.name = "" + (i + 1); btn.GetComponent <Button>().onClick.AddListener(delegate { ClickAva(btn); }); } }); isLoad = false; } }
// Use this for initialization void Awake() { instance = this; for (int i = 0; i < Res.EMOTION_COUNT; i++) { GameObject btn = Instantiate(btnSmile) as GameObject; btn.transform.SetParent(tblSmile.transform); btn.transform.localScale = Vector3.one; //btn.GetComponent<Button>().image.sprite = Res.getSmileByName("a" + (i + 1)); LoadAssetBundle.LoadSprite(btn.GetComponent <Button>().image, Res.AS_UI, "a" + (i + 1)); btn.name = "" + i; btn.GetComponent <Button>().onClick.AddListener(delegate { ClickSmile(btn); }); } for (int i = 0; i < textChats.Length; i++) { GameObject btnT = Instantiate(btnText) as GameObject; btnT.transform.SetParent(tblText.transform); btnT.transform.localScale = Vector3.one; btnT.transform.FindChild("Text").GetComponent <Text>().text = textChats[i]; btnT.name = "" + i; btnT.GetComponent <Button>().onClick.AddListener(delegate { ClickText(btnT); }); } }
public void SetEnableEffectRank(int rank) { CancelInvoke("SetDisableEffectRank"); imgEffectRank.gameObject.SetActive(true); LoadAssetBundle.LoadSprite(imgEffectRank, BundleName.UI, UIName.UI_ANI_WIN[rank]); Invoke("SetDisableEffectRank", 3); }
public void SetText(string msg) { string temp; bool check = DialogChat.emoticons.TryGetValue(msg, out temp); if (check) { rectTransform.gameObject.SetActive(false); img_emotion.gameObject.SetActive(true); LoadAssetBundle.LoadSprite(img_emotion, BundleName.EMOTIONS, temp); if (isOne) { isOne = false; img_emotion.transform.DOScale(1.1f, 0.4f).SetLoops(-1); } } else { rectTransform.gameObject.SetActive(true); img_emotion.gameObject.SetActive(false); txt_chat.text = msg; } SetVisible(true); StopCoroutine(WaitHide()); StartCoroutine(WaitHide()); }
void LoadSmile() { LoadAssetBundle.LoadPrefab(Res.AS_PREFABS, Res.AS_PREFABS_ITEM_CHAT_SMILE, (objPre) => { GameObject _obj = objPre; _obj.transform.SetParent(parentSmile); _obj.transform.localScale = Vector3.one; _obj.name = "" + 0; LoadAssetBundle.LoadSprite(_obj.GetComponent <Button>().image, Res.AS_UI_CHAT, "a" + 1); _obj.GetComponent <Button>().onClick.AddListener(delegate { sendSmile(_obj); }); for (int i = 1; i < Res.EMOTION_COUNT; i++) { GameObject obj = Instantiate(_obj) as GameObject; obj.transform.SetParent(parentSmile); obj.transform.localScale = Vector3.one; obj.name = "" + i; LoadAssetBundle.LoadSprite(obj.GetComponent <Button>().image, Res.AS_UI_CHAT, "a" + (i + 1)); obj.GetComponent <Button>().onClick.AddListener(delegate { sendSmile(obj); }); } }); }
public virtual void SetInfo(PlayerData playerData) { Init(); NamePlayer = playerData.NamePlayer; if (NamePlayer.Length <= 6) { txt_name.text = NamePlayer; } else { txt_name.text = NamePlayer.Substring(0, 6) + ".."; } SetMoney(playerData.Money); IsMaster = playerData.IsMaster; IsReady = playerData.IsReady; SetShowMaster(IsMaster); LoadAssetBundle.LoadSprite(img_avata, BundleName.AVATAS, playerData.Avata_Id + ""); if (IsMaster) { SetShowReady(false); } else { SetShowReady(IsReady); } }
protected override void infoWinPlayer(InfoWinTo infoWin, List <InfoWinTo> info2) { base.infoWinPlayer(infoWin, info2); int poss = getPlayer(infoWin.name); int type = 0; for (int i = 0; i < info2.Count; i++) { type = info2[i].typeCard; if (type >= 0 && type <= 8) { int poss2 = getPlayer(info2[i].name); //if (poss2 != 0) { //players[poss2].sp_typeCard.sprite = gameControl.list_typecards[type];//gameControl.getTypeCardByName(Res.TypeCard_Name[type]); players[poss2].sp_typeCard.gameObject.SetActive(true); players[poss2].sp_typeCard.transform.localPosition = Vector3.zero; LoadAssetBundle.LoadSprite(players[poss2].sp_typeCard, Res.AS_UI_TYPE_CARD, Res.type_card[type], () => { players[poss2].sp_typeCard.SetNativeSize(); players[poss2].onMoveSp_TypeCardToPlayer(); }); //} else { if (poss2 == 0) { if (listTypeCard != null) { listTypeCard.setTg(type); } } } } }
/* WWW www_1; * bool isOneAvata_1 = false; * new void Update() { * if (www_1 != null) { * if (www_1.isDone && !isOneAvata_1) { * raw_avatar.texture = www_1.texture; * isOneAvata_1 = true; * } * } * }*/ public void CreateInfoPlayer() { setFollowMoney(BaseInfo.gI().mainInfo.moneyXu); setName(name); setDisplayeName(BaseInfo.gI().mainInfo.displayname); lb_money.text = BaseInfo.formatMoneyNormal(getFolowMoney()); lb_money.gameObject.SetActive(true); if (lb_money_result2 != null) { lb_money_result2.SetActive(false); } /* www_1 = null; * isOneAvata_1 = false;*/ if (BaseInfo.gI().mainInfo.link_Avatar != "") { // www_1 = new WWW(BaseInfo.gI().mainInfo.link_Avatar); //img_avatar.gameObject.SetActive(false); //raw_avatar.gameObject.SetActive(true); StartCoroutine(getAvata(BaseInfo.gI().mainInfo.link_Avatar)); } else { img_avatar.gameObject.SetActive(true); raw_avatar.gameObject.SetActive(false); //img_avatar.sprite = Res.getAvataByID(BaseInfo.gI().mainInfo.idAvata); LoadAssetBundle.LoadSprite(img_avatar, Res.AS_AVATA, "" + BaseInfo.gI().mainInfo.idAvata); } }
public override void setRank(int rank) { if (cardHand.getSize() == 13) { if (rank == 1) { //sp_thang.sprite = ani_thang[2]; sp_thang.gameObject.SetActive(true); LoadAssetBundle.LoadSprite(sp_thang, Res.AS_UI, Res.ani_thang[2], () => { sp_thang.SetNativeSize(); }); if (pos == 0) { SoundManager.instance.startWinAudio(); } } else { //sp_thang.sprite = ani_thang[4]; sp_thang.gameObject.SetActive(true); LoadAssetBundle.LoadSprite(sp_thang, Res.AS_UI, Res.ani_thang[4], () => { sp_thang.SetNativeSize(); }); if (pos == 0) { SoundManager.instance.startLostAudio(); } } } else { base.setRank(rank); } }
//WWW www; //bool isOne = false; public void updateProfileUser() { string dis = BaseInfo.gI().mainInfo.displayname; if (dis.Length > 15) { dis = dis.Substring(0, 15) + "..."; } displayName.text = dis; int idAvata = BaseInfo.gI().mainInfo.idAvata; string link_avata = BaseInfo.gI().mainInfo.link_Avatar; int num_star = BaseInfo.gI().mainInfo.level_vip; displayXu.text = BaseInfo.formatMoneyNormal(BaseInfo.gI().mainInfo.moneyVip) + Res.MONEY_VIP_UPPERCASE; lb_id.text = "ID: " + BaseInfo.gI().mainInfo.userid; // www = null; if (link_avata != "") { //www = new WWW(link_avata); //isOne = false; //imgAvata.gameObject.SetActive(false); //rawAvata.gameObject.SetActive(true); StartCoroutine(getAvata(link_avata)); } else if (idAvata > 0) { imgAvata.gameObject.SetActive(true); rawAvata.gameObject.SetActive(false); // imgAvata.sprite = Res.getAvataByID(idAvata);//Res.list_avata[idAvata + 1]; LoadAssetBundle.LoadSprite(imgAvata, Res.AS_UI_AVATA, "" + idAvata); } }
public void ClickItemSuKien() { objBgPress.SetActive(true); LoadAssetBundle.LoadSprite(iconRead, Res.AS_UI, "icon_mail_2"); PlayerPrefs.SetInt(BaseInfo.gI().mainInfo.userid + id + "", 1); PlayerPrefs.Save(); PanelMail.instance.ClickItemSuKien(objBgPress, title, content); }
protected override void infoWinPlayer(InfoWinTo infoWin, List <InfoWinTo> info2) { base.infoWinPlayer(infoWin, info2); int poss = getPlayer(infoWin.name); players[poss].cardHand.setAllMo(true); int k = infoWin.arrCard.Length - 5; if (k <= 0) { return; } int type = 0; for (int i = 0; i < info2.Count; i++) { type = info2[i].typeCard; if (type >= 0 && type <= 8) { int poss2 = getPlayer(info2[i].name); //if (poss2 != 0) { //players[poss2].sp_typeCard.sprite = gameControl.list_typecards[type];//gameControl.getTypeCardByName(Res.TypeCard_Name[type]); players[poss2].sp_typeCard.gameObject.SetActive(true); players[poss2].sp_typeCard.transform.localPosition = Vector3.zero; LoadAssetBundle.LoadSprite(players[poss2].sp_typeCard, Res.AS_UI, Res.TypeCard_Name[type], () => { players[poss2].sp_typeCard.SetNativeSize(); }); players[poss2].onMoveSp_TypeCardToPlayer(); //} else { //if (poss2 == 0) { // if (listTypeCard != null) // listTypeCard.setTg(type); //} } } cardTable.setAllMo(true); cardTable.reAddAllCard(); for (int j = k; j < infoWin.arrCard.Length; j++) { if (CheckInArr(infoWin.arrCard[j], cardTable.getArrCardAll())) { cardTable.getCardbyID(infoWin.arrCard[j]).setMo(false); cardTable.getCardbyID(infoWin.arrCard[j]).setChoose(true); } } for (int i = k; i < infoWin.arrCard.Length; i++) { if (CheckInArr(infoWin.arrCard[i], players[poss].cardHand.getArrCardAll())) { players[poss].cardHand.getCardbyID(infoWin.arrCard[i]).setMo( false); players[poss].cardHand.getCardbyID(infoWin.arrCard[i]) .setChoose(true); } } }
//[SkipRename] internal void HighLowStop(Message message) { try { //long S = (long)param[0]; //int[] R = (int[])param[1]; message.reader().ReadInt(); int[] R = new int[3]; R[0] = message.reader().ReadInt(); R[1] = message.reader().ReadInt(); R[2] = message.reader().ReadInt(); int taihayxiu = message.reader().ReadInt(); int phien_nb = message.reader().ReadInt(); txt_phien.text = "Phiên: " + phien_nb; MoBat(); //timeCountDown.SetTime(S); //int sum = 0; for (int i = 0; i < img_dices.Length; i++) { img_dices[i].transform.parent.gameObject.SetActive(true); LoadAssetBundle.LoadSprite(img_dices[i], BundleName.DICE, R[i] + ""); //sum += R[i]; } betGroupTaiXiu.OnHide(); if (taihayxiu != 1) { effect_win_tai.SetActive(false); effect_win_xiu.SetActive(true); } else { effect_win_tai.SetActive(true); effect_win_xiu.SetActive(false); } UpdateHistory(taihayxiu == 1); isPlaying = false; if (TaiXiuTouchMoveControl.instance != null) { TaiXiuTouchMoveControl.instance.SetFinish(taihayxiu == 1 ? ClientConfig.Language.GetText("tai_xiu_tai") : ClientConfig.Language.GetText("tai_xiu_xiu")); } obj_can_cua.SetActive(false); if (money_refund > 0) { if (TaiXiuTouchMoveControl.instance != null) { TaiXiuTouchMoveControl.instance.SetMessageTaiXiu(money_refund, cua_refund); } money_refund = 0; } isStop = true; } catch (Exception e) { Debug.LogException(e); } }
public void SetCardWithId(int _id) { if (_id > 52 || _id < 0) { _id = 52; } ID = _id; LoadAssetBundle.LoadSprite(img_card, BundleName.CARDS, "bai" + cardPaint[_id]); }
public IEnumerator SetGameName(int gameId) { yield return(new WaitForEndOfFrame()); //Debug.LogError("Game ID " + gameId); LoadAssetBundle.LoadSprite(logoImg, Res.AS_UI, Res.logoName[gameId], () => { logoImg.SetNativeSize(); }); }
public void SetInfo(int result) { this.result = result; for (int i = 0; i < img_dices.Length; i++) { LoadAssetBundle.LoadSprite(img_dices[i], BundleName.UI, i < result ? UIName.UI_XD_RED : UIName.UI_XD_WHITE); } }
IEnumerator LoadSmile(List <Image> list) { yield return(new WaitForEndOfFrame()); for (int i = 0; i < list.Count; i++) { yield return(new WaitForSeconds(0.1f)); LoadAssetBundle.LoadSprite(list[i], BundleName.EMOTIONS, "a" + (i + 1)); } }
private void LoadSprite(bool isOn, Image bg) { if (isOn) { LoadAssetBundle.LoadSprite(bg, "ui", "icon_on"); } else { LoadAssetBundle.LoadSprite(bg, "ui", "icon_off"); } }
public void ClickLock() { isLock = !isLock; if (isLock) { LoadAssetBundle.LoadSprite(lockImg, "ui", "icon_lock"); } else { LoadAssetBundle.LoadSprite(lockImg, "ui", "icon_unlock"); } }
internal void OnBeGinXocDia_MoBat(int quando) { timeCountDown.SetTime(0); MoBat(); SetEnableButton(false, false, false, false, false); Debug.LogError("so quan do: " + quando); for (int i = 0; i < img_dices.Length; i++) { img_dices[i].gameObject.SetActive(true); LoadAssetBundle.LoadSprite(img_dices[i], BundleName.UI, i < quando ? UIName.UI_XD_RED : UIName.UI_XD_WHITE); } UpdateHistory(quando); }
public void SetUI() { img_rank.gameObject.SetActive((item.Rank == 1 || item.Rank == 2 || item.Rank == 3)); if (item.Rank == 1 || item.Rank == 2 || item.Rank == 3) { LoadAssetBundle.LoadSprite(img_rank, BundleName.UI, "rank_" + item.Rank); } txt_name.text = item.Name; txt_money.text = MoneyHelper.FormatRelativelyWithoutUnit(item.Money); txt_rank.text = item.Rank + ""; LoadAssetBundle.LoadSprite(img_avata, BundleName.AVATAS, item.Avata_Id + ""); }
void SetImage(GameObject btn) { for (int i = 0; i < Res.EMOTION_COUNT; i++) { GameObject obj = Instantiate(btn) as GameObject; obj.transform.SetParent(parentSmile); obj.transform.localScale = Vector3.one; obj.name = "" + i; LoadAssetBundle.LoadSprite(obj.GetComponent <Button>().image, Res.AS_UI, "a" + (i + 1)); obj.GetComponent <Button>().onClick.AddListener(delegate { sendSmile(obj); }); } }
public void onMoveto(long money, int type) { soChip = money; if (money <= 0) { gameObject.SetActive(false); } else { gameObject.SetActive(true); string name; if (money > BaseInfo.gI().moneyTable * 20) { name = "chip44"; } else if (money > BaseInfo.gI().moneyTable * 10) { name = "chip43"; } else if (money > BaseInfo.gI().moneyTable * 5) { name = "chip42"; } else if (money > BaseInfo.gI().moneyTable * 1) { name = "chip41"; } else { name = "chip40"; } LoadAssetBundle.LoadSprite(chip1, Res.AS_UI_ICON_CHIP, name); LoadAssetBundle.LoadSprite(chip2, Res.AS_UI_ICON_CHIP, name); LoadAssetBundle.LoadSprite(chip3, Res.AS_UI_ICON_CHIP, name); //chip1.sprite = GameControl.instance.getChipByName(name); //chip2.sprite = GameControl.instance.getChipByName(name); //chip3.sprite = GameControl.instance.getChipByName(name); if (type == 1) { StartCoroutine(Moveto()); } else { StartCoroutine(Moveback()); } } }