예제 #1
0
    public void SetRecvData(DATA_GUILDRAID.Enum guildRaidType, _stGuildRaidGetMemberRankListAck guildRaidMemberRankList, DateTime raidEndTime)
    {
        CreateMemberRankList(guildRaidMemberRankList);

        _guildRaidType  = guildRaidType;
        _guildRaidTable = CDATA_GUILDRAID.Get(_guildRaidType);

        _BossSprite.sprite2D = UIResourceMgr.CreateSprite(BUNDLELIST.TEXTURE_GUILDRAID, _guildRaidTable.RaidBannerImage);
        _BossNameLabel.text  = StringTableManager.GetData(_guildRaidTable.RaidBossName);

        TimeSpan ts = raidEndTime - TimeManager.Instance.GetServerTime();

        _RemainTimeLabel.text = string.Format(StringTableManager.GetData(4915), ts.Hours, ts.Minutes);                                  // 4915 {0}시간 {1}분
        _EnterCountLabel.text = string.Format(StringTableManager.GetData(4924), UserInfo.Instance.GuildRaidTicket, _guildRaidEnterMax); // 4924 입장 가능 횟수 : {0} / {1}

        _EasyIcon.gameObject.SetActive(false);
        _NormalIcon.gameObject.SetActive(false);
        _HardIcon.gameObject.SetActive(false);

        if (_guildRaidTable.SetLevel == (int)enGuildRaidDifficulty.Easy)
        {
            _EasyIcon.gameObject.SetActive(true);
        }
        else if (_guildRaidTable.SetLevel == (int)enGuildRaidDifficulty.Normal)
        {
            _NormalIcon.gameObject.SetActive(true);
        }
        else if (_guildRaidTable.SetLevel == (int)enGuildRaidDifficulty.Hard)
        {
            _HardIcon.gameObject.SetActive(true);
        }
    }
예제 #2
0
    //===================================================================================
    //
    // Method
    //
    //===================================================================================
    public void SetResultData(_stGuildRaidBattleResultAck resultData)
    {
        GuildRaidInfo guildRaidInfo = UserInfo.Instance.guildRaidInfo;

        DATA_GUILDRAID guildRaidTable = CDATA_GUILDRAID.Get(guildRaidInfo.guildRaidType);

        if (guildRaidTable == null)
        {
#if DEBUG_LOG
            Debug.Log(string.Format("<color=red> GUILDRAID Table Error - guildRaidType : {0} </color>", guildRaidInfo.guildRaidType));
#endif
            return;
        }

        _easyIconLabel.text  = StringTableManager.GetData(81);    // 81 쉬움
        _nomalIconLabel.text = StringTableManager.GetData(82);    // 82 보통
        _hardIconLabel.text  = StringTableManager.GetData(83);    // 83 어려움

        _easyIcon.gameObject.SetActive(false);
        _nomalIcon.gameObject.SetActive(false);
        _hardIcon.gameObject.SetActive(false);

        if (guildRaidTable.SetLevel == (int)enGuildRaidDifficulty.Easy)
        {
            _easyIcon.gameObject.SetActive(true);
        }
        else if (guildRaidTable.SetLevel == (int)enGuildRaidDifficulty.Normal)
        {
            _nomalIcon.gameObject.SetActive(true);
        }
        else if (guildRaidTable.SetLevel == (int)enGuildRaidDifficulty.Hard)
        {
            _hardIcon.gameObject.SetActive(true);
        }

        //_bossLevel.gameObject.SetActive(false);   // 레벨없음

        _bossBannerSprite.sprite2D    = UIResourceMgr.CreateSprite(BUNDLELIST.TEXTURE_GUILDRAID, guildRaidTable.RaidBannerImage);
        _titleLabel.text              = StringTableManager.GetData(6753); // 6753	길드 레이드
        _bossName.text                = StringTableManager.GetData(guildRaidTable.RaidBossName);
        _currentScore.text            = string.Format(StringTableManager.GetData(3411), 0);
        _totalScore.text              = string.Format(StringTableManager.GetData(3411), UtilFunc.CurrencyFormat((int)(guildRaidInfo.guildRaidScore + resultData.kAddScore)));
        _moveMainMenuButtonLabel.text = StringTableManager.GetData(133);
        _moveGuildRaidLabel.text      = StringTableManager.GetData(6753);   // 6753	길드 레이드
        _moveGuildRaidReadyLabel.text = StringTableManager.GetData(135);
        _guildRaidTicketLabel.text    = string.Format(StringTableManager.GetData(4918), resultData.kUpdatePlayCount);

        if (UserInfo.Instance.GuildRaidTicket < 1)
        {
            Vector3 OriginPos = _moveMainMenuButton.transform.localPosition;
            _moveMainMenuButton.transform.localPosition = new Vector3(-150.0f, OriginPos.y, OriginPos.z);

            OriginPos = _moveGuildRaid.transform.localPosition;
            _moveGuildRaid.transform.localPosition = new Vector3(150.0f, OriginPos.y, OriginPos.z);

            _moveGuildRaidReady.gameObject.SetActive(false);
        }

        // ulog -> float -> (ulog or int) 손실발생. 그래서 저장.
        float Round = Mathf.Round(resultData.kAddScore); // ulong -> float
        _roundToInt = Mathf.RoundToInt(Round);           // float -> int

        _score = resultData.kAddScore;

        // iTween.ValueTo 호출 시 (int)iCurrScore 이 값을 Hash에서 float으로 저장할때 손실발생.
        iTween.ValueTo(gameObject, iTween.Hash("from", 0, "to", (int)_score, "onUpdate", "CurrScoreCounter", "delay", 1, "time", 1));
    }
