Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        for (int i = 0; i < effects.childCount; i++)
        {
            GameObject effTemp   = effects.GetChild(i).gameObject;
            GameObject UIeffTemp = UIeffects.GetChild(i).gameObject;
            GameObject go        = PrefabUtils.AddChild(btnRoot, btnTemp.gameObject);
            Button     btn       = go.GetComponent <Button>();
            Text       btnTex    = go.GetComponentInChildren <Text>();
            btnTex.text = names[i];
            btn.onClick.AddListener(() =>
            {
                GameObject eff             = PrefabUtils.AddChild(effRoot, effTemp);
                GameObject uieff           = PrefabUtils.AddChild(UIeffRoot, UIeffTemp);
                uieff.transform.localScale = UIeffTemp.transform.localScale;
                Destroy(eff, 3);
                Destroy(uieff, 3);
            });

            //AudioClip clip = sounds[i];
            //if(null != clip)
            //{
            //    aSource.PlayOneShot(clip);
            //}
        }
    }
Ejemplo n.º 2
0
    public GameObject Spawn(string name)
    {
        if (m_objectStack.ContainsKey(name))
        {
            Stack <GameObject> stack = m_objectStack[name];
            if (stack.Count > 0)
            {
                GameObject t = stack.Pop();

                if (m_resetAction != null)
                {
                    m_resetAction(t);
                }

                t.SetActive(true);
                return(t);
            }
            else
            {
                print("pool is not enough! " + this.name + " " + name);
                GameObject go    = PrefabUtils.GetPrefab(name, prefabType);
                GameObject child = PrefabUtils.AddChild(this.gameObject, go);
                child.layer = go.layer;
                child.name  = name;
                gameObjectToKey.Add(child, name);
                child.SetActive(true);
                return(child);
            }
        }
        else
        {
            Debug.LogWarningFormat("pool no name:[{0}]", name);
            return(null);
        }
    }
Ejemplo n.º 3
0
    private void SetupUI()
    {
        for (int i = 0; i < Game.IconMgr.moods.Count; i++)
        {
            int        index = i;
            GameObject go    = PrefabUtils.AddChild(detail.MoodGrid_GridLayoutGroup.gameObject, Game.IconMgr.moods[i]);
            Button     btn   = go.GetComponent <Button>();
            btn.onClick.AddListener(() => {
                PostMood(index);
            });
        }

        return;

        foreach (ConfigWord word in ConfigWord.datas)
        {
            int         id  = word.Id;
            GameObject  go  = PrefabUtils.AddChild(detail.Content_VerticalLayoutGroup, detail.MoodWordSub_MoodWordSub);
            MoodWordSub sub = go.GetComponent <MoodWordSub>();
            sub.detail.Text_Text.text = word.TextContent;
            sub.detail.Button_Button.onClick.AddListener(() => {
                PostMood(id);
            });
        }
    }
Ejemplo n.º 4
0
    void Start()
    {
        GameObject btn = this.gameObject;

        if (null == target)
        {
            target = btn;
        }

        EventTriggerListener.Get(btn).onDown += (bt) =>
        {
            GameObject copy = PrefabUtils.AddChild(btn.transform.parent.gameObject, target);
            copy.transform.position = target.transform.position;
            int siblineIndex = btn.transform.GetSiblingIndex();
            copy.transform.SetSiblingIndex(siblineIndex);
            Image img = copy.GetComponent <Image>();
            if (null != img)
            {
                img.material = null;
                img.DOFade(0, 1);
            }

            copy.transform.DOScale(Vector3.one * scale, 1);
            Destroy(copy, 1);
        };
    }
