コード例 #1
0
        private static void InitCardPrefab()
        {
            mCardPrefabDic = new Dictionary <int, GameObject>();
            ResourcesComponent resourcesComponent = ETModel.Game.Scene.GetComponent <ResourcesComponent>();

            mCardPrefabDic.Add(JoyLandlordsCardPrefabType.Small, resourcesComponent.GetResoure(UIType.JoyLandlordsRoomPanel, "SmallCardItem") as GameObject);
            mCardPrefabDic.Add(JoyLandlordsCardPrefabType.Mid, resourcesComponent.GetResoure(UIType.JoyLandlordsRoomPanel, "MidCardItem") as GameObject);
            mCardPrefabDic.Add(JoyLandlordsCardPrefabType.Large, resourcesComponent.GetResoure(UIType.JoyLandlordsRoomPanel, "LargeCardItem") as GameObject);
        }
コード例 #2
0
        public static JoyLdsOtherPlayer CreateOtherPlayer(User user, int seatServerIndex)
        {
            int clinetIndex = ServerIndexConvetorClientIndex(seatServerIndex);

            if (joyLdsOtherPlayersPool.ContainsKey(clinetIndex))
            {
                joyLdsOtherPlayersPool[clinetIndex].mUser            = user;
                joyLdsOtherPlayersPool[clinetIndex].pSeatServerIndex = seatServerIndex;
                joyLdsOtherPlayersPool[clinetIndex].pSeatClinetIndex = clinetIndex;
                joyLdsOtherPlayersPool[clinetIndex].Show();
                return(joyLdsOtherPlayersPool[clinetIndex]);
            }
            ResourcesComponent resourcesComponent = ETModel.Game.Scene.GetComponent <ResourcesComponent>();
            GameObject         playerLocationGo;

            if (clinetIndex == 1)
            {
                playerLocationGo = resourcesComponent.GetResoure(UIType.JoyLandlordsRoomPanel, "PlayerLocationOneGo") as GameObject;
            }
            else
            {
                playerLocationGo = resourcesComponent.GetResoure(UIType.JoyLandlordsRoomPanel, "PlayerLocationTwoGo") as GameObject;
            }

            GameObject         insPlayerLocationGo = UnityEngine.Object.Instantiate(playerLocationGo, UIComponent.GetUiView <JoyLandlordsRoomPanelComponent>().gameObject.transform);
            ReferenceCollector referenceCollector  = insPlayerLocationGo.GetComponent <ReferenceCollector>();
            JoyLdsOtherPlayer  joyLdsBasePlayer    = new JoyLdsOtherPlayer();

            joyLdsBasePlayer.gameObject               = insPlayerLocationGo;
            joyLdsBasePlayer.mUser                    = user;
            joyLdsBasePlayer.mFigureImage             = referenceCollector.Get <GameObject>("FigureAppearanceImage").GetComponent <Image>();
            joyLdsBasePlayer.mOperationResulText      = referenceCollector.Get <GameObject>("OperationResulText").GetComponent <Text>();
            joyLdsBasePlayer.mPlayShowCardGo          = referenceCollector.Get <GameObject>("PlayShowCardGroupGo");
            joyLdsBasePlayer.mTimerLocation           = referenceCollector.Get <GameObject>("TimerLocationGo");
            joyLdsBasePlayer.mLandlordIconLocation    = referenceCollector.Get <GameObject>("LandlordIconLocationGo");
            joyLdsBasePlayer.mRediduePaiNumLocationGo = referenceCollector.Get <GameObject>("RediduePaiNumLocationGo");
            joyLdsBasePlayer.mFigureInfoParentGo      = referenceCollector.Get <GameObject>("FigureInfoGo");
            joyLdsBasePlayer.mNameText                = referenceCollector.Get <GameObject>("NameText").GetComponent <Text>();
            joyLdsBasePlayer.mBeansNumText            = referenceCollector.Get <GameObject>("BeansNumText").GetComponent <Text>();
            joyLdsBasePlayer.mPrepareGo               = referenceCollector.Get <GameObject>("PrepareGo");
            joyLdsBasePlayer.pSeatServerIndex         = seatServerIndex;
            joyLdsBasePlayer.pSeatClinetIndex         = clinetIndex;
            joyLdsBasePlayer.Init();
            joyLdsOtherPlayersPool.Add(clinetIndex, joyLdsBasePlayer);
            return(joyLdsBasePlayer);
        }
