Exemplo n.º 1
0
 private void CheckForGift()
 {
     if (PlayerPrefs.HasKey(giftType))
     {
         string   giftDate    = PlayerPrefs.GetString(this.giftDate);
         DateTime tempDate    = DateTime.Parse(giftDate);
         TimeSpan timeSpan    = DateTime.Now - tempDate;
         string   giftDueDate = PlayerPrefs.GetString(this.giftDueDate);
         long     tempSeconds = long.Parse(giftDueDate);
         //DebugPanel.Log("TempSeconds: ", tempSeconds);
         //DebugPanel.Log("TotalSeconds: ", timeSpan.TotalSeconds);
         //DebugPanel.Log("Warunek: ", timeSpan.TotalSeconds > tempSeconds);
         if (timeSpan.TotalSeconds > tempSeconds)
         {
             int giftTypeTemp = PlayerPrefs.GetInt(giftType);
             DebugPanel.Log("Receiving gift: ", giftsDatabase[giftTypeTemp].giftName);
             GiftHandler giftHandler = Instantiate(giftReceivedPopUp) as GiftHandler;
             giftHandler.SetValues("You have received a gift!", giftsDatabase[giftTypeTemp].giftName, giftTypeTemp);
             giftHandler.transform.SetParent(giftHolder.transform, false);
             giftHandler.gameObject.SetActive(false);
             giftHandler.GetComponent <CPanel>().SetActive(true);
             giftSet = false;
             PlayerPrefs.DeleteKey(giftDate);
             PlayerPrefs.DeleteKey(giftType);
             PlayerPrefs.DeleteKey(giftDueDate);
         }
     }
 }
Exemplo n.º 2
0
        public AstrumClient()
        {
            ViewModel = new MainWindowViewModel();
            ViewModel.PropertyChanged += ViewModel_PropertyChanged;

            _questHandler       = new QuestHandler(this);
            _raidHandler        = new RaidHandler(this);
            _furyRaidHandler    = new FuryRaidHandler(this);
            _limitedRaidHandler = new LimitedRaidHandler(this);
            _breedingHandler    = new BreedingHandler(this);
            _guildBattleHandler = new GuildBattleHandler(this);
            _mypageHandler      = new MypageHandler(this);
            _giftHandler        = new GiftHandler(this);
            _itemHandler        = new ItemHandler(this);
            _gachaHandler       = new GachaHandler(this);
            _trainingHandler    = new TraningHandler(this);
            _specialAreaHandler = new SpecialAreaHandler(this);
            _talkHandler        = new TalkHandler(this);

            ViewModel.IsQuestEnable       = true;
            ViewModel.IsGuildBattleEnable = false;
            ViewModel.IsSpecialAreaEnable = false;

            ViewModel.MinStaminaStock = DEFAULT_STOCK;
            ViewModel.MinBpStock      = DEFAULT_STOCK;
            ViewModel.KeepStamina     = DEFAULT_KEEP_STAMINA;

            ViewModel.BaseDamage = DEFAULT_BASE_DAMAGE;
        }
Exemplo n.º 3
0
    /**
     * 请求多种礼包
     * @param startTime 开始计时点
     * @param giftId 礼包ID
     */
    public void GC_REQUEST_GIFT(InputMessage data)
    {
        long startTime = data.GetLong();
        int  giftId    = data.GetInt();

        GiftHandler.Instance().GC_REQUEST_GIFT(startTime, giftId);
    }
Exemplo n.º 4
0
    /**
     * 新手礼包
     * @param openShut 是否开启 礼包 (0:开启,1:关闭),如果是 1 就关闭礼包
     * @param giftType 礼包类型 限时0,不限时 1
     * @param leftTime 剩余时间
     * @param pid 礼包 pid
     */
    public void GC_NEW_COMER_GIFT(InputMessage data)
    {
        int  openShut = data.GetInt();
        int  giftType = data.GetInt();
        long leftTime = data.GetLong();
        long pid      = data.GetLong();

        GiftHandler.Instance().GC_NEW_COMER_GIFT(openShut, giftType, leftTime, pid);
    }
Exemplo n.º 5
0
 IEnumerator ShowGifts()
 {
     while (!parseGiftProcessFinished)
     {
         yield return(new WaitForSeconds(0.0f));
     }
     if (parseGiftProcessFinished)
     {
         Debug.Log("Preparing to deal with gifts");
         foreach (GiftListItem gift in queriedGiftsList)
         {
             Debug.Log("Showing gifts etc.");
             Debug.Log("Sender: " + gift.sender + " GiftType: " + gift.giftType);
             GiftHandler giftHandler = Instantiate(GiftReceivedPopUp) as GiftHandler;
             giftHandler.SetValues(gift.sender, gift.giftType, gift.giftId);
             giftHandler.gameObject.SetActive(false);
             giftHandler.transform.SetParent(giftHolder.transform, false);
             giftHandler.GetComponent <CPanel>().SetActive(true);
         }
     }
 }