예제 #1
0
        private void UpdateGiftAvailableCount()
        {
            OnlineGiftAvailableCount = 0;
            CombatGiftAvailableCount = 0;
            LevelGiftAvailableCount  = 0;

            MajorPlayer player = PlayerManager.GetInstance().MajorPlayer;

            List <GiftItem> onlineGiftItemList = OnlineGiftView.GetInstance().OnlineGiftItemList;
            int             playerOnlineTime   = (int)player.onlineTime;

            foreach (GiftItem onlineGiftItem in onlineGiftItemList)
            {
                KGiftData onlineGiftData = onlineGiftItem.GiftData;
                if (player.rewardData != null && player.rewardData[onlineGiftData.nID] != null)
                {
                    bool isReward = player.rewardData[onlineGiftData.nID];
                    if (!isReward && onlineGiftData.nOnlineTime * 60 - playerOnlineTime <= 0)
                    {
                        ++OnlineGiftAvailableCount;
                    }
                }
            }

            List <GiftItem> levelGiftItemList = GiftHallView.GetInstance().LevelGiftItemList;

            foreach (GiftItem levelGiftItem in levelGiftItemList)
            {
                KGiftData levelGiftData = levelGiftItem.GiftData;
                if (player.rewardData != null && player.rewardData[levelGiftData.nID] != null)
                {
                    bool isReward = player.rewardData[levelGiftData.nID];
                    if (!isReward && levelGiftData.nLevelLimit - player.levelCurrent <= 0)
                    {
                        ++LevelGiftAvailableCount;
                    }
                }
            }

            List <GiftItem> combatGiftItemList = GiftHallView.GetInstance().CombatGiftItemList;

            foreach (GiftItem combatGiftItem in combatGiftItemList)
            {
                KGiftData combatGiftData = combatGiftItem.GiftData;
                if (player.rewardData != null && player.rewardData[combatGiftData.nID] != null)
                {
                    bool isReward = player.rewardData[combatGiftData.nID];
                    if (!isReward && combatGiftData.nCombatLimit - player.combat <= 0)
                    {
                        ++CombatGiftAvailableCount;
                    }
                }
            }
        }
예제 #2
0
        protected override void Init()
        {
            //viewGo.transform.position = new Vector3(0f,0f,viewGo.transform.position.z);
            SetViewPosition(ViewPosition.TopRight);

            //uiPanel.transform.localPosition = new Vector3(0,0,0);
            uiPanel.transform.localPosition = new Vector3(-150, -95, 0);
            //uiPanel.transform.localScale = new Vector3(0.5f,0.5f,1f);
            EventDispatcher.GameWorld.Regist(ControllerCommand.LOAD_MINI_MAP, OnLoadMap);
            EventDispatcher.GameWorld.Regist(ControllerCommand.UPDATE_MINI_MAP, OnUpdateMiniMap);

            UIEventListener.Get(ImageButtonFu.gameObject).onClick += GiftHallView.GetInstance().Open;
            //UIEventListener.Get(FindGameObject("Input")).onSubmit += OnSubmitHandler;
        }
예제 #3
0
        private object OnPlayerLevelUp(params object[] objs)
        {
            byte        level  = (byte)objs[0];
            MajorPlayer player = PlayerManager.GetInstance().MajorPlayer;

            player.levelCurrent = level;

            if (level >= 14)
            {
                MissionFollowView.GetInstance().DestroyObject();
                MissionFollowListView.GetInstance();
            }
            GiftHallView.GetInstance().UpdateUIOnDataChanged();
            return(null);
        }
예제 #4
0
        private void UpdatePlayerGiftBagData(int levelCurrent, int combat, int onlineTime, RemoteTable rewardData)
        {
            MajorPlayer player = PlayerManager.GetInstance().MajorPlayer;

            player.levelCurrent = levelCurrent;           //当前等级
            player.combat       = combat;                 //战力
            player.onlineTime   = (float)onlineTime / 10; //1s为单位

            foreach (KeyValuePair <object, object> item in rewardData.dictKV)
            {
                Int32      key   = (Int32)item.Key;
                RemoteBool value = item.Value as RemoteBool;
                player.rewardData[key] = value.GetBool();
                //key=reward tab ID value = isGained
            }

            GiftItem.curCountingGiftItem = null;
            OnlineGiftView.GetInstance().UpdateUIOnDataChanged();
            GiftHallView.GetInstance().UpdateUIOnDataChanged();
        }