Example #1
0
    public void CreateTable(List <ItemTableData> listTable)
    {
        this.ListTable.Clear();
        this.ListTable.AddRange(listTable);
        if (isAnBanFull)
        {
            ListTable.RemoveAll(x => (x.NUser == x.MaxUser));
        }

        myScrollView.ClearCells();
        if (Itemtable == null)
        {
            LoadAssetBundle.LoadPrefab(BundleName.PREFAPS, PrefabsName.PRE_ITEM_TABLE, (objPre) => {
                Itemtable = objPre;
                PopupAndLoadingScript.instance.HideLoading();
                myScrollView.OnStartFillItem(Itemtable, ListTable.Count);
                myScrollView.UpdateInfo = UpdateItemTable;
            });
        }
        else
        {
            PopupAndLoadingScript.instance.HideLoading();
            myScrollView.OnStartFillItem(Itemtable, ListTable.Count);
            myScrollView.UpdateInfo = UpdateItemTable;
        }
    }
Example #2
0
    public void addGiftInfoVatPham(List <InfoVatPham> list)
    {
        if (tblContaintGiftVatPham.transform.childCount == 0)
        {
            List <InfoVatPham> listVatPham = new List <InfoVatPham>();
            listVatPham.AddRange(list);

            if (listVatPham.Count > 0)
            {
                LoadAssetBundle.LoadPrefab(Res.AS_PREFABS, "Button_Gift", (prefabAB) =>
                {
                    GameObject vatpham = prefabAB;
                    vatpham.transform.SetParent(tblContaintGiftVatPham.transform);
                    vatpham.transform.localScale = Vector3.one;
                    vatpham.GetComponent <InfoGift>().setInfoGift(listVatPham[0].id, listVatPham[0].nameItem, listVatPham[0].links, listVatPham[0].price, listVatPham[0].balance);
                    for (int i = 1; i < listVatPham.Count; i++)
                    {
                        GameObject obj = Instantiate(vatpham);
                        obj.transform.SetParent(tblContaintGiftVatPham.transform);
                        obj.transform.localScale = Vector3.one;
                        obj.GetComponent <InfoGift>().setInfoGift(listVatPham[i].id, listVatPham[i].nameItem, listVatPham[i].links, listVatPham[i].price, listVatPham[i].balance);
                    }
                });
            }
        }
    }
Example #3
0
 public void Init(List <ItemInviteData> list)
 {
     for (int i = 0; i < listUI.Count; i++)
     {
         Destroy(listUI[i].gameObject);
     }
     listUI.Clear();
     //Thread t = new Thread(new ThreadStart(delegate {
     LoadAssetBundle.LoadPrefab(BundleName.PREFAPS, PrefabsName.PRE_ITEM_INVITE, (objPre) => {
         for (int i = 0; i < list.Count; i++)
         {
             GameObject obj = Instantiate(objPre);
             obj.transform.SetParent(parent);
             obj.transform.localScale = Vector3.zero;
             obj.transform.DOScale(1, 0.2f).SetDelay(i * 0.05f);
             ItemInviteUI it = obj.GetComponent <ItemInviteUI>();
             it.item         = list[i];
             it.SetUI();
             it.GetComponent <UIButton>()._onClick.AddListener(delegate {
                 OnClickInvite(it);
             });
             listUI.Add(it);
         }
     });
     //}));
     //t.Start();
 }