Ejemplo n.º 5
0
    public void OnGetApplyClubCallBack(ClientResponse response)
    {
        ClubAccountVO vo = JsonMapper.ToObject <ClubAccountVO>(response.message);

        if (vo.msgcode != 0)
        {
            TipsManagerScript.getInstance().setTips(vo.msgstring);
        }
        else
        {
            isagreePanelShow = true;
            agreeListPanel.SetActive(true);
            PrefabUtils.ClearChild(agreeListGrid);
            foreach (ClubAccount ac in vo.listaccount)
            {
                GameObject     child = PrefabUtils.AddChild(agreeListGrid, agreesub);
                agreeSubScript cs    = child.GetComponent <agreeSubScript>();
                cs.setValue(ac);
                cs.agreebtn.onClick.AddListener(() =>
                {
                    ClientRequest cr  = new ClientRequest();
                    cr.headCode       = APIS.AGREE_CLUB_REQUEST;
                    cr.messageContent = "{'agree':1,'uuid':" + ac.uuid + "}";
                    CustomSocket.getInstance().sendMsg(cr);
                });
                cs.nobtn.onClick.AddListener(() =>
                {
                    ClientRequest cr  = new ClientRequest();
                    cr.headCode       = APIS.AGREE_CLUB_REQUEST;
                    cr.messageContent = "{'agree':0,'uuid':" + ac.uuid + "}";
                    CustomSocket.getInstance().sendMsg(cr);
                });
            }
        }
    }
Ejemplo n.º 6
0
    //public override void OnSceneOpened(params object[] sceneData)
    //{
    //    base.OnSceneOpened(sceneData);
    //    EventDispatcher.AddEventListener(MessageCommand.OnEnterRoom, OnEnterRoom);
    //}

    //public override void OnSceneClosed()
    //{
    //    base.OnSceneClosed();
    //    EventDispatcher.RemoveEventListener(MessageCommand.OnEnterRoom, OnEnterRoom);
    //}

    //void OnEnterRoom(params object[] args)
    //{
    //    Game.UIMgr.PushScene(UIPage.PlayPage);
    //}

    void SetupUI()
    {
        PrefabUtils.ClearChild(detail.Content_GridLayoutGroup);

        if (Game.Instance.RoomConfig != null)
        {
            foreach (RoomConfigModel config in Game.Instance.RoomConfig.roomList)
            {
                string matchType = config.matchType;
                if (config.roomType == RoomType.Normal.ToString())
                {
                    GameObject child = PrefabUtils.AddChild(detail.Content_GridLayoutGroup, detail.RoomSub_RoomSub.gameObject);
                    child.SetActive(true);
                    RoomSub sub = child.GetComponent <RoomSub>();
                    sub.SetValue(config);
                    sub.detail.Button_Button.onClick.AddListener(() =>
                    {
                        Game.SoundManager.PlayClick();
                        List <int> list = null;
#if UNITY_EDITOR
                        if (null != LogPage.Instance)
                        {
                            list = LogPage.Instance.GetTestCard();
                        }
#endif
                        Game.SocketGame.DoENROLL(matchType, list);
                    });
                }
            }
        }
    }
