Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | {
|
| | | StartSyncTask<PriorBundleConfig>(AssetPath.Resource);
|
| | | StartSyncTask<PriorLanguageConfig>(AssetPath.Resource);
|
| | | StartSyncTask<LoginSeverListConfig>(AssetSource.refdataFromEditor ? AssetPath.ResourceOut : AssetPath.External);
|
| | | }
|
| | |
|
| | | List<ConfigTask> configTasks = new List<ConfigTask>();
|
| | |
|
| | | public IEnumerator Co_LoadConfigs()
|
| | | {
|
| | | StartSyncTask<LoginSeverListConfig>(AssetSource.refdataFromEditor ? AssetPath.ResourceOut : AssetPath.External);
|
| | | AddAsyncTask<IconConfig>();
|
| | | AddAsyncTask<ItemConfig>();
|
| | | AddAsyncTask<SkillConfig>();
|
| | |
| | | AddAsyncTask<DungeonSpecialStateTimeConfig>();
|
| | | AddAsyncTask<DailyQuestSpecialOpenTimeConfig>();
|
| | | AddAsyncTask<WHYJRewardConfig>();
|
| | |
|
| | | while (!AllCompleted())
|
| | | {
|
| | | var completedCount = 0;
|
| | |
| | |
|
| | | }
|
| | |
|
| | | public int GetFirstOpenSurplusSeconds()
|
| | | {
|
| | | if (IsAfterFirstOpen())
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | var openDayWeek = (int)TimeUtility.openServerDayOfWeek;
|
| | | var dayIndex = TimeUtility.OpenDay + 1;
|
| | | var maxDays = 15 - openDayWeek == 0 ? 7 : openDayWeek;
|
| | | for (int i = dayIndex; i <= maxDays; i++)
|
| | | {
|
| | | if (specialOpenTimes.ContainsKey(openDayWeek) && specialOpenTimes[openDayWeek].ContainsKey(dayIndex))
|
| | | {
|
| | | var days = i - dayIndex;
|
| | | var hourMinute = specialOpenTimes[openDayWeek][dayIndex][0];
|
| | | var hour = TimeUtility.ServerNow.Hour;
|
| | | var minute = TimeUtility.ServerNow.Minute;
|
| | | var time = TimeUtility.ServerNow.AddDays(days);
|
| | | time = new DateTime(time.Year, time.Month, time.Day, hourMinute.hourBegin, hourMinute.minuteBegin, 0);
|
| | | var seconds = (int)(time - TimeUtility.ServerNow).TotalSeconds;
|
| | | return Mathf.Max(0, seconds);
|
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public bool IsAfterFirstOpen()
|
| | | {
|
| | | var isSpecialDay = TimeUtility.OpenWeekCnt <= 1;
|
| | | if (!isSpecialDay)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | var openDayWeek = (int)TimeUtility.openServerDayOfWeek;
|
| | | var dayIndex = TimeUtility.OpenDay + 1;
|
| | | var maxDays = 15 - openDayWeek == 0 ? 7 : openDayWeek;
|
| | | for (int i = 1; i <= maxDays; i++)
|
| | | {
|
| | | if (specialOpenTimes.ContainsKey(openDayWeek) && specialOpenTimes[openDayWeek].ContainsKey(dayIndex))
|
| | | {
|
| | | if (i < dayIndex)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | if (i == dayIndex)
|
| | | {
|
| | | var hourMinute = specialOpenTimes[openDayWeek][dayIndex][0];
|
| | | var hour = TimeUtility.ServerNow.Hour;
|
| | | var minute = TimeUtility.ServerNow.Minute;
|
| | | if (hour < hourMinute.hourEnd ||
|
| | | (hour == hourMinute.hourEnd && minute < hourMinute.minuteEnd))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | else
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | if (i > dayIndex)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | public bool ContainTimeNode(int week, int timeNode)
|
| | | {
|
| | | var openDayWeek = (int)TimeUtility.openServerDayOfWeek;
|
| | |
| | | public const string TASK_SKILL_HOLE = "TaskSkillHole";
|
| | | public const string RUNE_SPECIAL_HOLE = "RuneSpecialHole";
|
| | | public const string LEAGUE_NOTICE_REDPOINT = "LeagueNoticeRedpoint";
|
| | | public const string FAIRYGRABBOSS_NOTICE_REDPOINT = "FairyGrabBossRedpoint";
|
| | | public Dictionary<string, int[]> dayRemindDic = new Dictionary<string, int[]>();
|
| | |
|
| | | public bool GetDayRemind(string _remindKey)
|
| | |
| | | SetDayRemind(TASK_SKILL_HOLE);
|
| | | SetDayRemind(RUNE_SPECIAL_HOLE);
|
| | | SetDayRemind(LEAGUE_NOTICE_REDPOINT);
|
| | | SetDayRemind(FAIRYGRABBOSS_NOTICE_REDPOINT);
|
| | | }
|
| | |
|
| | | private void SetDayRemind(string _key)
|
| | |
| | | using UnityEngine; |
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class FairyGrabBossModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | public class FairyGrabBossModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk, IOpenServerActivity
|
| | | {
|
| | | public List<int> bosses { get; private set; }
|
| | | Dictionary<int, List<Item>> dropItemDict = new Dictionary<int, List<Item>>();
|
| | | Dictionary<int, Dictionary<int, FairyGrabBossInfo>> fairyGrabBossDict = new Dictionary<int, Dictionary<int, FairyGrabBossInfo>>();
|
| | | Dictionary<int, BossProgressInfo> bossProgressDict = new Dictionary<int, BossProgressInfo>();
|
| | |
|
| | | public bool IsOpen
|
| | | public bool IsActivityOpen
|
| | | {
|
| | | get
|
| | | {
|
| | |
| | | public int callMemberDuty { get; private set; }
|
| | | public int callMemberSeconds { get; private set; }
|
| | |
|
| | | public int noticeShowPet { get; private set; }
|
| | | public int noticeShowHorse { get; private set; }
|
| | |
|
| | | private bool serverInited = false;
|
| | | //private DateTime lastQueryProgressTime = DateTime.Now;
|
| | |
|
| | |
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent;
|
| | | SysNotifyMgr.Instance.sysNotifyEvent += SystemNotifyEvent;
|
| | | GlobalTimeEvent.Instance.secondEvent += SecondEvent;
|
| | | TimeMgr.Instance.OnMinuteEvent += MinuteEvent;
|
| | | OpenServerActivityCenter.Instance.Register(13, this);
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | serverInited = false;
|
| | | cacheNoticeOpen = false;
|
| | | bossAliveDict.Clear();
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | serverInited = true;
|
| | | cacheNoticeOpen = IsOpen;
|
| | | UpdateNoticeRedpoint();
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | |
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= PlayerDataRefreshInfoEvent;
|
| | | SysNotifyMgr.Instance.sysNotifyEvent -= SystemNotifyEvent;
|
| | | GlobalTimeEvent.Instance.secondEvent -= SecondEvent;
|
| | | TimeMgr.Instance.OnMinuteEvent -= MinuteEvent;
|
| | | }
|
| | |
|
| | | private void MinuteEvent()
|
| | | {
|
| | | if (serverInited)
|
| | | {
|
| | | if (cacheNoticeOpen != IsOpen)
|
| | | {
|
| | | cacheNoticeOpen = !cacheNoticeOpen;
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate((int)OpenServerActivityCenter.OSActivityType.FairyGrabBossNotice);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void PlayerDataRefreshInfoEvent(PlayerDataRefresh refreshType)
|
| | |
| | | if (_id == 139)
|
| | | {
|
| | | RecheckGrabBoss();
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate((int)OpenServerActivityCenter.OSActivityType.FairyGrabBossNotice);
|
| | | }
|
| | | UpdateNoticeRedpoint();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | var config = Config.Instance.Get<FuncConfigConfig>("FairyCallMember");
|
| | | callMemberSeconds = int.Parse(config.Numerical1);
|
| | | callMemberDuty = int.Parse(config.Numerical2);
|
| | | config = Config.Instance.Get<FuncConfigConfig>("FairyGrabBossShowModel");
|
| | | noticeShowHorse = 305;
|
| | | noticeShowPet = 50106305;
|
| | | if (config != null)
|
| | | {
|
| | | noticeShowPet = int.Parse(config.Numerical1);
|
| | | noticeShowHorse = int.Parse(config.Numerical2);
|
| | | }
|
| | | }
|
| | |
|
| | | public bool TryGetDropItems(int bossId, out List<Item> dropItems)
|
| | |
| | |
|
| | | #region 召集弹窗
|
| | | public bool helpCoolDown { get; set; }
|
| | |
|
| | | public List<FairyGrabBossHelp> fairyGrabBossHelps = new List<FairyGrabBossHelp>();
|
| | |
|
| | | public event Action fairyGrabBossHelpUpdate;
|
| | |
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 骑宠争夺预告
|
| | | public bool IsOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | DailyQuestOpenTime dailyQuestOpenTime;
|
| | | if (dailyQuestModel.TryGetOpenTime((int)DailyQuestType.FairyGrabBoss, out dailyQuestOpenTime))
|
| | | {
|
| | | return FuncOpen.Instance.IsFuncOpen(139) && !dailyQuestOpenTime.IsAfterFirstOpen();
|
| | | }
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | public bool IsAdvance
|
| | | {
|
| | | get { return false; }
|
| | | }
|
| | |
|
| | | public bool priorityOpen
|
| | | {
|
| | | get { return false; }
|
| | | }
|
| | |
|
| | | bool cacheNoticeOpen { get; set; }
|
| | |
|
| | | public event Action<int> onStateUpate;
|
| | | public int GetFirstOpenSeconds()
|
| | | {
|
| | | int seconds = 0;
|
| | | if (!InActivityTime)
|
| | | {
|
| | | DailyQuestOpenTime dailyQuestOpenTime;
|
| | | if (dailyQuestModel.TryGetOpenTime((int)DailyQuestType.FairyGrabBoss, out dailyQuestOpenTime))
|
| | | {
|
| | | seconds = dailyQuestOpenTime.GetFirstOpenSurplusSeconds();
|
| | | }
|
| | | }
|
| | | return seconds;
|
| | | }
|
| | |
|
| | | Redpoint fairyGrabBossNoticeRedpoint = new Redpoint(MainRedDot.REDPOINT_OPENSERVER, 20913);
|
| | | void UpdateNoticeRedpoint()
|
| | | {
|
| | | fairyGrabBossNoticeRedpoint.state = RedPointState.None;
|
| | | if (!DayRemind.Instance.GetDayRemind(DayRemind.FAIRYGRABBOSS_NOTICE_REDPOINT)
|
| | | && IsOpen)
|
| | | {
|
| | | fairyGrabBossNoticeRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | | }
|
| | |
|
| | | public void SetViewFairyGrabBossNotice()
|
| | | {
|
| | | if (fairyGrabBossNoticeRedpoint.state == RedPointState.Simple)
|
| | | {
|
| | | DayRemind.Instance.SetDayRemind(DayRemind.FAIRYGRABBOSS_NOTICE_REDPOINT, true);
|
| | | UpdateNoticeRedpoint();
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | public class FairyGrabBossInfo
|
| | | {
|
| | | public int npcId { get; private set; }
|
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Tuesday, October 09, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | | using TableConfig;
|
| | | namespace Snxxz.UI {
|
| | |
|
| | | public class FairyGrabBossNoticeWin : Window
|
| | | {
|
| | | [SerializeField] Button m_Goto;
|
| | | [SerializeField] RawImage m_Horse;
|
| | | [SerializeField] RawImage m_Pet;
|
| | | [SerializeField] Text m_SurplusTime;
|
| | |
|
| | | FairyGrabBossModel model { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } }
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_Goto.onClick.AddListener(Goto);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | GlobalTimeEvent.Instance.secondEvent += SecondEvent;
|
| | | Display();
|
| | | DisplayTime();
|
| | | model.SetViewFairyGrabBossNotice();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | GlobalTimeEvent.Instance.secondEvent -= SecondEvent;
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | UI3DModelExhibition.InstanceClone1.StopShow();
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | | private void Goto()
|
| | | {
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.FairyGrabBoss);
|
| | | }
|
| | |
|
| | | void Display()
|
| | | {
|
| | | m_Horse.gameObject.SetActive(true);
|
| | | m_Pet.gameObject.SetActive(true);
|
| | | var npcConfig = Config.Instance.Get<NPCConfig>(model.noticeShowPet);
|
| | | UI3DModelExhibition.Instance.ShowNPC(model.noticeShowPet, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, m_Pet);
|
| | | var horseConfig = Config.Instance.Get<HorseConfig>(model.noticeShowHorse);
|
| | | UI3DModelExhibition.InstanceClone1.ShowHourse(horseConfig.Model, m_Horse);
|
| | | UI3DModelExhibition.Instance.interactable = false;
|
| | | UI3DModelExhibition.InstanceClone1.interactable = false;
|
| | | }
|
| | |
|
| | | private void SecondEvent()
|
| | | {
|
| | | DisplayTime();
|
| | | }
|
| | |
|
| | | void DisplayTime()
|
| | | {
|
| | | var seconds = model.GetFirstOpenSeconds();
|
| | | var isOpen = model.IsOpen;
|
| | | if (seconds > 0)
|
| | | {
|
| | | if (!m_SurplusTime.gameObject.activeSelf)
|
| | | {
|
| | | m_SurplusTime.gameObject.SetActive(true);
|
| | | }
|
| | | m_SurplusTime.text = Language.Get("FairyGrabBossTime", TimeUtility.SecondsToDHMSCHS(seconds));
|
| | | }
|
| | | else if (isOpen)
|
| | | {
|
| | | if (!m_SurplusTime.gameObject.activeSelf)
|
| | | {
|
| | | m_SurplusTime.gameObject.SetActive(true);
|
| | | }
|
| | | m_SurplusTime.text = Language.Get("FairyGrabBossOpened");
|
| | | }
|
| | | else
|
| | | {
|
| | | m_SurplusTime.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1ab2a47cddd6c5c45bd057f4cdc3df3a |
| | | timeCreated: 1539083346 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | {
|
| | | m_FairyName.text = string.Empty;
|
| | | m_NoneFairy.gameObject.SetActive(true);
|
| | | if (!model.IsOpen)
|
| | | if (!model.IsActivityOpen)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | VipInvest,
|
| | | [Header("仙盟联赛预告")]
|
| | | FairyLeagueNotice,
|
| | | [Header("骑宠争夺预告")]
|
| | | FairyGrabBossNotice,
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | | FairyLeagueModel fairyLeagueModel { get { return ModelCenter.Instance.GetModel<FairyLeagueModel>(); } }
|
| | | FairyGrabBossModel fairyGrabBossModel { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } }
|
| | |
|
| | | List<int> openActivitys = new List<int>();
|
| | | List<int> priorityActivitys = new List<int>();
|
| | |
| | | activityCell.title.text = TimeUtility.SecondsToHMS(seconds);
|
| | | activityCell.title.gameObject.SetActive(seconds > 0);
|
| | | }
|
| | | cell = m_ActivityCtrl.GetActiveCellView((int)OpenServerActivityCenter.OSActivityType.FairyGrabBossNotice);
|
| | | if (cell != null)
|
| | | {
|
| | | var activityCell = cell as OpenServerActivityCell;
|
| | | var seconds = fairyGrabBossModel.GetFirstOpenSeconds();
|
| | | bool isOpen = fairyGrabBossModel.IsOpen;
|
| | | activityCell.title.gameObject.SetActive(seconds > 0 || isOpen);
|
| | | activityCell.title.color = UIHelper.GetUIColor(TextColType.Green, true);
|
| | | if (seconds > 0)
|
| | | {
|
| | | activityCell.title.text = TimeUtility.SecondsToHMS(seconds);
|
| | | }
|
| | | else if (isOpen)
|
| | | {
|
| | | activityCell.title.text = Language.Get("FairyGrabBossOpened");
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | void CheckAlreadyOpen()
|
| | |
| | | });
|
| | | bool customIcon = !string.IsNullOrEmpty(customActivity.titleIcon);
|
| | |
|
| | | _cell.title.color = UIHelper.GetUIColor(TextColType.NavyBrown);
|
| | |
|
| | | OperationBase operationBase;
|
| | | switch (_cell.index)
|
| | | {
|
| | |
| | | _cell.title.text = Language.Get("ExpActivity_Text5", (operationBase as OperationMultiExp).GetMultipleCHS());
|
| | | }
|
| | | _cell.title.gameObject.SetActive(!customIcon);
|
| | | _cell.title.color = UIHelper.GetUIColor(TextColType.NavyBrown);
|
| | | break;
|
| | | case 8:
|
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(Operation.MultipRealmPoint, out operationBase))
|
| | |
| | | _cell.title.text = Language.Get("MultipleRealmPoint", Language.Get(StringUtility.Contact("Num_CHS_", (operationBase as OperationMultipleRealmPoint).multiplePractice)));
|
| | | }
|
| | | _cell.title.gameObject.SetActive(!customIcon);
|
| | | _cell.title.color = UIHelper.GetUIColor(TextColType.NavyBrown);
|
| | | break;
|
| | | case 12:
|
| | | var seconds = fairyLeagueModel.GetBeforeFirstLeagueTime();
|
| | | _cell.title.gameObject.SetActive(seconds > 0);
|
| | | if (seconds > 0)
|
| | | {
|
| | | _cell.title.text = TimeUtility.SecondsToHMS(seconds);
|
| | | var seconds = fairyLeagueModel.GetBeforeFirstLeagueTime();
|
| | | _cell.title.gameObject.SetActive(seconds > 0);
|
| | | if (seconds > 0)
|
| | | {
|
| | | _cell.title.text = TimeUtility.SecondsToHMS(seconds);
|
| | | _cell.title.color = UIHelper.GetUIColor(TextColType.Green, true);
|
| | | }
|
| | | }
|
| | | break;
|
| | | case 13:
|
| | | {
|
| | | var seconds = fairyGrabBossModel.GetFirstOpenSeconds();
|
| | | bool isOpen = fairyGrabBossModel.IsOpen;
|
| | | _cell.title.gameObject.SetActive(seconds > 0 || isOpen);
|
| | | _cell.title.color = UIHelper.GetUIColor(TextColType.Green, true);
|
| | | if (seconds > 0)
|
| | | {
|
| | | _cell.title.text = TimeUtility.SecondsToHMS(seconds);
|
| | | }
|
| | | else if (isOpen)
|
| | | {
|
| | | _cell.title.text = Language.Get("FairyGrabBossOpened");
|
| | | }
|
| | | }
|
| | | break;
|
| | | default:
|
| | | _cell.title.gameObject.SetActive(!customIcon);
|
| | | _cell.title.text = Language.Get(StringUtility.Contact("OSActivityTitle_", _cell.index));
|
| | | _cell.title.color = UIHelper.GetUIColor(TextColType.NavyBrown);
|
| | | break;
|
| | | }
|
| | | _cell.order = _cell.index;
|
| | |
| | | WindowCenter.Instance.Open<FairyLeagueNoticeWin>(true);
|
| | | }
|
| | | break;
|
| | | case 13:
|
| | | if (windowState == WindowState.Opened)
|
| | | {
|
| | | WindowCenter.Instance.OpenWithoutAnimation<FairyGrabBossNoticeWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<FairyGrabBossNoticeWin>(true);
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | WindowCenter.Instance.CloseImmediately<FairyJadeInvestmentWin>();
|
| | | WindowCenter.Instance.CloseImmediately<VipInvestWin>();
|
| | | WindowCenter.Instance.CloseImmediately<FairyLeagueNoticeWin>();
|
| | | WindowCenter.Instance.CloseImmediately<FairyGrabBossNoticeWin>();
|
| | | }
|
| | |
|
| | | private int Compare(int order_x, int order_y)
|
| | |
| | | using Snxxz.UI; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using TableConfig; |
| | | |
| | | public class BuyItemPopModel : Singleton<BuyItemPopModel> |
| | | { |
| | | public StoreConfig storeConfig { get; private set; } |
| | | |
| | | public void SetModel(int shopId) |
| | | { |
| | | storeConfig = Config.Instance.Get<StoreConfig>(shopId); |
| | | } |
| | | |
| | | public Dictionary<int, int> vipBuyCntDict = new Dictionary<int, int>(); |
| | | public bool CheckIsVipBuy(StoreConfig model,out int curVipIndex,out int nextVipIndex) |
| | | { |
| | | vipBuyCntDict.Clear(); |
| | | curVipIndex = -1; |
| | | nextVipIndex = -1; |
| | | bool isVipBuy = false; |
| | | if (model == null) return isVipBuy; |
| | | |
| | | if (model.VIPLV.Length < 2) |
| | | { |
| | | if (model.VIPLV[0] != 0) |
| | | { |
| | | isVipBuy = true; |
| | | } |
| | | else |
| | | { |
| | | isVipBuy = false; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | isVipBuy = true; |
| | | } |
| | | |
| | | if(isVipBuy) |
| | | { |
| | | for (int i = model.VIPLV.Length-1; i > -1; i--) |
| | | { |
| | | vipBuyCntDict.Add(model.VIPLV[i], model.PurchaseNumber[i]); |
| | | } |
| | | int playerVip = PlayerDatas.Instance.baseData.VIPLv; |
| | | for (int i = model.VIPLV.Length - 1; i > -1; i--) |
| | | { |
| | | if (model.VIPLV[i] > playerVip) |
| | | { |
| | | nextVipIndex = i; |
| | | } |
| | | else if(model.VIPLV[i] <= playerVip) |
| | | { |
| | | curVipIndex = i; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | return isVipBuy; |
| | | } |
| | | |
| | | public bool CheckIsLimitBuyCnt(StoreConfig model,out int canBuyCnt,out int addBuyCnt) |
| | | { |
| | | canBuyCnt = 0; |
| | | addBuyCnt = 0; |
| | | if (model == null) return false; |
| | | |
| | | int[] canBuyNums = model.PurchaseNumber; |
| | | int curVipIndex = -1; |
| | | int nexVipIndex = -1; |
| | | bool isVipBuy = CheckIsVipBuy(model, out curVipIndex, out nexVipIndex); |
| | | if (isVipBuy) |
| | | { |
| | | if (curVipIndex != -1) |
| | | { |
| | | canBuyCnt = canBuyNums[curVipIndex]; |
| | | } |
| | | |
| | | if (nexVipIndex != -1) |
| | | { |
| | | addBuyCnt = canBuyNums[nexVipIndex] - canBuyCnt; |
| | | } |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | if (canBuyNums[0] != 0) |
| | | { |
| | | canBuyCnt = canBuyNums[0]; |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public int GetCurBuyCnt(int buyCnt,int canBuyCnt,bool isVipBuy,out bool IsReachUpper) |
| | | { |
| | | int count = 0; |
| | | IsReachUpper = false; |
| | | if(canBuyCnt == 0) |
| | | using Snxxz.UI;
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | | using System.Text;
|
| | | using TableConfig;
|
| | |
|
| | | public class BuyItemPopModel : Singleton<BuyItemPopModel>
|
| | | {
|
| | | public StoreConfig storeConfig { get; private set; }
|
| | |
|
| | | public void SetModel(int shopId)
|
| | | {
|
| | | storeConfig = Config.Instance.Get<StoreConfig>(shopId);
|
| | | }
|
| | |
|
| | | public Dictionary<int, int> vipBuyCntDict = new Dictionary<int, int>();
|
| | | public bool CheckIsVipBuy(StoreConfig model,out int curVipIndex,out int nextVipIndex)
|
| | | {
|
| | | vipBuyCntDict.Clear();
|
| | | curVipIndex = -1;
|
| | | nextVipIndex = -1;
|
| | | bool isVipBuy = false;
|
| | | if (model == null) return isVipBuy;
|
| | |
|
| | | if (model.VIPLV.Length < 2)
|
| | | {
|
| | | IsReachUpper = true; |
| | | count = 0; |
| | | } |
| | | else |
| | | { |
| | | if(buyCnt <= canBuyCnt) |
| | | { |
| | | count = buyCnt; |
| | | } |
| | | else |
| | | { |
| | | count = canBuyCnt; |
| | | IsReachUpper = true; |
| | | } |
| | | } |
| | | |
| | | if(count < 0) |
| | | { |
| | | count = 0; |
| | | } |
| | | return count; |
| | | } |
| | | |
| | | public int GetBuyPrice(StoreConfig model,int buyCnt) |
| | | { |
| | | if (model == null) return 0; |
| | | |
| | | int buyItemPrice = model.MoneyNumber * buyCnt; |
| | | return buyItemPrice; |
| | | } |
| | | } |
| | | if (model.VIPLV[0] != 0)
|
| | | {
|
| | | isVipBuy = true;
|
| | | }
|
| | | else
|
| | | {
|
| | | isVipBuy = false;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | isVipBuy = true;
|
| | | }
|
| | |
|
| | | if(isVipBuy)
|
| | | {
|
| | | for (int i = model.VIPLV.Length-1; i > -1; i--)
|
| | | {
|
| | | vipBuyCntDict.Add(model.VIPLV[i], model.PurchaseNumber[i]);
|
| | | }
|
| | | int playerVip = PlayerDatas.Instance.baseData.VIPLv;
|
| | | for (int i = model.VIPLV.Length - 1; i > -1; i--)
|
| | | {
|
| | | if (model.VIPLV[i] > playerVip)
|
| | | {
|
| | | nextVipIndex = i;
|
| | | }
|
| | | else if(model.VIPLV[i] <= playerVip)
|
| | | {
|
| | | curVipIndex = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | return isVipBuy;
|
| | | }
|
| | |
|
| | | public bool CheckIsLimitBuyCnt(StoreConfig model,out int canBuyCnt,out int addBuyCnt)
|
| | | {
|
| | | canBuyCnt = 0;
|
| | | addBuyCnt = 0;
|
| | | if (model == null) return false;
|
| | |
|
| | | int[] canBuyNums = model.PurchaseNumber;
|
| | | int curVipIndex = -1;
|
| | | int nexVipIndex = -1;
|
| | | bool isVipBuy = CheckIsVipBuy(model, out curVipIndex, out nexVipIndex);
|
| | | if (isVipBuy)
|
| | | {
|
| | | if (curVipIndex != -1)
|
| | | {
|
| | | canBuyCnt = canBuyNums[curVipIndex];
|
| | | }
|
| | |
|
| | | if (nexVipIndex != -1)
|
| | | {
|
| | | addBuyCnt = canBuyNums[nexVipIndex] - canBuyCnt;
|
| | | }
|
| | | return true;
|
| | | }
|
| | | else
|
| | | {
|
| | | if (canBuyNums[0] != 0)
|
| | | {
|
| | | canBuyCnt = canBuyNums[0];
|
| | | return true;
|
| | | }
|
| | | else
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public int GetCurBuyCnt(int buyCnt,int remainBuyCnt,out bool IsReachUpper)
|
| | | {
|
| | | int count = 0;
|
| | | IsReachUpper = false;
|
| | | if(remainBuyCnt == 0)
|
| | | {
|
| | | IsReachUpper = true;
|
| | | count = 0;
|
| | | }
|
| | | else
|
| | | {
|
| | | if(buyCnt <= remainBuyCnt)
|
| | | {
|
| | | count = buyCnt;
|
| | | }
|
| | | else
|
| | | {
|
| | | count = remainBuyCnt;
|
| | | IsReachUpper = true;
|
| | | }
|
| | | }
|
| | |
|
| | | if(count < 0)
|
| | | {
|
| | | count = 0;
|
| | | }
|
| | | return count;
|
| | | }
|
| | |
|
| | | public int GetRemainBuyCnt(int canBuyCnt,BuyShopItemLimit shopItemLimit,bool isVipBuy)
|
| | | {
|
| | | int haveBuyCnt = 0;
|
| | | if (shopItemLimit != null)
|
| | | {
|
| | | haveBuyCnt = shopItemLimit.BuyCnt;
|
| | | }
|
| | |
|
| | | if (canBuyCnt <= 0 && !isVipBuy)
|
| | | {
|
| | | canBuyCnt = 9999;
|
| | | }
|
| | | int remainCnt = canBuyCnt - haveBuyCnt;
|
| | | if (remainCnt >= 0)
|
| | | {
|
| | | return remainCnt;
|
| | | }
|
| | | else
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | }
|
| | | public int GetBuyPrice(StoreConfig model,int buyCnt)
|
| | | {
|
| | | if (model == null) return 0;
|
| | |
|
| | | int buyItemPrice = model.MoneyNumber * buyCnt;
|
| | | return buyItemPrice;
|
| | | }
|
| | | }
|
| | |
| | | int addBuyCnt = 0;
|
| | | bool isLimitCnt = buyItem.CheckIsLimitBuyCnt(buyItem.storeConfig,out canBuyCnt,out addBuyCnt);
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | if (itemTipsModel.curAttrData.itemConfig.PackCount > 1)
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | numberGo.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | if(isVipBuy)
|
| | | {
|
| | | if(nextVipIndex != -1)
|
| | |
| | | else
|
| | | {
|
| | | buyBtn.gameObject.SetActive(false);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, out isReachUpper);
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | |
|
| | | if (_price <= 0)
|
| | | {
|
| | | numberGo.gameObject.SetActive(false);
|
| | | moneyRect.gameObject.SetActive(false);
|
| | | buyBtnText.text = Language.Get("MailReceive");
|
| | | }
|
| | | else
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | | moneyRect.gameObject.SetActive(true);
|
| | | buyBtnText.text = Language.Get("ItemHandle_buy");
|
| | | }
|
| | |
|
| | | if (_price <= 0 || itemTipsModel.curAttrData.itemConfig.PackCount < 2)
|
| | | {
|
| | | numberGo.gameObject.SetActive(false);
|
| | | |
| | | }
|
| | | else
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | | |
| | | }
|
| | | }
|
| | | #region 点击事件
|
| | |
| | | numKeyboard.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | | private int GetRemainBuyCnt()
|
| | | {
|
| | | int haveBuyCnt = 0;
|
| | | if (shopItemLimit != null)
|
| | | {
|
| | | haveBuyCnt = shopItemLimit.BuyCnt;
|
| | | }
|
| | | int remainCnt = canBuyCnt - haveBuyCnt;
|
| | | if (remainCnt >= 0)
|
| | | {
|
| | | return remainCnt;
|
| | | }
|
| | | else
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnClickNum()
|
| | | {
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value),GetRemainBuyCnt(), isVipBuy,out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value), buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy),out isReachUpper);
|
| | | RefreshBuyPrice(buyCnt);
|
| | | numKeyboard.Value = buyCnt.ToString();
|
| | | if (isReachUpper)
|
| | |
| | | {
|
| | | buyCnt += 1;
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | | if (isReachUpper)
|
| | |
| | | {
|
| | | buyCnt -= 1;
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy,out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy),out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | | }
|
| | |
| | | int addBuyCnt = 0;
|
| | | bool isLimitCnt = buyItem.CheckIsLimitBuyCnt(buyItem.storeConfig, out canBuyCnt, out addBuyCnt);
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | if (itemAttrData.itemConfig.PackCount > 1)
|
| | | {
|
| | | _numberGo.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | _numberGo.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | if (isVipBuy)
|
| | | {
|
| | | if (nextVipIndex != -1)
|
| | |
| | | else
|
| | | {
|
| | | btnGroup.gameObject.SetActive(false);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, out isReachUpper);
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | |
|
| | | if (_price <= 0)
|
| | | {
|
| | | _numberGo.gameObject.SetActive(false);
|
| | | moneyRect.gameObject.SetActive(false);
|
| | | buyBtnText.text = Language.Get("MailReceive");
|
| | | }
|
| | | else
|
| | | {
|
| | | _numberGo.gameObject.SetActive(true);
|
| | | moneyRect.gameObject.SetActive(true);
|
| | | buyBtnText.text = Language.Get("ItemHandle_buy");
|
| | | }
|
| | |
|
| | | if (_price <= 0 || itemAttrData.itemConfig.PackCount < 2)
|
| | | {
|
| | | _numberGo.gameObject.SetActive(false);
|
| | | |
| | | }
|
| | | else
|
| | | {
|
| | | _numberGo.gameObject.SetActive(true);
|
| | | |
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | numKeyboard.gameObject.SetActive(true);
|
| | | }
|
| | | private int GetRemainBuyCnt()
|
| | | {
|
| | | int haveBuyCnt = 0;
|
| | | if (shopItemLimit != null)
|
| | | {
|
| | | haveBuyCnt = shopItemLimit.BuyCnt;
|
| | | }
|
| | | int remainCnt = canBuyCnt - haveBuyCnt;
|
| | | if (remainCnt >= 0)
|
| | | {
|
| | | return remainCnt;
|
| | | }
|
| | | else
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | }
|
| | | |
| | | private void OnClickNum()
|
| | | {
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value), GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value), buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | RefreshBuyPrice(buyCnt);
|
| | | numKeyboard.Value = buyCnt.ToString();
|
| | | if (isReachUpper)
|
| | |
| | | {
|
| | | buyCnt += 1;
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | | m_storeModel.SetBuyCnt(buyCnt);
|
| | |
| | | {
|
| | | buyCnt -= 1;
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | | m_storeModel.SetBuyCnt(buyCnt);
|
| | |
| | | int addBuyCnt = 0;
|
| | | bool isLimitCnt = buyItem.CheckIsLimitBuyCnt(buyItem.storeConfig, out canBuyCnt, out addBuyCnt);
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | if (itemAttrData.itemConfig.PackCount > 1)
|
| | | {
|
| | | _numberGo.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | _numberGo.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit,isVipBuy), out isReachUpper);
|
| | | if (isVipBuy)
|
| | | {
|
| | | if (nextVipIndex != -1)
|
| | |
| | | else
|
| | | {
|
| | | buyBtn.gameObject.SetActive(false);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, out isReachUpper);
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | |
|
| | | if (_price <= 0)
|
| | | {
|
| | | _numberGo.gameObject.SetActive(false);
|
| | | moneyRect.gameObject.SetActive(false);
|
| | | buyBtnText.text = Language.Get("MailReceive");
|
| | | }
|
| | | else
|
| | | {
|
| | | _numberGo.gameObject.SetActive(true);
|
| | | moneyRect.gameObject.SetActive(true);
|
| | | buyBtnText.text = Language.Get("ItemHandle_buy");
|
| | | }
|
| | |
|
| | | if (_price <= 0 || itemAttrData.itemConfig.PackCount < 2)
|
| | | {
|
| | | _numberGo.gameObject.SetActive(false);
|
| | | |
| | | }
|
| | | else
|
| | | {
|
| | | _numberGo.gameObject.SetActive(true);
|
| | | |
| | | }
|
| | | }
|
| | | #region 点击事件
|
| | |
| | | numKeyboard.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | | private int GetRemainBuyCnt()
|
| | | {
|
| | | int haveBuyCnt = 0;
|
| | | if (shopItemLimit != null)
|
| | | {
|
| | | haveBuyCnt = shopItemLimit.BuyCnt;
|
| | | }
|
| | | int remainCnt = canBuyCnt - haveBuyCnt;
|
| | | if (remainCnt >= 0)
|
| | | {
|
| | | return remainCnt;
|
| | | }
|
| | | else
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnClickNum()
|
| | | {
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value), GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value), buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | RefreshBuyPrice(buyCnt);
|
| | | numKeyboard.Value = buyCnt.ToString();
|
| | | if (isReachUpper)
|
| | |
| | | {
|
| | | buyCnt += 1;
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | | if (isReachUpper)
|
| | |
| | | {
|
| | | buyCnt -= 1;
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | |
|
| | |
| | | int addBuyCnt = 0;
|
| | | bool isLimitCnt = buyItem.CheckIsLimitBuyCnt(buyItem.storeConfig,out canBuyCnt,out addBuyCnt);
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | if (itemTipsModel.curAttrData.itemConfig.PackCount > 1)
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | numberGo.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | buyCnt = buyItem.GetCurBuyCnt(1,buyItem.GetRemainBuyCnt(canBuyCnt,shopItemLimit, isVipBuy), out isReachUpper);
|
| | | |
| | | buyBtn.gameObject.SetActive(true);
|
| | |
|
| | | if (isVipBuy)
|
| | |
| | | else
|
| | | {
|
| | | buyBtn.gameObject.SetActive(false);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, out isReachUpper);
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | | buyPriceText.text = UIHelper.GetTextColorByItemColor(TextColType.Green, _price.ToString());
|
| | | }
|
| | |
|
| | | if(_price <= 0)
|
| | | if (_price <= 0)
|
| | | {
|
| | | numberGo.gameObject.SetActive(false);
|
| | | moneyRect.gameObject.SetActive(false);
|
| | | buyBtnText.text = Language.Get("MailReceive");
|
| | | }
|
| | | else
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | | moneyRect.gameObject.SetActive(true);
|
| | | buyBtnText.text = Language.Get("ItemHandle_buy");
|
| | | moneyRect.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | | if (_price <= 0 || itemTipsModel.curAttrData.itemConfig.PackCount < 2)
|
| | | {
|
| | | numberGo.gameObject.SetActive(false);
|
| | | |
| | | }
|
| | | else
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | | |
| | | }
|
| | |
|
| | | }
|
| | | #region 点击事件
|
| | | private int GetRemainBuyCnt()
|
| | | {
|
| | | int haveBuyCnt = 0;
|
| | | if(shopItemLimit != null)
|
| | | {
|
| | | haveBuyCnt = shopItemLimit.BuyCnt;
|
| | | }
|
| | | int remainCnt = canBuyCnt - haveBuyCnt;
|
| | | if(remainCnt >= 0)
|
| | | {
|
| | | return remainCnt;
|
| | | }
|
| | | else
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | private void OnClickCountBtn()
|
| | | {
|
| | | numKeyboard.gameObject.SetActive(true);
|
| | |
| | | private void OnClickNum()
|
| | | {
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value), GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value),buyItem.GetRemainBuyCnt(canBuyCnt,shopItemLimit, isVipBuy), out isReachUpper);
|
| | | RefreshBuyPrice(buyCnt);
|
| | | numKeyboard.Value = buyCnt.ToString();
|
| | | if (isReachUpper)
|
| | |
| | | {
|
| | | bool isReachUpper = false;
|
| | | buyCnt += 1;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt,shopItemLimit, isVipBuy), out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | | if (isReachUpper || buyCnt == 0)
|
| | |
| | | {
|
| | | bool isReachUpper = false;
|
| | | buyCnt -= 1;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt,buyItem.GetRemainBuyCnt(canBuyCnt,shopItemLimit, isVipBuy), out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | | }
|
| | |
| | | int addBuyCnt = 0;
|
| | | bool isLimitCnt = buyItem.CheckIsLimitBuyCnt(buyItem.storeConfig,out canBuyCnt,out addBuyCnt);
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | if (itemTipsModel.curAttrData.itemConfig.PackCount > 1)
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | numberGo.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | buyBtn.gameObject.SetActive(true);
|
| | |
|
| | | if (isVipBuy)
|
| | |
| | | else
|
| | | {
|
| | | buyBtn.gameObject.SetActive(false);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, out isReachUpper);
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | |
|
| | | if (_price <= 0)
|
| | | {
|
| | | numberGo.gameObject.SetActive(false);
|
| | | moneyRect.gameObject.SetActive(false);
|
| | | buyBtnText.text = Language.Get("MailReceive");
|
| | | }
|
| | | else
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | | moneyRect.gameObject.SetActive(true);
|
| | | buyBtnText.text = Language.Get("ItemHandle_buy");
|
| | | moneyRect.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | | #region 点击事件
|
| | | private int GetRemainBuyCnt()
|
| | | {
|
| | | int haveBuyCnt = 0;
|
| | | if(shopItemLimit != null)
|
| | |
|
| | | if (_price <= 0 || itemTipsModel.curAttrData.itemConfig.PackCount < 2)
|
| | | {
|
| | | haveBuyCnt = shopItemLimit.BuyCnt;
|
| | | }
|
| | | int remainCnt = canBuyCnt - haveBuyCnt;
|
| | | if(remainCnt >= 0)
|
| | | {
|
| | | return remainCnt;
|
| | | numberGo.gameObject.SetActive(false);
|
| | | |
| | | }
|
| | | else
|
| | | {
|
| | | return 0;
|
| | | numberGo.gameObject.SetActive(true);
|
| | | |
| | | }
|
| | | }
|
| | |
|
| | | #region 点击事件
|
| | | |
| | | private void OnClickCountBtn()
|
| | | {
|
| | | numKeyboard.gameObject.SetActive(true);
|
| | |
| | | private void OnClickNum()
|
| | | {
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value),GetRemainBuyCnt(), isVipBuy,out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value), buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy),out isReachUpper);
|
| | | RefreshBuyPrice(buyCnt);
|
| | | numKeyboard.Value = buyCnt.ToString();
|
| | | if (isReachUpper)
|
| | |
| | | {
|
| | | buyCnt += 1;
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt,GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | | if (isReachUpper)
|
| | |
| | | {
|
| | | buyCnt -= 1;
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy,out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy),out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | | }
|
| | |
| | | int addBuyCnt = 0;
|
| | | bool isLimitCnt = buyItem.CheckIsLimitBuyCnt(buyItem.storeConfig, out canBuyCnt, out addBuyCnt);
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | if (itemAttrData.itemConfig.PackCount > 1)
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | numberGo.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | if (isVipBuy)
|
| | | {
|
| | | if (nextVipIndex != -1)
|
| | |
| | | else
|
| | | {
|
| | | buyBtn.gameObject.SetActive(false);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, out isReachUpper);
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | | {
|
| | | buyPriceText.text = UIHelper.GetTextColorByItemColor(TextColType.Green, _price.ToString());
|
| | | }
|
| | |
|
| | | |
| | | if (_price <= 0)
|
| | | {
|
| | | numberGo.gameObject.SetActive(false);
|
| | | moneyRect.gameObject.SetActive(false);
|
| | | buyBtnText.text = Language.Get("MailReceive");
|
| | | }
|
| | | else
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | | moneyRect.gameObject.SetActive(true);
|
| | | buyBtnText.text = Language.Get("ItemHandle_buy");
|
| | | }
|
| | |
|
| | | if(_price <= 0 || itemAttrData.itemConfig.PackCount < 2)
|
| | | {
|
| | | numberGo.gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | | |
| | | }
|
| | | }
|
| | | #region 点击事件
|
| | |
| | | numKeyboard.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | | private int GetRemainBuyCnt()
|
| | | {
|
| | | int haveBuyCnt = 0;
|
| | | if (shopItemLimit != null)
|
| | | {
|
| | | haveBuyCnt = shopItemLimit.BuyCnt;
|
| | | }
|
| | | int remainCnt = canBuyCnt - haveBuyCnt;
|
| | | if (remainCnt >= 0)
|
| | | {
|
| | | return remainCnt;
|
| | | }
|
| | | else
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnClickNum()
|
| | | {
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value), GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value), buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | RefreshBuyPrice(buyCnt);
|
| | | numKeyboard.Value = buyCnt.ToString();
|
| | | if (isReachUpper)
|
| | |
| | | {
|
| | | buyCnt += 1;
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | | if (isReachUpper)
|
| | |
| | | {
|
| | | buyCnt -= 1;
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | |
|
| | |
| | | [SerializeField] Text m_SyncPlayerCount;
|
| | |
|
| | | [SerializeField] Button m_SwitchAccountBtn;
|
| | | [SerializeField] Button m_SwitchServer;
|
| | | [SerializeField] Text m_SwitchAccountTitle;
|
| | | [SerializeField] Button m_LockScreenBtn;
|
| | | [SerializeField] Button m_ServiceBulletinsBtn;
|
| | |
| | | m_SyncPlayerSlider.AddListener(OnPlayerSyncCountChange);
|
| | |
|
| | | m_SwitchAccountBtn.AddListener(ClickSwitchAccountBtn);
|
| | | m_SwitchServer.SetListener(ClickSwitchServerButton);
|
| | | m_LockScreenBtn.AddListener(ClickLockScreen);
|
| | | m_CopyBtn.AddListener(ClickCopyBtn);
|
| | | m_AntiAddition.AddListener(AntiAdditction);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void ClickSwitchServerButton()
|
| | | {
|
| | | GameNetSystem.Instance.LoginOut();
|
| | | }
|
| | |
|
| | | private void ClickLockScreen()
|
| | | {
|
| | | if (!WindowJumpMgr.Instance.IsJumpState)
|
| | |
| | | case JumpUIType.CeremonyOutof:
|
| | | SetJumpLogic<FairylandCeremonyWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.DogzFunc1Type1:
|
| | | case JumpUIType.DogzFunc1Type2:
|
| | | SetJumpLogic<DogzWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.FaBaoSoul_BenYuan:
|
| | | case JumpUIType.FaBaoSoul_FengMo:
|
| | | case JumpUIType.FaBaoSoul_Strength:
|
| | |
| | | CeremonyFire = 245, //仙界盛典烟花狂欢界面
|
| | | CeremonyPeopleToHi = 246, //仙界盛典全民来嗨界面
|
| | | CeremonyOutof = 247, //仙界盛典绝版降临界面
|
| | | DogzFunc1Type1 = 248, //神兽界面
|
| | | DogzFunc1Type2 = 249, //神兽界面
|
| | | DhszTs = 1001,//定海神针功法提升界面
|
| | | HyqTs = 1002,//皓月枪功法提升界面
|
| | | GyzTs = 1003,//鬼牙刃功法提升界面
|
| | |
| | |
|
| | | public static UI3DModelExhibition Instance { get; private set; }
|
| | |
|
| | | static UI3DModelExhibition m_InstanceClone1 = null;
|
| | | public static UI3DModelExhibition InstanceClone1
|
| | | {
|
| | | get
|
| | | {
|
| | | if (m_InstanceClone1 == null)
|
| | | {
|
| | | CreateCloneStage();
|
| | | }
|
| | | return m_InstanceClone1;
|
| | | }
|
| | | }
|
| | |
|
| | | public static void CreateStage()
|
| | | {
|
| | | var prefab = Resources.Load<GameObject>("UI/Prefabs/UI3DModelExhibitionStage");
|
| | |
| | | DontDestroyOnLoad(gameObject);
|
| | | }
|
| | |
|
| | | static void CreateCloneStage()
|
| | | {
|
| | | var prefab = Resources.Load<GameObject>("UI/Prefabs/UI3DModelExhibitionStage");
|
| | | var gameObject = GameObject.Instantiate(prefab);
|
| | | m_InstanceClone1 = gameObject.GetComponent<UI3DModelExhibition>();
|
| | | m_InstanceClone1.transform.position = new Vector3(2000, 4000, 5000);
|
| | | m_InstanceClone1.name = "UI3DModelExhibitionStage(clone1)";
|
| | | m_InstanceClone1.gameObject.SetActive(true);
|
| | | m_InstanceClone1.m_ShowCamera.enabled = false;
|
| | | DontDestroyOnLoad(gameObject);
|
| | | }
|
| | |
|
| | | public void ShowLoginPlayer(RawImage _rawImage, int _job)
|
| | | {
|
| | | var clothesItemId = 0;
|