Example #4
0
    public void InitDemo(int[] arrcard)
    {
        if (arrcard == null || arrcard.Length <= 0)
        {
            return;
        }
        listCardHand   = new List <Card>();
        listIdCardHand = new List <int>();

        POS_CENTER = transform.InverseTransformPoint(CENTER_SCREEN);
        LoadAssetBundle.LoadPrefab(BundleName.PREFAPS, PrefabsName.PRE_CARD, (objPre) => {
            for (int i = 0; i < arrcard.Length; i++)
            {
                GameObject obj = Instantiate(objPre);
                obj.transform.SetParent(transform);
                obj.transform.localScale    = Vector3.one;
                obj.transform.localPosition = new Vector3(i * 60, 0, 0);
                Card card = obj.GetComponent <Card>();
                card.SetCardWithId(arrcard[i]);
                card.setSmall(isSmall);
                card.SetTouched(true);
                if (i == 0)
                {
                    w_card = card.W_Card;
                    h_card = card.H_Card;
                }
                //card.SetVisible(false);
                card.SetVisible(true);
                listIdCardHand.Add(arrcard[i]);
                listCardHand.Add(card);
            }
            Destroy(objPre);
            //SetCardKhiKetThucGame(arrcard);
        });
    }
Example #5
0
    public void InstantiateMucCuoc()
    {
        listMucCuoc.Clear();
        listMucCuoc.AddRange(LocMucCuoc(listTable));
        listMucCuoc.Sort();
        //Debug.LogError("listMucCuoc count " + listMucCuoc.Count);
        LoadAssetBundle.LoadPrefab("prefabs", "ItemMucCuoc", (obj) =>
        {
            for (int i = 0; i < listMucCuoc.Count; i++)
            {
                GameObject objMC = Instantiate(obj);
                objMC.transform.SetParent(objListMucCuoc.transform);
                objMC.transform.localPosition = Vector3.zero;
                objMC.transform.localScale    = Vector3.one;
                //Debug.LogError("Muc Cuoc " + listMucCuoc[i]);
                if (i == 0)
                {
                    objMC.transform.localScale = new Vector3(1.4f, 1.4f, 0);
                    objCurrentMC = objMC;
                    //objCurrentMC.GetComponent<Text>().color =  new Color32(255, 189, 47, 255);
                }
                //if (i > 0 && i < listMucCuoc.Count - 1)
                objMC.GetComponent <ItemMucCuoc>().UpdateMucCuoc(listMucCuoc[i]);

                //Debug.LogError("Muc Cuoc " + i + " " + listMucCuoc[i]);
            }
        });
    }
Example #6
0
    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;
        }
    }
Example #7
0
    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);
                });
            }
        });
    }
Example #8
0
 public void clickDoiThuong()
 {
     SoundManager.instance.startClickButtonAudio();
     LoadAssetBundle.LoadPrefab("prefabs", "PanelWait", (panel) => { panel.GetComponent <UIPopUp>().ShowDialog(); });
     //SendData.onGetInfoGift();
     //}
 }
Example #9
0
 // Use this for initialization
 void Start()
 {
     LoadAssetBundle.LoadPrefab(BundleName.PREFAPS, PrefabsName.PRE_ITEM_NOTI, (objPre) => {
         GameObject objInit = null;
         for (int i = 0; i < GameControl.instance.ListNoti.Count; i++)
         {
             GameObject obj = Instantiate(objPre);
             obj.transform.SetParent(tf_parent);
             obj.transform.localScale = Vector3.one;
             obj.name      = i + "";
             ItemNotiUI it = obj.GetComponent <ItemNotiUI>();
             it.item       = GameControl.instance.ListNoti[i];
             it.SetUI();
             it.GetComponent <UIButton>()._onClick.AddListener(delegate {
                 OnClickItem(obj);
             });
             if (i == 0)
             {
                 objInit = obj;
             }
         }
         Destroy(objPre);
         if (objInit != null)
         {
             OnClickItem(objInit);
         }
     });
 }