Ejemplo n.º 7
0
    private void SetupUI()
    {
        ActAndNoticeMsgSyn msg = Game.Instance.ActAndNoticeMsg;

        bool isActive = tab == 1;

        detail.ActiveButton_NoticeActiveTabSub.detail.SelectFlag_Image.gameObject.SetActive(isActive);
        detail.NoticeButton_NoticeActiveTabSub.detail.SelectFlag_Image.gameObject.SetActive(!isActive);
        detail.ActiveSub_ActiveSub.gameObject.SetActive(isActive);
        detail.NoticeSub_NoticeSub.gameObject.SetActive(!isActive);

        if (null != msg)
        {
            if (isActive)
            {
                PrefabUtils.ClearChild(detail.ActiveSub_ActiveSub.detail.ListContent_GridLayoutGroup);
                detail.ActiveSub_ActiveSub.detail.ContentText_Text.text = "";

                foreach (ActMsgModel item in msg.acts)
                {
                    string ctt = item.content;

                    GameObject   go  = PrefabUtils.AddChild(detail.ActiveSub_ActiveSub.detail.ListContent_GridLayoutGroup, detail.ActiveSub_ActiveSub.detail.ActiveBtnSub_ActiveBtnSub);
                    ActiveBtnSub sub = go.GetComponent <ActiveBtnSub>();
                    sub.detail.Title_Text.text = item.title;
                    sub.detail.Normal_Image.gameObject.SetActive(true);
                    sub.detail.SelectFlag_Image.gameObject.SetActive(false);

                    sub.detail.Button_Button.onClick.AddListener(() => {
                        Game.SoundManager.PlayClick();
                        if (null != selectSub)
                        {
                            selectSub.detail.Normal_Image.gameObject.SetActive(true);
                            selectSub.detail.SelectFlag_Image.gameObject.SetActive(false);
                        }
                        selectSub = sub;

                        selectSub.detail.Normal_Image.gameObject.SetActive(false);
                        selectSub.detail.SelectFlag_Image.gameObject.SetActive(true);
                        detail.ActiveSub_ActiveSub.detail.ContentText_Text.text = ctt;
                    });

                    if (null == selectSub)
                    {
                        selectSub = sub;

                        selectSub.detail.Normal_Image.gameObject.SetActive(false);
                        selectSub.detail.SelectFlag_Image.gameObject.SetActive(true);
                        detail.ActiveSub_ActiveSub.detail.ContentText_Text.text = ctt;
                    }
                }
            }
            else
            {
                detail.NoticeSub_NoticeSub.detail.ContentText_Text.text = msg.notice;
                //detail.NoticeSub_NoticeSub.detail.ContentText_Text.text ="西凉3D麻将已上线";
            }
        }
    }
Ejemplo n.º 8
0
    private void SetupUI()
    {
        detail.Time_Text.text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
        ClearCard();
        PrefabUtils.ClearChild(detail.Grid_GridLayoutGroup);

        if (null != RoomMgr.huSyn)
        {
            detail.Title_TextMeshProUGUI.text = MJUtils.GetHuType(RoomMgr.huSyn.resultType);

            if (RoomMgr.huSyn.resultType == MJUtils.HU_LiuJu)
            {
                foreach (GameOperPlayerSettle settle in RoomMgr.huSyn.detail)
                {
                    if (settle.position == Game.MJMgr.MyPlayer.postion)
                    {
                        SetupSub(detail.RoundAccountSub0_RoundAccountSub, settle, RoomMgr.huSyn.card);
                    }
                    else
                    {
                        GameObject      child = PrefabUtils.AddChild(detail.Grid_GridLayoutGroup, detail.RoundAccountSub1_RoundAccountSub);
                        RoundAccountSub sub   = child.GetComponent <RoundAccountSub>();
                        SetupSub(sub, settle);
                    }
                }
            }
            else
            {
                foreach (GameOperPlayerSettle settle in RoomMgr.huSyn.detail)
                {
                    if (settle.position == RoomMgr.huSyn.position)
                    {
                        SetupSub(detail.RoundAccountSub0_RoundAccountSub, settle, RoomMgr.huSyn.card);
                    }
                    else
                    {
                        GameObject      child = PrefabUtils.AddChild(detail.Grid_GridLayoutGroup, detail.RoundAccountSub1_RoundAccountSub);
                        RoundAccountSub sub   = child.GetComponent <RoundAccountSub>();
                        SetupSub(sub, settle);
                    }
                }
            }
        }

        PrefabUtils.ClearChild(detail.SingleCard_UIItem);
        SpawnCard(detail.SingleCard_UIItem.transform, Game.MJMgr.cardHui); //TODO wxd 结算界面的显示

        detail.M0_UIItem.gameObject.SetActive(MJUtils.HasWanfa(MJUtils.MODE_DAIHUI));
        detail.M1_UIItem.gameObject.SetActive(false);
        detail.M2_UIItem.gameObject.SetActive(false);
        detail.M3_UIItem.gameObject.SetActive(false);

        detail.M4_UIItem.gameObject.SetActive(false);
        detail.M5_UIItem.gameObject.SetActive(false);
        detail.M6_UIItem.gameObject.SetActive(false);
        detail.M7_UIItem.gameObject.SetActive(false);

        // TODO 结算界面
    }