コード例 #3
0
        //还原一下
        public virtual void RestoreUI()
        {
            mNameText.text     = mUser.Name;
            mBeansNumText.text = mUser.Beans.ToString();
            HideLandlordIcon();    //隐藏地主图标
            HideOperationInfoGo(); //隐藏所有操作结果
            ResourcesComponent resourcesComponent = ETModel.Game.Scene.GetComponent <ResourcesComponent>();

            if (mUser.Sex == 1)//女
            {
                mFigureImage.sprite = resourcesComponent.GetResoure(UIType.JoyLandlordsRoomPanel, "womanAppearance") as Sprite;
            }
            else//男
            {
                mFigureImage.sprite = resourcesComponent.GetResoure(UIType.JoyLandlordsRoomPanel, "manAppearance") as Sprite;
            }
            mFigureImage.SetNativeSize();
        }
コード例 #4
0
        public void InitBtn()
        {
            mAlarmClock = AlarmClockFactory.Create(mOperationBtnParentGo.transform);//初始化计时器
            ResourcesComponent resourcesComponent = ETModel.Game.Scene.GetComponent <ResourcesComponent>();

            PlayCardsBlueBtnPrefab   = resourcesComponent.GetResoure(UIType.JoyLandlordsRoomPanel, "PlayCardsBlueBtn") as GameObject;
            PlayCardsYellowBtnPrefab = resourcesComponent.GetResoure(UIType.JoyLandlordsRoomPanel, "PlayCardsYellowBtn") as GameObject;

            NoPlayBtn        = CreateBtn(PlayCardsYellowBtnPrefab, "不出", DontPlay);
            CantAffordToBtn  = CreateBtn(PlayCardsYellowBtnPrefab, "要不起", DontPlay);
            HintBtn          = CreateBtn(PlayCardsYellowBtnPrefab, "提示", Hinit);
            RobLandlordsBtn  = CreateBtn(PlayCardsYellowBtnPrefab, "抢地主", RobLanlord);
            NoRobBtnBtn      = CreateBtn(PlayCardsYellowBtnPrefab, "不抢", NoRobLanlord);
            AddTwiceBtn      = CreateBtn(PlayCardsYellowBtnPrefab, "加倍", AddTwice);
            NoAddTwiceBtn    = CreateBtn(PlayCardsYellowBtnPrefab, "不加倍", NoAddTwice);
            CallLandlordsBtn = CreateBtn(PlayCardsYellowBtnPrefab, "叫地主", CallLanlord);
            NoCallBtn        = CreateBtn(PlayCardsYellowBtnPrefab, "不叫", NoCallLanlord);
            PlayCardBtn      = CreateBtn(PlayCardsBlueBtnPrefab, "出牌", PlayCard);
            StartGameBtn.Add(StarMathch);//开始匹配
        }
コード例 #5
0
        public static AlarmClock Create(Transform parentTransform)
        {
            AlarmClock alarmClock = ComponentFactory.Create <AlarmClock>();

            if (alarmClockPrefab == null)
            {
                ResourcesComponent resourcesComponent = ETModel.Game.Scene.GetComponent <ResourcesComponent>();
                alarmClockPrefab = resourcesComponent.GetResoure(UIType.JoyLandlordsRoomPanel, "AlarmClock") as GameObject;
            }
            alarmClock.Init(GameObject.Instantiate(alarmClockPrefab, parentTransform));
            return(alarmClock);
        }
コード例 #6
0
ファイル: ShopDataModel.cs プロジェクト: z976686281/fivestar
        public Sprite GetIconSprite()
        {
            string iconStr = "";

            if (CommodityType == GoodsId.Besans)
            {
                iconStr = "besansIcon_0";
            }
            else
            {
                iconStr = "jewelIcon_0";
            }
            ResourcesComponent resourcesComponent = ETModel.Game.Scene.GetComponent <ResourcesComponent>();

            return(resourcesComponent.GetResoure(UIType.ShopPanel, iconStr + Lv) as Sprite);
        }