Example #10
0
 public void addGiftInfoTheCao(List <InfoTheCao> list)
 {
     if (tblContaintGiftTheCao.transform.childCount == 0)
     {
         List <InfoTheCao> listTheCao = new List <InfoTheCao>();
         listTheCao.AddRange(list);
         if (listTheCao.Count > 0)
         {
             LoadAssetBundle.LoadPrefab(Res.AS_PREFABS, "Button_Gift", (prefabAB) =>
             {
                 //GameObject thecao = prefabAB;
                 //thecao.transform.SetParent(tblContaintGiftTheCao.transform);
                 //thecao.transform.localScale = Vector3.one;
                 //thecao.GetComponent<InfoGift>().setInfoGift(listTheCao[0].id, listTheCao[0].nameItem, listTheCao[0].links, listTheCao[0].price, listTheCao[0].balance);
                 for (int i = 0; i < listTheCao.Count; i++)
                 {
                     GameObject obj = Instantiate(prefabAB);
                     obj.transform.SetParent(tblContaintGiftTheCao.transform);
                     obj.transform.localScale = Vector3.one;
                     obj.GetComponent <InfoGift>().setInfoGift(listTheCao[i].id, listTheCao[i].nameItem, listTheCao[i].links, listTheCao[i].price, listTheCao[i].balance);
                 }
                 Destroy(prefabAB);
             });
         }
     }
 }
Example #11
0
 //public void addIconSuKien(int id, string title, string content) {
 public void addIconSuKien()
 {
     if (listEvent.Count <= 0)
     {
         return;
     }
     LoadAssetBundle.LoadPrefab(Res.AS_PREFABS, Res.AS_PREFABS_ITEM_MAIL, (objPre) => {
         GameObject obj = objPre;
         obj.transform.SetParent(parentSuKien);
         obj.transform.localScale = Vector3.one;
         obj.GetComponent <ItemMail>().setIconItemSK(listEvent[0].id, "", listEvent[0].content);
         obj.GetComponent <Button>().onClick.AddListener(delegate {
             ClickDocSK(obj);
         });
         for (int i = 1; i < listEvent.Count; i++)
         {
             GameObject btnT = Instantiate(obj) as GameObject;
             btnT.transform.SetParent(parentSuKien);
             btnT.transform.localScale = Vector3.one;
             btnT.GetComponent <ItemMail>().setIconItemSK(listEvent[i].id, "", listEvent[i].content);
             btnT.GetComponent <Button>().onClick.AddListener(delegate {
                 ClickDocSK(btnT);
             });
         }
     });
     //listEvent.Add(btnT.GetComponent<ItemMail>());
 }
Example #12
0
    IEnumerator loadAvata()
    {
        yield return(new WaitForEndOfFrame());

        LoadAssetBundle.LoadPrefab(Res.AS_PREFABS, "Item_Chat_Smile", (btn) => {
            SetImage(btn);
        });
    }
Example #13
0
    public void setRank(int rank, long money)
    {
        sp_typeCard.StopAllCoroutines();
        sp_typeCard.gameObject.transform.position = new Vector3(0, -25, 0);
        if (rank == 1 || rank == 5 || money > 0)
        {
            chipBay.onMoveto(money, 2);
        }
        switch (rank)
        {
        case 0:
            if (pos == 0)
            {
                SoundManager.instance.startLostAudio();
            }
            break;

        case 1:
            LoadAssetBundle.LoadPrefab(Res.AS_PREFABS, "Win_Effect", (obj) => {
                objWinEffect = obj;
                objWinEffect.transform.SetParent(gameObject.transform);
                objWinEffect.transform.localPosition = Vector3.zero;
                //Debug.LogError("Load Win Effect 55");
            });
            if (pos == 0)
            {
                SoundManager.instance.startWinAudio();
            }
            break;

        case 2:
        case 3:
        case 4:
            if (pos == 0)
            {
                SoundManager.instance.startLostAudio();
            }
            break;

        case 5:
            LoadAssetBundle.LoadPrefab(Res.AS_PREFABS, "Win_Effect", (obj) => {
                objWinEffect = obj;
                objWinEffect.transform.SetParent(gameObject.transform);
                objWinEffect.transform.localPosition = Vector3.zero;
                //Debug.LogError("Load Win Effect 55");
            });
            sp_xoay.gameObject.SetActive(true);
            if (pos == 0)
            {
                SoundManager.instance.startWinAudio();
            }
            break;

        default:
            break;
        }
        Invoke("setVisibleThang", 3f);
    }