Ejemplo n.º 9
0
    void OnClickChiBtn()
    {
        Game.SoundManager.PlayClick();

        if (MJUtils.Chi() || MJUtils.TingChi())
        {
            List <GameOperChiArg> list = RoomMgr.actionNotify.chiArg;
            //List<int[]> list = Game.MJMgr.MyPlayer.GetChiList (Game.MJMgr.lastDropCard);
            if (null != list && list.Count > 0)
            {
                detail.CtrlPanel_UIItem.gameObject.SetActive(false);

                if (list.Count == 1)
                {
                    GameOperChiArg chiArg = list[0];

                    Game.MJMgr.MyPlayer.Chi(chiArg);
                    //Game.SoundManager.PlayChi ();
                    //detail.DropButton_Button.gameObject.SetActive(true);
                }
                else
                {
                    ClearSelectPanel();
                    detail.SelectPanel_UIItem.gameObject.SetActive(true);
                    List <int> sortTemp = new List <int> ();
                    for (int i = list.Count - 1; i >= 0; i--)
                    //for (int i = 0; i < list.Count; i++)
                    {
                        GameOperChiArg chiArg = list[i];

                        GameObject selectGroup = PrefabUtils.AddChild(detail.SelectRoot_HorizontalLayoutGroup, detail.GroupButton_Button.gameObject);
                        selectGroup.SetActive(true);

                        sortTemp.Clear();
                        sortTemp.Add(chiArg.myCard1);
                        sortTemp.Add(chiArg.myCard2);
                        sortTemp.Add(chiArg.targetCard);
                        sortTemp.Sort();

                        foreach (int card in sortTemp)
                        {
                            GameObject card0 = Game.PoolManager.MjPool.Spawn(card.ToString());
                            card0.transform.SetParent(selectGroup.transform);
                            card0.transform.localScale    = Vector3.one;
                            card0.transform.localRotation = Quaternion.identity;
                        }

                        Button btn = selectGroup.GetComponent <Button> ();
                        btn.onClick.AddListener(() => {
                            Game.MJMgr.MyPlayer.Chi(chiArg);
                            detail.SelectPanel_UIItem.gameObject.SetActive(false);
                            //detail.DropButton_Button.gameObject.SetActive(true);
                        });
                    }
                }
            }
        }
    }
Ejemplo n.º 10
0
 void GenerateTextToShow(int showNumber)
 {
     if (null != unitText)
     {
         GameObject textGameObject = PrefabUtils.AddChild(this.gameObject, unitText.gameObject);
         Text       text           = textGameObject.GetComponent <Text>();
         text.text = showNumber.ToString();
     }
 }
Ejemplo n.º 11
0
 public void addRoomList(List <ClubRoomVO> list)
 {
     PrefabUtils.ClearChild(roomListGrid);
     foreach (ClubRoomVO ac in list)
     {
         GameObject        child = PrefabUtils.AddChild(roomListGrid, clubroomSub);
         clubRoomSubScript cs    = child.GetComponent <clubRoomSubScript>();
         cs.setValue(ac);
     }
 }
Ejemplo n.º 12
0
 internal void SetValue(RoomResultModel rs)
 {
     detail.RoomName_Text.text = rs.roomName;
     detail.Time_Text.text     = rs.playerTime;
     //detail.Rank_ImageText.Text = "1";
     foreach (PlayerScoreModel ps in rs.playerScore)
     {
         GameObject        child = PrefabUtils.AddChild(detail.Grid_GridLayoutGroup, detail.RoomRecordItemSub_RoomRecordItemSub);
         RoomRecordItemSub sub   = child.GetComponent <RoomRecordItemSub>();
         sub.SetValue(ps);
     }
 }