예제 #3
0
    //===================================================================================
    //
    // Method
    //
    //===================================================================================
    public void SetRecvData(_stGuildRaidInfoAck GuildRaidInfoAck)
    {
        _guildRaidInfoAck = GuildRaidInfoAck;

        UserInfo.Instance.guildRaidInfo.guildRaidDay = _guildRaidInfoAck.kGuildRaidDay;

        if (CDATA_GUILDRAID.GetCount() < 1)
        {
            CDATA_GUILDRAID.Load();
        }

        _todayGuildRaidTableList.Clear();
        for (int i = 0; i < CDATA_GUILDRAID.GetCount(); ++i)
        {
            DATA_GUILDRAID GuildRaidTable = CDATA_GUILDRAID.GetByIndex(i);
            if ((int)GuildRaidTable.SetDay == _guildRaidInfoAck.kGuildRaidDay)
            {
                _todayGuildRaidTableList.Add(GuildRaidTable);
            }
        }

        DATA_GUILDRAID_PROGRESS._ProgressEnum ProgressEnum = DATA_GUILDRAID_PROGRESS._ProgressEnum._ProgressEnum_Max;

        foreach (DATA_GUILDRAID data in _todayGuildRaidTableList)
        {
            if (data.SetLevel == (int)enGuildRaidDifficulty.Easy)
            {
                _RaidEasyButtonSprite.sprite2D = UIResourceMgr.CreateSprite(BUNDLELIST.TEXTURE_GUILDRAID, data.RaidCardImage);
            }
            else if (data.SetLevel == (int)enGuildRaidDifficulty.Normal)
            {
                _RaidNormalButtonSprite.sprite2D = UIResourceMgr.CreateSprite(BUNDLELIST.TEXTURE_GUILDRAID, data.RaidCardImage);
            }
            else if (data.SetLevel == (int)enGuildRaidDifficulty.Hard)
            {
                _RaidHardButtonSprite.sprite2D = UIResourceMgr.CreateSprite(BUNDLELIST.TEXTURE_GUILDRAID, data.RaidCardImage);
            }

            ProgressEnum = data.ProgressEnum;
        }

        DATA_GUILDRAID_PROGRESS GuildRaidProgressTable = CDATA_GUILDRAID_PROGRESS.Get(ProgressEnum);

        ulong kGuildRaidCurrDailyScore = _guildRaidInfoAck.kGuildRaidInfo.kGuildRaidCurrDailyScore;

        SetProgress(GuildRaidProgressTable, kGuildRaidCurrDailyScore);
        SetProgressGage(GuildRaidProgressTable.MaxScore, kGuildRaidCurrDailyScore);

        _PointLabel.text = string.Format(StringTableManager.GetData(8667), kGuildRaidCurrDailyScore);        // 8667 {0} 점

        // 길드레이드 오픈상태 설정. (오픈중, 정산중, 보상중)
        {
            _RaidOpen.SetActive(false);
            _RaidCalcurate.SetActive(false);
            _RaidReward.SetActive(false);

            //GameObject ActiveObj = null;

            if (UserInfo.Instance.GuildRaidRewardState == _enGuildRaidRewardState.enGuildRaidRewardState_Recv)      // 보상중
            {
                _RaidReward.SetActive(true);
                //ActiveObj = _RaidReward;

                TimeSpan ts = _guildRaidInfoAck.kEndDate.GetDateTime() - TimeManager.Instance.GetServerTime();
                _RaidRewardTimeLabel.text = string.Format(StringTableManager.GetData(4915), ts.Hours, ts.Minutes);       // 4915 {0}시간 {1}분 남음
            }
            else
            {
                TimeSpan ts = TimeManager.Instance.GetServerTime() - _guildRaidInfoAck.kStartDate.GetDateTime();

                if (ts.TotalSeconds > 0)       // 오픈중
                {
                    _RaidOpen.SetActive(true);
                    //ActiveObj = _RaidOpen;
                }
                else                                // 정산중
                {
                    _RaidCalcurate.SetActive(true);
                    //ActiveObj = _RaidCalcurate;

                    TimeSpan calcurateTimeSpan = _guildRaidInfoAck.kStartDate.GetDateTime() - TimeManager.Instance.GetServerTime();

                    _RaidCalcurateLabel.text = string.Format(StringTableManager.GetData(8673), calcurateTimeSpan.Minutes);   // 8673 정산 중입니다. 정산에는 n분이 소요되며 해당 레이드에 참여 했다면 정산 후 보상을 받을 수 있습니다.
                }
            }

            //Transform[] childs = ActiveObj.GetComponentsInChildren<Transform>(true);
            //foreach (Transform child in childs)
            //{
            //    child.gameObject.SetActive(true);
            //}
        }
    }