Example #14
0
    void Awake()
    {
        if (_instance == null)
        {
            //If I am the first instance, make me the Singleton
            _instance = this;
            DontDestroyOnLoad(this);
        }
        else
        {
            //If a Singleton already exists and you find
            //another reference in scene, destroy it!
            if (this != _instance)
            {
                Destroy(this.gameObject);
            }
        }

        //Res.list_avata = Resources.LoadAll<Sprite>("Avata");
        //for (int i = 0; i < Res.list_avata.Length; i++) {

        //}
        // Res.list_avata = LoadAssetBundle.LoadSprite()
        // Res.list_emotions = Resources.LoadAll<Sprite>("Emotions");
        Res.list_cards = Resources.LoadAll <Sprite>("Cards/cardall");
        IMEI           = "357238040933272";//SystemInfo.deviceUniqueIdentifier;
        if (panelWaiting == null)
        {
            LoadAssetBundle.LoadPrefab(Res.AS_PREFABS, Res.AS_PREFABS_WAITING, (obj) => {
                panelWaiting = obj.GetComponent <PanelWaiting>();
                panelWaiting.transform.SetParent(parentUI);
                panelWaiting.transform.localScale    = Vector3.one;
                panelWaiting.transform.localPosition = Vector3.zero;
                panelWaiting.gameObject.SetActive(false);
            });
        }
        if (panelMessageSytem == null)
        {
            LoadAssetBundle.LoadPrefab(Res.AS_PREFABS, Res.AS_PREFABS_MESSAGE_SYSTEM, (obj) => {
                panelMessageSytem = obj.GetComponent <PanelMessageSytem>();
                panelMessageSytem.transform.SetParent(parentUI);
                panelMessageSytem.transform.localScale    = Vector3.one;
                panelMessageSytem.transform.localPosition = Vector3.zero;
                panelMessageSytem.gameObject.SetActive(false);
            });
        }
        if (toast == null)
        {
            LoadAssetBundle.LoadPrefab(Res.AS_PREFABS, Res.AS_PREFABS_TOAST, (obj) => {
                toast = obj.GetComponent <Toast>();
                toast.transform.SetParent(parentUI);
                toast.transform.localScale    = Vector3.one;
                toast.transform.localPosition = Vector3.zero;
                toast.gameObject.SetActive(false);
            });
        }
    }
Example #15
0
    public void InstanceItem(int rank, int idAvata, string playername, long money)
    {
        LoadAssetBundle.LoadPrefab(Res.AS_PREFABS, "ItemRank", (prefabAB) => {
            GameObject go = (GameObject)Instantiate(prefabAB);
            go.transform.SetParent(parentItem);
            go.transform.localScale = Vector3.one;
            go.GetComponent <ItemRanking>().SetData(rank, idAvata, playername, money);

            list_top.Add(go);
        });
    }
Example #16
0
 // Use this for initialization
 void Start()
 {
     LoadAssetBundle.LoadPrefab(BundleName.PREFAPS, PrefabsName.PRE_ITEM_RANK, (objPre) => {
         for (int i = 0; i < GameControl.instance.ListRank.Count; i++)
         {
             GameObject obj = Instantiate(objPre);
             obj.transform.SetParent(tf_parent);
             obj.transform.localScale = Vector3.one;
             ItemRankUI it            = obj.GetComponent <ItemRankUI>();
             it.item = GameControl.instance.ListRank[i];
             it.SetUI();
         }
     });
 }