Ejemplo n.º 13
0
    public void LineUp()
    {
        PrefabUtils.ClearChild(this.transform);
        for (int i = 0; i < count; i++)
        {
            Vector3    toPos = GetLocalPos(this.transform.childCount);
            GameObject child = PrefabUtils.AddChild(this.transform.gameObject, mj);

            child.transform.localScale    = Vector3.one;
            child.transform.localRotation = Quaternion.identity;
            child.transform.localPosition = toPos;
        }
    }
Ejemplo n.º 14
0
    public void ShowMood(int index)
    {
        showMood = true;
        detail.MoodRoot_UIItem.gameObject.SetActive(showMood);
        PrefabUtils.ClearChild(detail.MoodRoot_UIItem);
        GameObject go = PrefabUtils.AddChild(detail.MoodRoot_UIItem.gameObject, Game.IconMgr.moods[index]);

        Game.Delay(3, () => {
            showMood = false;
            detail.MoodRoot_UIItem.gameObject.SetActive(showMood);
            Destroy(go);
        });
    }
Ejemplo n.º 15
0
 private void SetupUI()
 {
     PrefabUtils.ClearChild(detail.Content_GridLayoutGroup);
     if (null != result)
     {
         foreach (RoomResultModel rs in result.list)
         {
             long          roomId = rs.roomId;
             GameObject    child  = PrefabUtils.AddChild(detail.Content_GridLayoutGroup, detail.RoomRecordSub_RoomRecordSub);
             RoomRecordSub sub    = child.GetComponent <RoomRecordSub>();
             sub.SetValue(rs);
         }
     }
 }
Ejemplo n.º 16
0
    private void SetupUI()
    {
        PrefabUtils.ClearChild(detail.Content_GridLayoutGroup);

        if (null != result)
        {
            foreach (VipRoomModel room in result.roomList)
            {
                string      code  = room.code;
                GameObject  child = PrefabUtils.AddChild(detail.Content_GridLayoutGroup, detail.RoomListSub_RoomListSub);
                RoomListSub sub   = child.GetComponent <RoomListSub>();
                sub.SetValue(room);

                sub.detail.DismissButton_Button.onClick.AddListener(() =>
                {
                    Game.SoundManager.PlayClick();
                    Game.SocketGame.DoDismissVipRoom(code);
                });

                List <PlayerModel> playerList = room.players;
                sub.detail.PlayerButton_Button.onClick.AddListener(() =>
                {
                    Game.SoundManager.PlayClick();
                    detail.CloseBanButton_Button.gameObject.SetActive(true);
                    detail.BanPlayerSub_BanPlayerSub.gameObject.SetActive(true);
                    detail.BanPlayerSub_BanPlayerSub.transform.position = sub.detail.PlayerButton_Button.transform.position;
                    PrefabUtils.ClearChild(detail.BanPlayerSub_BanPlayerSub.detail.Grid_GridLayoutGroup);
                    foreach (PlayerModel player in playerList)
                    {
                        PlayerModel p     = player;
                        GameObject child1 = PrefabUtils.AddChild(detail.BanPlayerSub_BanPlayerSub.detail.Grid_GridLayoutGroup, detail.BanPlayerSub_BanPlayerSub.detail.BanSub_BanSub);
                        BanSub sub1       = child1.GetComponent <BanSub>();
                        sub1.SetValue(p);
                        sub1.detail.Button_Button.onClick.AddListener(() =>
                        {
                            Game.SoundManager.PlayClick();
                            Game.SocketGame.DoKickPlayer(code, p.playerId);
                        });
                    }
                });

                sub.detail.WxButton_Button.onClick.AddListener(() =>
                {
                    Game.SoundManager.PlayClick();
                    MyShareSDK.MyshareSDK.Share();
                });
            }
        }
    }