コード例 #7
0
        private static void InitCardPrefab()
        {
            _cardPrefabDic = new Dictionary <int, GameObject>();
            ResourcesComponent resourcesComponent = ETModel.Game.Scene.GetComponent <ResourcesComponent>();

            _cardPrefabDic.Add(CardFiveStarCardType.Down_ZhiLi_ZhengMain, resourcesComponent.GetResoure(UIType.CardFiveStarRoomPanel, "Card_Down_ZhiLi_ZhengMain") as GameObject);
            _cardPrefabDic.Add(CardFiveStarCardType.Down_DaoDi_ZhengMain, resourcesComponent.GetResoure(UIType.CardFiveStarRoomPanel, "Card_Down_DaoDi_ZhengMain") as GameObject);
            _cardPrefabDic.Add(CardFiveStarCardType.Down_DaoDi_BeiMian, resourcesComponent.GetResoure(UIType.CardFiveStarRoomPanel, "Card_Down_DaoDi_BeiMian") as GameObject);

            _cardPrefabDic.Add(CardFiveStarCardType.Right_ZhiLi_BeiMian, resourcesComponent.GetResoure(UIType.CardFiveStarRoomPanel, "Card_Right_ZhiLi_BeiMian") as GameObject);
            _cardPrefabDic.Add(CardFiveStarCardType.Right_DaoDi_ZhengMain, resourcesComponent.GetResoure(UIType.CardFiveStarRoomPanel, "Card_Right_DaoDi_ZhengMain") as GameObject);
            _cardPrefabDic.Add(CardFiveStarCardType.Right_DaoDi_BeiMian, resourcesComponent.GetResoure(UIType.CardFiveStarRoomPanel, "Card_Right_DaoDi_BeiMian") as GameObject);

            _cardPrefabDic.Add(CardFiveStarCardType.Up_ZhiLi_BeiMian, resourcesComponent.GetResoure(UIType.CardFiveStarRoomPanel, "Card_Up_ZhiLi_BeiMian") as GameObject);
            _cardPrefabDic.Add(CardFiveStarCardType.Up_DaoDi_ZhengMain, resourcesComponent.GetResoure(UIType.CardFiveStarRoomPanel, "Card_Up_DaoDi_ZhengMain") as GameObject);
            _cardPrefabDic.Add(CardFiveStarCardType.Up_DaoDi_BeiMian, resourcesComponent.GetResoure(UIType.CardFiveStarRoomPanel, "Card_Up_DaoDi_BeiMian") as GameObject);

            _cardPrefabDic.Add(CardFiveStarCardType.Left_ZhiLi_BeiMian, resourcesComponent.GetResoure(UIType.CardFiveStarRoomPanel, "Card_Left_ZhiLi_BeiMian") as GameObject);
            _cardPrefabDic.Add(CardFiveStarCardType.Left_DaoDi_ZhengMain, resourcesComponent.GetResoure(UIType.CardFiveStarRoomPanel, "Card_Left_DaoDi_ZhengMain") as GameObject);
            _cardPrefabDic.Add(CardFiveStarCardType.Left_DaoDi_BeiMian, resourcesComponent.GetResoure(UIType.CardFiveStarRoomPanel, "Card_Left_DaoDi_BeiMian") as GameObject);

            _cardPrefabDic.Add(CardFiveStarCardType.CardFiveStarHand, resourcesComponent.GetResoure(UIType.CardFiveStarRoomPanel, "CardFiveStarHand") as GameObject);
        }
コード例 #8
0
ファイル: BaseItem.cs プロジェクト: z976686281/fivestar
        public T1 GetResoure <T1>(string resName) where T1 : UnityEngine.Object
        {
            ResourcesComponent resourcesComponent = ETModel.Game.Scene.GetComponent <ResourcesComponent>();

            return(resourcesComponent.GetResoure(pViewType, resName) as T1);
        }
コード例 #9
0
ファイル: BaseItem.cs プロジェクト: z976686281/fivestar
        public UnityEngine.Object GetResoure(string resName)
        {
            ResourcesComponent resourcesComponent = ETModel.Game.Scene.GetComponent <ResourcesComponent>();

            return(resourcesComponent.GetResoure(pViewType, resName));
        }