Example #17
0
    public override void setRank(int rank)
    {
        sp_typeCard.StopAllCoroutines();
        switch (rank)
        {
        case 0:
            if (pos == 0)
            {
                SoundManager.instance.startLostAudio();
            }
            break;

        case 1:
            LoadAssetBundle.LoadPrefab(Res.AS_PREFABS, "Win_Effect", (obj) => {
                objWinEffect = obj;
                objWinEffect.transform.SetParent(gameObject.transform);
                objWinEffect.transform.localPosition = Vector3.zero;
                //Debug.LogError("Load Win Effect 55");
            });
            if (pos == 0)
            {
                SoundManager.instance.startWinAudio();
            }
            break;

        case 2:
        case 3:
        case 4:
            if (pos == 0)
            {
                SoundManager.instance.startLostAudio();
            }
            break;

        case 5:
            LoadAssetBundle.LoadPrefab(Res.AS_PREFABS, "Win_Effect", (obj) => {
                objWinEffect = obj;
                objWinEffect.transform.SetParent(gameObject.transform);
                objWinEffect.transform.localPosition = Vector3.zero;
                //Debug.LogError("Load Win Effect 55");
            });
            if (pos == 0)
            {
                SoundManager.instance.startWinAudio();
            }
            break;
        }
        Invoke("setVisibleThang", 3f);
    }
Example #18
0
 void UpdateHistory(bool isTai)
 {
     if (Item_His_TX == null)
     {
         LoadAssetBundle.LoadPrefab(BundleName.PREFAPS, PrefabsName.PRE_ITEM_HIS_TX, (objPre) => {
             Item_His_TX = objPre;
             Item_His_TX.SetActive(false);
             CreateHis(isTai);
         });
     }
     else
     {
         CreateHis(isTai);
     }
 }
Example #19
0
 // Use this for initialization
 void Awake()
 {
     instance = this;
     bkg_dialog.localPosition = vtHide;
     LoadAssetBundle.LoadPrefab(Res.AS_PREFABS, Res.AS_PREFABS_ITEM_CHAT_SMILE, (objPre) => {
         GameObject obj = objPre;
         obj.transform.SetParent(tblSmile.transform);
         obj.transform.localScale = Vector3.one;
         LoadAssetBundle.LoadSprite(obj.GetComponent <Button>().image, Res.AS_UI_CHAT, "a" + 1);
         obj.name = "" + 0;
         obj.GetComponent <Button>().onClick.AddListener(delegate {
             ClickSmile(obj);
         });
         for (int i = 1; i < Res.EMOTION_COUNT; i++)
         {
             GameObject btn = Instantiate(obj) 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_CHAT, "a" + (i + 1));
             btn.name = "" + i;
             btn.GetComponent <Button>().onClick.AddListener(delegate {
                 ClickSmile(btn);
             });
         }
     });
     LoadAssetBundle.LoadPrefab(Res.AS_PREFABS, Res.AS_PREFABS_ITEM_CHAT_TEXT, (objPre) => {
         GameObject obj = objPre;
         obj.transform.SetParent(tblText.transform);
         obj.transform.localScale = Vector3.one;
         obj.transform.FindChild("Text").GetComponent <Text>().text = textChats[0];
         obj.name = "" + 0;
         obj.GetComponent <Button>().onClick.AddListener(delegate {
             ClickText(obj);
         });
         for (int i = 1; i < textChats.Length; i++)
         {
             GameObject btnT = Instantiate(obj) 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);
             });
         }
     });
 }
Example #20
0
 public void addList9029(List <Item9029> list)
 {
     LoadAssetBundle.LoadPrefab(Res.AS_PREFABS, "Item9029", (obj) => {
         GameObject obj9029 = obj;
         obj9029.transform.SetParent(objList9029.transform);
         obj9029.transform.localScale = Vector3.one;
         obj9029.GetComponent <Item9029>().setText(list[0].name, list[0].sys, list[0].port, list[0].money);
         for (int i = 1; i < list.Count; i++)
         {
             GameObject obj90 = Instantiate(obj9029);
             obj90.transform.SetParent(objList9029.transform);
             obj90.transform.localScale = Vector3.one;
             obj9029.GetComponent <Item9029>().setText(list[i].name, list[i].sys, list[i].port, list[i].money);
         }
     });
 }