Ejemplo n.º 17
0
 private void SetupUI()
 {
     PrefabUtils.ClearChild(detail.Content_GridLayoutGroup);
     if (null != result)
     {
         foreach (RoomResultModel rs in result.list)
         {
             long           roomId = rs.roomId;
             GameObject     child  = PrefabUtils.AddChild(detail.Content_GridLayoutGroup, detail.TotalRecrodSub_TotalRecrodSub);
             TotalRecrodSub sub    = child.GetComponent <TotalRecrodSub>();
             sub.SetValue(rs);
             sub.detail.Button_Button.onClick.AddListener(() => {
                 Game.SoundManager.PlayClick();
                 Game.SocketHall.DoRoomResult(roomId, (response) => {
                     Game.UIMgr.PushScene(UIPage.RoomRecordPage, response);
                 });
             });
         }
     }
 }
Ejemplo n.º 18
0
    public void OnGetAllClubCallBack(ClientResponse response)
    {
        ClubAccountVO vo = JsonMapper.ToObject <ClubAccountVO>(response.message);

        if (vo.msgcode != 0)
        {
            TipsManagerScript.getInstance().setTips(vo.msgstring);
        }
        else
        {
            ismerberlistshow = true;
            menberListobj.SetActive(true);
            PrefabUtils.ClearChild(menberListGrid);
            foreach (ClubAccount ac in vo.listaccount)
            {
                GameObject      child = PrefabUtils.AddChild(menberListGrid, merbersub);
                merberSubScript cs    = child.GetComponent <merberSubScript>();
                cs.setValue(ac);
            }
        }
    }
Ejemplo n.º 19
0
    private void SetupUI()
    {
        MallProductResponse resp = Game.Instance.MallProduct;

        if (null != resp)
        {
            PrefabUtils.ClearChild(detail.CardsGrid_GridLayoutGroup);
            PrefabUtils.ClearChild(detail.CoinsGrid_GridLayoutGroup);
            foreach (MallProductModel model in resp.products)
            {
                if (model.category == 1)
                {
                    GameObject  child = PrefabUtils.AddChild(detail.CardsGrid_GridLayoutGroup, detail.ShopCardSub_ShopCardSub);
                    ShopCardSub sub   = child.GetComponent <ShopCardSub>();
                    sub.SetValue(model);
                }
                else
                {
                    GameObject   child = PrefabUtils.AddChild(detail.CoinsGrid_GridLayoutGroup, detail.ShopCoinsSub_ShopCoinsSub);
                    ShopCoinsSub sub   = child.GetComponent <ShopCoinsSub>();
                    sub.SetValue(model);
                }
            }
        }
        //foreach (ConfigShop config in ConfigShop.datas)
        //{
        //    if(config.ShopType == 1)
        //    {
        //        GameObject child = PrefabUtils.AddChild(detail.CardsGrid_GridLayoutGroup, detail.ShopCardSub_ShopCardSub);
        //        ShopCardSub sub = child.GetComponent<ShopCardSub>();
        //        sub.SetValue(config);
        //    }else
        //    {
        //        GameObject child = PrefabUtils.AddChild(detail.CoinsGrid_GridLayoutGroup, detail.ShopCoinsSub_ShopCoinsSub);
        //        ShopCoinsSub sub = child.GetComponent<ShopCoinsSub>();
        //        sub.SetValue(config);
        //    }
        //}
    }
Ejemplo n.º 20
0
    void OnClickZhiduiBtn()
    {
        Game.SoundManager.PlayClick();
        if (MJUtils.TingZhidui())
        {
            ClearSelectPanel();

            List <int> list = RoomMgr.actionNotify.tingDzs;
            if (null != list && list.Count > 0)
            {
                detail.CtrlPanel_UIItem.gameObject.SetActive(false);
                detail.SelectPanel_UIItem.gameObject.SetActive(true);

                for (int i = 0; i < list.Count; i++)
                {
                    int card = list[i];

                    GameObject selectGroup = PrefabUtils.AddChild(detail.SelectRoot_HorizontalLayoutGroup, detail.GroupButton_Button.gameObject);

                    GameObject card0 = Game.PoolManager.MjPool.Spawn(card.ToString());
                    card0.transform.SetParent(selectGroup.transform);
                    card0.transform.localScale    = Vector3.one;
                    card0.transform.localRotation = Quaternion.identity;

                    Button btn = selectGroup.GetComponent <Button>();
                    btn.onClick.AddListener(() =>
                    {
                        Game.MJMgr.MyPlayer.Zhidui(card);
                        detail.SelectPanel_UIItem.gameObject.SetActive(false);
                        EventDispatcher.DispatchEvent(MessageCommand.MJ_UpdatePlayPage);
                        //Game.SoundManager.PlayChi();
                        //detail.DropButton_Button.gameObject.SetActive(true);
                    });
                }
            }
        }
    }