Example #21
0
    public void LoadPopupAndLoading()
    {
        if (messageSytem == null)
        {
            LoadAssetBundle.LoadPrefab(BundleName.PREFAPS, PrefabsName.PRE_MESSAGE_SYTEM, (obj) => {
                messageSytem = obj.GetComponent <PanelMessageSytem>();
                messageSytem.transform.SetParent(objParent.transform);
                messageSytem.transform.localPosition = Vector3.zero;
                messageSytem.transform.localScale    = Vector3.one;
                messageSytem.gameObject.SetActive(false);
            });
        }

        if (objLoading == null)
        {
            LoadAssetBundle.LoadPrefab(BundleName.PREFAPS, PrefabsName.PRE_LOAD, (obj) => {
                objLoading = obj;
                objLoading.transform.SetParent(objParent.transform);
                objLoading.transform.localPosition = Vector3.zero;
                objLoading.transform.localScale    = Vector3.one;
                objLoading.SetActive(false);
            });
        }

        if (toast == null)
        {
            LoadAssetBundle.LoadPrefab(BundleName.PREFAPS, PrefabsName.PRE_TOAST, (toastPre) => {
                toast = toastPre.GetComponent <Toast>();
                toast.transform.SetParent(objParent.transform);
                toast.transform.localPosition = Vector3.zero;
                toast.transform.localScale    = Vector3.one;
                toast.gameObject.SetActive(false);
            });
        }

        //if (alert == null) {
        //    LoadAssetBundle.LoadPrefab(BundleName.PREFAPS, PrefabsName.PRE_ALERT, (alertPre) => {
        //        alert = alertPre.GetComponent<Alert>();
        //        alert.transform.SetParent(objParent.transform);
        //        alert.transform.localPosition = new Vector3(0, 200, 0);
        //        alert.transform.localScale = Vector3.one;
        //        alert.gameObject.SetActive(false);
        //    });
        //}
    }
Example #22
0
    public void addIcon(string name, string displayname, long money)
    {
        LoadAssetBundle.LoadPrefab(Res.AS_PREFABS, "ItemMoiChoi", (btnT) => {
            btnT.transform.SetParent(tblContaint.transform);
            btnT.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f);
            btnT.GetComponent <ItemInvite>().full_name = name;
            if (name.Length > 17)
            {
                name = name.Substring(0, 14) + "...";
            }

            btnT.GetComponent <ItemInvite>().setText(name, money);
            btnT.GetComponent <Button>().onClick.AddListener(delegate {
                ClickMoi(btnT);
            });
        });
        //GameObject btnT = Instantiate (btnIcon) as GameObject;
    }
Example #23
0
    void InitIconGame()
    {
        LoadAssetBundle.LoadPrefab(BundleName.PREFAPS, PrefabsName.PRE_ITEM_GAME, (obj) => {
//            for (int i = 0; i < GameConfig.NUM_GAME; i++) {
//                GameObject itemGame = Instantiate(obj);
//                itemGame.transform.SetParent(tf_parent);
//                itemGame.transform.localScale = Vector3.zero;
//                itemGame.name = i + "";
//                itemGame.GetComponent<UIButton>()._onClick.AddListener(delegate {
//                    OnClickGame(itemGame);
//                });
//                LoadAssetBundle.LoadSprite(itemGame.GetComponent<Image>(), BundleName.ICON_GAME, UIName.UI_GAME[i]);
//                listGame.Add(itemGame);
//            }
//
            StartCoroutine(LoadIconGame(obj));
        });
    }