Ejemplo n.º 21
0
    public override void InitializeScene()
    {
        base.InitializeScene();
        detail.CloseButton_Button.onClick.AddListener(OnBackPressed);
        detail.OKButton_Button.onClick.AddListener(OnClickOk);

        selectName = Game.Instance.face;

        foreach (Sprite face in Game.IconMgr.FaceList)
        {
            GameObject go = PrefabUtils.AddChild(detail.Gride_GridLayoutGroup, detail.FaceButton_Button);
            list.Add(go);
            Image img = go.GetComponent <Image>();
            img.sprite = face;
            go.name    = face.name;

            Button button = go.GetComponent <Button>();
            button.onClick.AddListener(() => {
                Game.SoundManager.PlayClick();
                selectName = go.name;
                UpdateUI();
            });
        }
    }
Ejemplo n.º 22
0
    public void InitPool(Action <GameObject> ResetAction = null)
    {
        if (inited)
        {
            return;
        }
        inited = true;

        this.m_objectStack   = new Dictionary <string, Stack <GameObject> >();
        this.gameObjectToKey = new Dictionary <GameObject, string>();
        this.m_resetAction   = ResetAction;
        string path = PrefabUtils.GetPrefabPath(prefabType);

        if (string.IsNullOrEmpty(path))
        {
            print("pool path is null. " + prefabType);
            return;
        }

        GameObject[] gos = Resources.LoadAll <GameObject>(path);
        foreach (GameObject go in gos)
        {
            Stack <GameObject> stack = new Stack <GameObject>();
            int count = GetPreloadAmount(go.name);
            for (int i = 0; i < count; i++)
            {
                GameObject child = PrefabUtils.AddChild(this.gameObject, go);
                child.SetActive(false);
                child.name  = go.name;
                child.layer = go.layer;
                stack.Push(child);
                gameObjectToKey.Add(child, go.name);
            }
            m_objectStack.Add(go.name, stack);
        }
    }
Ejemplo n.º 23
0
    //void OnEnterRoom(params object[] args)
    //{
    //    //OnBackPressed();
    //    Game.UIMgr.PushScene(UIPage.PlayPage);
    //}

    void SetupRank(params object[] args)
    {
        Image gameRank = detail.GameRankButton_MainRankTabSub.detail.SelectFlag_Image;

        if (null != gameRank && null != gameRank.gameObject)
        {
            gameRank.gameObject.SetActive(isRoundRank);
        }

        Image wealthRank = detail.WealthRankButton_MainRankTabSub.detail.SelectFlag_Image;

        if (null != wealthRank && null != wealthRank.gameObject)
        {
            wealthRank.gameObject.SetActive(!isRoundRank);
        }

        PrefabUtils.ClearChild(detail.Content_GridLayoutGroup);

        RankSyn rank = Game.Instance.RankSyn;

        if (null != rank)
        {
            List <RankItem> list = rank.coinList;
            if (isRoundRank)
            {
                list = rank.gameCountList;
            }

            foreach (RankItem item in list)
            {
                GameObject child = PrefabUtils.AddChild(detail.Content_GridLayoutGroup, detail.RankSub_RankSub);
                RankSub    sub   = child.GetComponent <RankSub>();
                sub.SetupUI(item, isRoundRank);
            }
        }
    }
Ejemplo n.º 24
0
 public GameObject AddChild(MonoBehaviour parent, MonoBehaviour prefab)
 {
     return(PrefabUtils.AddChild(parent, prefab));
 }