Example #24
0
 public void infoTygia()
 {
     LoadAssetBundle.LoadPrefab("prefabs", "ItemMenhGia", (obj) => {
         GameObject menhgia = obj;
         menhgia.transform.SetParent(objListTheCao.transform);
         menhgia.transform.localScale       = Vector3.one;
         menhgia.GetComponent <Text>().text = BaseInfo.formatMoneyDetailDot(BaseInfo.gI().list_tygia[0].menhgia) + " VND = " + BaseInfo.formatMoneyDetailDot(BaseInfo.gI().list_tygia[0].xu) + " " + Res.MONEY_VIP;
         //Debug.LogError("list_tygia " + BaseInfo.gI().list_tygia.Count + (menhgia == null));
         for (int i = 1; i < BaseInfo.gI().list_tygia.Count; i++)
         {
             GameObject mg = Instantiate(menhgia);
             mg.transform.SetParent(objListTheCao.transform);
             mg.transform.localScale = Vector3.one;
             TyGia tg = (TyGia)BaseInfo.gI().list_tygia[i];
             mg.GetComponent <Text>().text = BaseInfo.formatMoneyDetailDot(tg.menhgia) + " VND = " + BaseInfo.formatMoneyDetailDot(tg.xu) + " " + Res.MONEY_VIP;
         }
     });
 }
Example #25
0
    IEnumerator init()
    {
        yield return(new WaitForEndOfFrame());

        for (int i = 0; i < smileys.Length; i++)
        {
            emoticons.Add(smileys[i], "a" + (i + 1));
        }
        LoadAssetBundle.LoadPrefab(BundleName.PREFAPS, PrefabsName.PRE_CHAT_TEXT, (objPre) => {
            for (int i = 0; i < textChats.Length; i++)
            {
                GameObject obj = Instantiate(objPre);
                obj.transform.SetParent(tf_parent_text);
                obj.transform.localScale = Vector3.one;
                obj.name = i + "";
                obj.GetComponentInChildren <Text>().text = textChats[i];
                obj.GetComponent <UIButton>()._onClick.AddListener(() => {
                    OnClickSendQuickText(obj);
                });
            }
            Destroy(objPre);
        });
        yield return(new WaitForEndOfFrame());

        List <Image> list = new List <Image>();

        LoadAssetBundle.LoadPrefab(BundleName.PREFAPS, PrefabsName.PRE_CHAT_SMILE, (objPre) => {
            for (int i = 0; i < 28; i++)
            {
                GameObject obj = Instantiate(objPre);
                obj.transform.SetParent(tf_parent_smile);
                obj.transform.localScale = Vector3.one;
                obj.name  = "" + i;
                Image img = obj.GetComponent <Image>();
                list.Add(img);

                obj.GetComponent <UIButton>()._onClick.AddListener(() => {
                    OnClickSendEmotion(obj);
                });
            }
            StartCoroutine(LoadSmile(list));
            Destroy(objPre);
        });
    }
Example #26
0
    internal void setText(string nick, string content)
    {
        string temp;
        bool   check = emoticons.TryGetValue(content, out temp);

        //GameObject obj;
        if (list.Count >= 10)
        {
            Destroy(list[0]);
            list.RemoveAt(0);
        }
        if (nick.Length > 12)
        {
            nick = nick.Substring(0, 12);
        }
        if (check)
        {
            //obj = Instantiate(icon_chat_prefab) as GameObject;
            LoadAssetBundle.LoadPrefab(Res.AS_PREFABS, "Chat_Smile", (prefabAB) => {
                GameObject obj = Instantiate(prefabAB) as GameObject;
                obj.GetComponent <Text>().text = nick + ":";

                LoadAssetBundle.LoadSprite(obj.GetComponentInChildren <Image>(), Res.AS_UI, temp);
                obj.transform.SetParent(parent_chat);
                obj.transform.localScale = Vector3.one;
                list.Add(obj);
            });
        }
        else
        {
            LoadAssetBundle.LoadPrefab(Res.AS_PREFABS, "Chat_Text", (prefabAB) => {
                GameObject obj = Instantiate(prefabAB) as GameObject;
                obj.GetComponent <Text>().text = nick + ": " + content;

                obj.transform.SetParent(parent_chat);
                obj.transform.localScale = Vector3.one;
                list.Add(obj);
            });
        }
        //scroll.verticalNormalizedPosition = 0;
        scroll.verticalScrollbar.value = 0;
        ip_chat.text = "";
        StartCoroutine(wait());
    }
Example #27
0
    private void actionNem(int id)
    {
        ABSUser player1 = GameControl.instance.currentCasino.players[0];

        float distance = Vector2.Distance(player1.transform.position, tg.transform.position);
        float time     = distance / 200;

        LoadAssetBundle.LoadPrefab(Res.AS_PREFABS, Res.action_name_ingame[id - 1], (objPre) => {
            GameObject obj = objPre;

            obj.transform.SetParent(player1.transform.parent);
            obj.transform.localPosition = player1.transform.localPosition;
            obj.transform.localScale    = new Vector3(1, 1, 1);

            obj.transform.DOLocalMove(tg.transform.localPosition, time).OnComplete(delegate {
                finish(obj);
            });
        });
    }
Example #28
0
    public void actionNem(int id, string nem, string biNem)
    {
        ABSUser player1 = players[getPlayer(nem)];
        ABSUser player2 = players[getPlayer(biNem)];

        float distance = Vector2.Distance(player1.transform.position, player2.transform.position);
        float time     = distance / 400;

        //GameObject obj = Instantiate(gameControl.gameObj_Actions_InGame[id - 1]) as GameObject;
        LoadAssetBundle.LoadPrefab(Res.AS_PREFABS, Res.action_name_ingame[id - 1], (objPre) => {
            GameObject obj = objPre;
            obj.transform.SetParent(player1.transform.parent);
            obj.transform.localPosition = player1.transform.localPosition;
            obj.transform.localScale    = new Vector3(1, 1, 1);

            obj.transform.DOLocalMove(player2.transform.localPosition, time).OnComplete(delegate {
                finish(obj);
            });
        });
    }
Example #29
0
    IEnumerator delayThangTrang(int type)
    {
        yield return(new WaitForSeconds(2f));

        SoundManager.instance.startMaubinhAudio();
        sp_thang.gameObject.SetActive(true);
        LoadAssetBundle.LoadSprite(sp_thang, Res.AS_UI, animationMB[type], () => {
            sp_thang.SetNativeSize();
        });
        //sp_thang.sprite = casinoStage.animationMauBinh[type];
        //sp_thang.spriteName = animationMB[type];
        //sp_thang.MakePixelPerfect ();
        LoadAssetBundle.LoadPrefab(Res.AS_PREFABS, "Win_Effect", (obj) => {
            objWinEffect = obj;
            objWinEffect.transform.SetParent(gameObject.transform);
            objWinEffect.transform.localPosition = Vector3.zero;
            //Debug.LogError("Load Win Effect 55");
        });
        Invoke("setVisibleThang", 2f);
    }
Example #30
0
    public void actionNem(int id, string nem, string biNem)
    {
        //Debug.Log(id + "  =====   " + nem + "    ----------     " + biNem);
        ABSUser player1 = players[getPlayer(nem)];
        ABSUser player2 = players[getPlayer(biNem)];

        float  distance    = Vector2.Distance(player1.transform.position, player2.transform.position);
        float  time        = distance / 10;
        string actionsName = null;

        switch (id)
        {
        case 1:
            actionsName = "Bia";
            break;

        case 2:
            actionsName = "Bua";
            break;

        case 3:
            actionsName = "CaChua";
            break;

        case 4:
            actionsName = "Chan";
            break;

        case 5:
            actionsName = "Dep";
            break;
        }

        LoadAssetBundle.LoadPrefab(Res.AS_ANIM, actionsName, (action) => {
            objAction = action;
            objAction.transform.parent        = player1.transform.parent;
            objAction.transform.localPosition = player1.transform.localPosition;
            objAction.transform.localScale    = new Vector3(1, 1, 1);
            objAction.transform.DOLocalMove(player2.transform.localPosition, time).OnComplete(finish);
        });
    }