Merge branch 'master' into 3687天赋功能
| | |
| | | Register(typeof(HA3C0_tagMCDogzInfo), typeof(DTCA3C0_tagMCDogzInfo));
|
| | | Register(typeof(HA3C1_tagMCDogzHelpbattleState), typeof(DTCA3C1_tagMCDogzHelpbattleState));
|
| | | #endregion
|
| | |
|
| | | Register(typeof(HA324_tagMCBindJadeWheelResult),typeof(DTCA324_tagMCBindJadeWheelResult));
|
| | | }
|
| | |
|
| | | private static void Register(Type _pack, Type _business)
|
| | |
| | | { |
| | | guideAchievementId = _achievementId; |
| | | } |
| | | }
|
| | |
|
| | | public static void Goto3129(int _achievementId, SuccessConfig config) |
| | | { |
| | | if (config == null) return; |
| | | |
| | | guideAchievementId = _achievementId; |
| | | var dogzModel = ModelCenter.Instance.GetModel<DogzModel>(); |
| | | int dogzId = 0; |
| | | if(config.Condition != null && config.Condition.Length > 0)
|
| | | {
|
| | | dogzId = config.Condition[0];
|
| | | } |
| | | dogzModel.SetSelectDogz(dogzId); |
| | | } |
| | | } |
| | | |
| | |
| | | case 125:
|
| | | AchievementGoto.GotoIceCrystal(_achievementId);
|
| | | break;
|
| | | case 129:
|
| | | AchievementGoto.Goto3129(_achievementId, config);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| New file |
| | |
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class PrayForDrugVipLackWin : Window
|
| | | {
|
| | | [SerializeField] Button m_ViewVip;
|
| | | [SerializeField] Button m_Close;
|
| | | [SerializeField] Text vipLvText;
|
| | | [SerializeField] Text contenetText;
|
| | | #region Built-in
|
| | | public static int vipLv = 0;
|
| | | public static string content;
|
| | | |
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_ViewVip.AddListener(ViewVip);
|
| | | m_Close.AddListener(CloseClick);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | Display();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | private void Display()
|
| | | {
|
| | | vipLvText.text = vipLv.ToString();
|
| | | contenetText.text = content;
|
| | | }
|
| | |
|
| | | private void ViewVip()
|
| | | {
|
| | | if (VersionConfig.Get().isBanShu)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("FuncNoOpen_VIP");
|
| | | return;
|
| | | }
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.VipRechargeFunc2);
|
| | | }
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 55268f4e1c8090748bdbe67d2162fc31 |
| | | timeCreated: 1539156973 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | {
|
| | | SetPrayDrugCondi();
|
| | | SetPrayDrugDict();
|
| | | SetPrayVipLimit();
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | |
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= UpdateFuncState;
|
| | | blastModel.RefreshStoveModelEvent -= UpdateBlastLv;
|
| | | playerPack.RefreshItemSumUseCntAct -= RefreshItemUsce;
|
| | | |
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= UpdateVipLV;
|
| | |
|
| | | }
|
| | |
|
| | | public void OnAfterPlayerDataInitialize()
|
| | |
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += UpdateVipLV;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += UpdateFuncState;
|
| | | blastModel.RefreshStoveModelEvent += UpdateBlastLv;
|
| | | playerPack.RefreshItemSumUseCntAct += RefreshItemUsce;
|
| | | SetPrayPrivilegeByVipLv();
|
| | | prayDrugRecordKey = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "PrayDrugRecord");
|
| | | SetIsNewDay();
|
| | | UpdatePrayDanRedpoint();
|
| | | }
|
| | |
|
| | | private void UpdateVipLV(PlayerDataRefresh type)
|
| | | {
|
| | | if (type != PlayerDataRefresh.VIPLv) return;
|
| | |
|
| | | SetPrayPrivilegeByVipLv();
|
| | | UpdatePrayDanRedpoint();
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | #region 读取本地配置
|
| | | public int costMoney { get; private set; }
|
| | | public int everyDayNum { get; private set; }
|
| | | public int costMoney { get; private set; } |
| | | public int prayPushLv { get; private set;}
|
| | |
|
| | | private void SetPrayDrugCondi()
|
| | | {
|
| | | FuncConfigConfig func = Config.Instance.Get<FuncConfigConfig>("GodAlchemy");
|
| | | costMoney = int.Parse(func.Numerical2);
|
| | | everyDayNum = int.Parse(func.Numerical3);
|
| | | func = Config.Instance.Get<FuncConfigConfig>("GodAlchemyShow");
|
| | | prayPushLv = int.Parse(func.Numerical2);
|
| | | }
|
| | |
| | | if (day != TimeUtility.ServerNow.Day)
|
| | | {
|
| | | IsNewDay = true;
|
| | | LocalSave.SetInt(prayDrugRecordKey, TimeUtility.ServerNow.Day);
|
| | | if (CheckIsPray())
|
| | | {
|
| | | LocalSave.SetInt(prayDrugRecordKey, TimeUtility.ServerNow.Day);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | else
|
| | | {
|
| | | IsNewDay = true;
|
| | | LocalSave.SetInt(prayDrugRecordKey, TimeUtility.ServerNow.Day);
|
| | | if(CheckIsPray())
|
| | | {
|
| | | LocalSave.SetInt(prayDrugRecordKey, TimeUtility.ServerNow.Day);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public int everyDayNum { get; private set; }
|
| | | public int minVipLvLimit { get; private set; }
|
| | | public void SetPrayPrivilegeByVipLv()
|
| | | {
|
| | | int vipLv = PlayerDatas.Instance.baseData.VIPLv;
|
| | | everyDayNum = VipPrivilegeConfig.GetVipPrivilegeData(VipPrivilegeType.PrayForDrug,vipLv);
|
| | | }
|
| | |
|
| | | public void SetPrayVipLimit()
|
| | | {
|
| | | for (int i = 0; i < 16; i++)
|
| | | {
|
| | | int prayNum = VipPrivilegeConfig.GetVipPrivilegeData(VipPrivilegeType.PrayForDrug, i);
|
| | | if(prayNum != 0)
|
| | | {
|
| | | minVipLvLimit = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public bool CheckIsPrayByVip()
|
| | | {
|
| | | return PlayerDatas.Instance.baseData.VIPLv >= minVipLvLimit ? true : false;
|
| | | }
|
| | | #endregion
|
| | |
|
| | |
| | | }
|
| | |
|
| | | #region 红点
|
| | |
|
| | | public bool CheckIsPray()
|
| | | {
|
| | | if (blastModel.StoveLV < prayPushLv
|
| | | || alreadyPrayNum >= everyDayNum
|
| | | || GetPrayDruglist().Count < 1)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
|
| | | return true;
|
| | | }
|
| | |
|
| | | public const int PRAYDRUGREDPOINT_KEY = 110011001;
|
| | | private Redpoint prayRedpoint = new Redpoint(BlastFurnaceModel.LINGDANREDPOINT_KEY, PRAYDRUGREDPOINT_KEY);
|
| | | public void UpdatePrayDanRedpoint()
|
| | | {
|
| | | if (blastModel.StoveLV < prayPushLv
|
| | | || alreadyPrayNum >= everyDayNum
|
| | | || GetPrayDruglist().Count < 1
|
| | | || !IsNewDay)
|
| | | if ( !CheckIsPray() || !IsNewDay)
|
| | | {
|
| | | prayRedpoint.state = RedPointState.None;
|
| | | return;
|
| | |
| | |
|
| | | public void ClearPrayRedpoint()
|
| | | {
|
| | | prayRedpoint.state = RedPointState.None;
|
| | | IsNewDay = false;
|
| | | if(prayRedpoint.state != RedPointState.None)
|
| | | {
|
| | | prayRedpoint.state = RedPointState.None;
|
| | | LocalSave.SetInt(prayDrugRecordKey, TimeUtility.ServerNow.Day);
|
| | | IsNewDay = false;
|
| | | }
|
| | | }
|
| | | #endregion
|
| | | }
|
| | |
| | | [SerializeField] ScrollerController ctrl;
|
| | | [SerializeField] Button prayBtn;
|
| | | [SerializeField] Image prayBtnImg;
|
| | | [SerializeField] GameObject vipPray;
|
| | | [SerializeField] Text prayVipLimit;
|
| | | [SerializeField] GameObject unVipPray;
|
| | | [SerializeField] GameObject vipLimitText;
|
| | | [SerializeField] GameObject prayMoneyGo;
|
| | |
|
| | | [SerializeField] Text costText;
|
| | | [SerializeField] Button closeBtn;
|
| | | [Header("最大格子数")]
|
| | |
| | | private void UpdatePrayBtn()
|
| | | {
|
| | | prayBtn.RemoveAllListeners();
|
| | | if (PrayModel.alreadyPrayNum >= PrayModel.everyDayNum)
|
| | | if(PrayModel.CheckIsPrayByVip())
|
| | | {
|
| | | prayBtnImg.material = MaterialUtility.GetDefaultSpriteGrayMaterial();
|
| | | vipLimitText.SetActive(false);
|
| | | vipPray.SetActive(false);
|
| | | unVipPray.SetActive(true);
|
| | | if (PrayModel.alreadyPrayNum >= PrayModel.everyDayNum)
|
| | | {
|
| | | prayBtnImg.material = MaterialUtility.GetDefaultSpriteGrayMaterial();
|
| | | }
|
| | | else
|
| | | {
|
| | | prayBtn.AddListener(ClickPrayBtn);
|
| | | prayBtnImg.material = MaterialUtility.GetUIDefaultGraphicMaterial();
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | prayBtn.AddListener(ClickPrayBtn);
|
| | | prayBtnImg.material = MaterialUtility.GetUIDefaultGraphicMaterial();
|
| | | prayBtnImg.material = MaterialUtility.GetDefaultSpriteGrayMaterial();
|
| | | vipPray.SetActive(true);
|
| | | unVipPray.SetActive(false);
|
| | | vipLimitText.SetActive(true);
|
| | | prayVipLimit.text = StringUtility.Contact("V",PrayModel.minVipLvLimit);
|
| | | prayBtn.AddListener(()=>
|
| | | {
|
| | | PrayForDrugVipLackWin.vipLv = PrayModel.minVipLvLimit;
|
| | | PrayForDrugVipLackWin.content = Language.Get("BlessingHint", PrayModel.costMoney);
|
| | | WindowCenter.Instance.Open<PrayForDrugVipLackWin>();
|
| | | });
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | private void ClickPrayBtn()
|
| | |
| | | for (int i = 0; i < hourMinutes.Count; i++)
|
| | | {
|
| | | var hourMinute = hourMinutes[i];
|
| | | if (hour <= hourMinute.hourEnd && minute <= hourMinute.minuteEnd)
|
| | | if (hour < hourMinute.hourEnd || (hour == hourMinute.hourEnd && minute <= hourMinute.minuteEnd))
|
| | | {
|
| | | _hourMinute = hourMinute;
|
| | | break;
|
| | |
| | | for (int i = 0; i < hourMinutes.Count; i++)
|
| | | {
|
| | | var hourMinute = hourMinutes[i];
|
| | | if (hour <= hourMinute.hourEnd && minute <= hourMinute.minuteEnd)
|
| | | if (hour < hourMinute.hourEnd || (hour == hourMinute.hourEnd && minute <= hourMinute.minuteEnd))
|
| | | {
|
| | | _hourMinute = hourMinute;
|
| | | break;
|
| | |
| | | var openDayWeek = (int)TimeUtility.openServerDayOfWeek;
|
| | | var dayIndex = TimeUtility.OpenDay + 1;
|
| | | var maxDays = 15 - openDayWeek == 0 ? 7 : openDayWeek;
|
| | | for (int i = dayIndex; i <= maxDays; i++)
|
| | | var startDay = dayIndex;
|
| | | var createRoleTime = TimeUtility.createRoleTime;
|
| | | if (dayIndex == 1 && specialOpenTimes.ContainsKey(openDayWeek) && specialOpenTimes[openDayWeek].ContainsKey(dayIndex))
|
| | | {
|
| | | var openServerDay = TimeUtility.ServerNow.AddTicks(-TimeUtility.OpenDay * TimeSpan.TicksPerDay);
|
| | | if (createRoleTime.Year == openServerDay.Year && createRoleTime.Month == openServerDay.Month
|
| | | && createRoleTime.Day == openServerDay.Day)
|
| | | {
|
| | | var hourMinutes = specialOpenTimes[openDayWeek][1];
|
| | | var hourMinute = hourMinutes[hourMinutes.Count - 1];
|
| | | var hour = createRoleTime.Hour;
|
| | | var minute = createRoleTime.Minute;
|
| | | if (hour > hourMinute.hourEnd ||
|
| | | (hour == hourMinute.hourEnd && minute >= hourMinute.minuteEnd))
|
| | | {
|
| | | startDay++;
|
| | | }
|
| | | }
|
| | | }
|
| | | for (int i = startDay; i <= maxDays; i++)
|
| | | {
|
| | | if (specialOpenTimes.ContainsKey(openDayWeek) && specialOpenTimes[openDayWeek].ContainsKey(dayIndex))
|
| | | {
|
| | |
| | | var openDayWeek = (int)TimeUtility.openServerDayOfWeek;
|
| | | var dayIndex = TimeUtility.OpenDay + 1;
|
| | | var maxDays = 15 - openDayWeek == 0 ? 7 : openDayWeek;
|
| | | for (int i = 1; i <= maxDays; i++)
|
| | | var startDay = 1;
|
| | | var createRoleTime = TimeUtility.createRoleTime;
|
| | | if (specialOpenTimes.ContainsKey(openDayWeek) && specialOpenTimes[openDayWeek].ContainsKey(1))
|
| | | {
|
| | | var openServerDay = TimeUtility.ServerNow.AddTicks(-TimeUtility.OpenDay * TimeSpan.TicksPerDay);
|
| | | if (createRoleTime.Year == openServerDay.Year && createRoleTime.Month == openServerDay.Month
|
| | | && createRoleTime.Day == openServerDay.Day)
|
| | | {
|
| | | var hourMinutes = specialOpenTimes[openDayWeek][1];
|
| | | var hourMinute = hourMinutes[hourMinutes.Count - 1];
|
| | | var hour = createRoleTime.Hour;
|
| | | var minute = createRoleTime.Minute;
|
| | | if (hour > hourMinute.hourEnd ||
|
| | | (hour == hourMinute.hourEnd && minute >= hourMinute.minuteEnd))
|
| | | {
|
| | | startDay = 2;
|
| | | }
|
| | | }
|
| | | }
|
| | | for (int i = startDay; i <= maxDays; i++)
|
| | | {
|
| | | if (specialOpenTimes.ContainsKey(openDayWeek) && specialOpenTimes[openDayWeek].ContainsKey(dayIndex))
|
| | | {
|
| | |
| | | SysNotifyMgr.Instance.sysNotifyEvent += SystemNotifyEvent;
|
| | | GlobalTimeEvent.Instance.secondEvent += SecondEvent;
|
| | | TimeMgr.Instance.OnMinuteEvent += MinuteEvent;
|
| | | TimeUtility.OnServerOpenDayRefresh += OnServerOpenDayRefresh;
|
| | | OpenServerActivityCenter.Instance.Register(13, this);
|
| | | }
|
| | |
|
| | |
| | | SysNotifyMgr.Instance.sysNotifyEvent -= SystemNotifyEvent;
|
| | | GlobalTimeEvent.Instance.secondEvent -= SecondEvent;
|
| | | TimeMgr.Instance.OnMinuteEvent -= MinuteEvent;
|
| | | TimeUtility.OnServerOpenDayRefresh -= OnServerOpenDayRefresh;
|
| | | }
|
| | |
|
| | | private void OnServerOpenDayRefresh()
|
| | | {
|
| | | if (cacheNoticeOpen != IsOpen)
|
| | | {
|
| | | cacheNoticeOpen = !cacheNoticeOpen;
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate((int)OpenServerActivityCenter.OSActivityType.FairyGrabBossNotice);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void MinuteEvent()
|
| | |
| | | CA607_tagCMFamilyTechLVUP tag_CA607 = new CA607_tagCMFamilyTechLVUP();
|
| | | tag_CA607.TechID = (uint)indexID;
|
| | | GameNetSystem.Instance.SendInfo(tag_CA607);
|
| | | DebugEx.LogError("输出心法科技需要提升的技能IndexID"+ indexID);
|
| | | // DebugEx.LogError("输出心法科技需要提升的技能IndexID"+ indexID);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyMine -= OnRefreshFairyMine;
|
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyInfo += OnRefreshFairyInfo;//加入仙盟
|
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyMine += OnRefreshFairyMine;//退出仙盟
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= Updatefighting;//数据的刷新(h0418)
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += Updatefighting;//数据的刷新(h0418)
|
| | | FairyAuMethodDic();
|
| | | FairyAuMethodRedPoint();
|
| | | }
|
| | |
|
| | | private void Updatefighting(PlayerDataRefresh obj)
|
| | | {
|
| | | if (obj == PlayerDataRefresh.LV)
|
| | | {
|
| | | FairyAuMethodDic();
|
| | | FairyAuMethodRedPoint();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnRefreshFairyInfo()//加入仙盟
|
| | | {
|
| | | FairyAuHallRedPoint();
|
| | |
| | | equipAttrActiveDict.TryGetValue(type,out cnt);
|
| | | return cnt;
|
| | | }
|
| | |
|
| | | public List<int> GetAddAttrIdByStars(out int starsCount)
|
| | | {
|
| | | starsCount = 0;
|
| | | List<int> activeIdlist = new List<int>();
|
| | | List<int> addIdlist = new List<int>();
|
| | | int activeStars = GetActiveCntByType(1);
|
| | | RoleEquipStarsConfig activeStarsConfig = RoleEquipStarsConfig.GetEquipStarsModel(activeStars);
|
| | | if(activeStarsConfig != null)
|
| | | {
|
| | | for(int i = 0; i < activeStarsConfig.attType.Length; i++)
|
| | | {
|
| | | activeIdlist.Add(activeStarsConfig.attType[i]);
|
| | | }
|
| | | }
|
| | | List<RoleEquipStarsConfig> starsConfigs = Config.Instance.GetAllValues<RoleEquipStarsConfig>();
|
| | | for (int i = 0; i < starsConfigs.Count; i++)
|
| | | {
|
| | | bool isAddId = false;
|
| | | RoleEquipStarsConfig starsConfig = starsConfigs[i];
|
| | | if (activeStars < starsConfig.countNeed)
|
| | | {
|
| | | for(int j = 0; j < starsConfig.attType.Length; j++)
|
| | | {
|
| | | int attrId = starsConfig.attType[j];
|
| | | if (!activeIdlist.Contains(attrId))
|
| | | {
|
| | | isAddId = true;
|
| | | addIdlist.Add(attrId);
|
| | | }
|
| | | }
|
| | | }
|
| | | if(isAddId)
|
| | | {
|
| | | starsCount = starsConfig.countNeed;
|
| | | break;
|
| | | }
|
| | | |
| | | }
|
| | | return addIdlist;
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #endregion
|
| | |
| | | [SerializeField] Button activityBtn;
|
| | | [SerializeField] Text activeBtnText;
|
| | | [SerializeField] UIEffect successEffect;
|
| | | [SerializeField] Text addAttrText;
|
| | |
|
| | | private int _curStarsCount;
|
| | | private PlayerPropertyConfig _playerProModel;
|
| | |
| | | nextNoActObj.SetActive(true);
|
| | | RefreshActiveBtnUI(false);
|
| | | }
|
| | |
|
| | | int addAttrStarsNum = 0;
|
| | | List<int> addIdlist = playerPack.GetAddAttrIdByStars(out addAttrStarsNum);
|
| | | if(addIdlist.Count > 0)
|
| | | {
|
| | | addAttrText.gameObject.SetActive(true);
|
| | | string addAttr = "";
|
| | | for(int i = 0; i < addIdlist.Count; i++)
|
| | | {
|
| | | PlayerPropertyConfig propertyConfig = Config.Instance.Get<PlayerPropertyConfig>(addIdlist[i]);
|
| | | if(propertyConfig != null)
|
| | | {
|
| | | addAttr = StringUtility.Contact(addAttr, propertyConfig.Name);
|
| | | }
|
| | | }
|
| | | addAttrText.text = Language.Get("KnapS148",addAttrStarsNum,addAttr);
|
| | | }
|
| | | else
|
| | | {
|
| | | addAttrText.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | private void RefreshActiveBtnUI(bool isActive)
|
| | |
| | | }else if(SDKUtility.Instance.ChannelPlatform == SDKUtility.E_ChannelPlatform.Js)
|
| | | {
|
| | | send.IDType = 4;
|
| | | send.Extra += ("|" + sdkLoginResult.token);
|
| | | send.ExtraLen = (byte)send.Extra.Length;
|
| | | }
|
| | | send.AccID = sdkLoginResult.account;
|
| | | send.Password = sdkLoginResult.token;
|
| | |
| | | public class UpgradeWin : Window |
| | | {
|
| | | [SerializeField] ScaleTween m_ScaleTween; |
| | | [SerializeField] UIAlphaTween m_UIAlphaTween; |
| | | [SerializeField] Text m_TextLV; |
| | | [SerializeField] UIEffect m_UIEffect; |
| | | public float Delay = 0.5f; |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | |
| | | |
| | | protected override void OnPreOpen() |
| | | {
|
| | | m_UIAlphaTween.SetStartState();
|
| | | m_TextLV.text = PlayerDatas.Instance.baseData.LV.ToString();
|
| | | } |
| | | protected override void OnActived()
|
| | | {
|
| | | m_UIEffect.Play();
|
| | | m_UIEffect.OnComplete = () => { CloseImmediately(); };
|
| | | m_ScaleTween.Play();
|
| | | m_UIEffect.OnComplete = () =>
|
| | | {
|
| | | StopCoroutine(DelayIEnumerator());
|
| | | Close();
|
| | | };
|
| | | m_ScaleTween.Play(false, () => { StartCoroutine(DelayIEnumerator()); });
|
| | | } |
| | | protected override void OnAfterOpen() |
| | | {
|
| | |
| | | protected override void OnAfterClose() |
| | | { |
| | | }
|
| | |
|
| | | IEnumerator DelayIEnumerator()
|
| | | {
|
| | | yield return new WaitForSeconds(Delay);
|
| | | m_UIAlphaTween.Play();
|
| | | }
|
| | | #endregion
|
| | | private void windowBeforeClose(Window _window)
|
| | | {
|
| | | if (_window is MainInterfaceWin)
|
| | | {
|
| | | StopCoroutine(DelayIEnumerator());
|
| | | Close();
|
| | | }
|
| | | }
|
| | |
| | | private void OnRankListClick(CellView cell)
|
| | | {
|
| | | int index = cell.index;
|
| | | if (model.rankList == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (index < model.rankList.Count)
|
| | | {
|
| | | if (model.rankList[index].ID == PlayerDatas.Instance.baseData.PlayerID)
|
| | |
| | | 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);
|
| | |
|
| | |
| | |
|
| | |
|
| | | ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptEquip, (int)RoleEquipType.retWing);
|
| | | if (itemModel == null)
|
| | | var WingItem = Config.Instance.Get<WingRefineExpConfig>(itemModel.itemId);
|
| | | if (itemModel == null || WingItem == null)
|
| | | return;
|
| | |
|
| | | int YRefiningRatioMin = 0;//预览生命比值
|
| | |
| | | [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)
|
| | |
| | | private Dictionary<TreasureCategory, List<TreasureComponent>> m_Treasures = new Dictionary<TreasureCategory, List<TreasureComponent>>();
|
| | | private Dictionary<TreasureCategory, bool> m_PreloadDict = new Dictionary<TreasureCategory, bool>();
|
| | |
|
| | | Coroutine preloadCoroutine = null;
|
| | | private void InitTreasure()
|
| | | {
|
| | | Load(TreasureCategory.Human);
|
| | |
| | | HideAllTreasure();
|
| | | InitScene();
|
| | |
|
| | | if (preloadCoroutine != null)
|
| | | {
|
| | | StopCoroutine(preloadCoroutine);
|
| | | preloadCoroutine = null;
|
| | | }
|
| | |
|
| | | if (!m_PreloadDict.ContainsKey(currentCategory) && !_closer)
|
| | | {
|
| | | Preloading = true;
|
| | |
| | | current_angle = 0;
|
| | | before_angle = 0;
|
| | | before_drag_angle = current_angle;
|
| | | StartCoroutine(Co_PreLoad(currentCategory, () =>
|
| | | {
|
| | | if (!m_PreloadDict.ContainsKey(currentCategory))
|
| | | {
|
| | | m_PreloadDict.Add(currentCategory, true);
|
| | | }
|
| | | GoTreasureFromHeader(_index);
|
| | | Preloading = false;
|
| | | }));
|
| | | preloadCoroutine = StartCoroutine(Co_PreLoad(currentCategory, () =>
|
| | | {
|
| | | if (!m_PreloadDict.ContainsKey(currentCategory))
|
| | | {
|
| | | m_PreloadDict.Add(currentCategory, true);
|
| | | }
|
| | | GoTreasureFromHeader(_index);
|
| | | Preloading = false;
|
| | | preloadCoroutine = null;
|
| | | }));
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | public void Goto(int _index, bool _force = false)
|
| | | {
|
| | | var _list = m_Treasures[currentCategory];
|
| | | if (_index < 0 || _index >= _list.Count)
|
| | | {
|
| | | _index = 0;
|
| | | }
|
| | | jumpTreasure = _list[_index].treasureId;
|
| | | if (!_force && _index == presentSelectIndex)
|
| | | {
|
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | |
| | | using System;
|
| | |
|
| | | namespace Snxxz.UI { |
| | | |
| | | public class CheckDisplay:MonoBehaviour {
|
| | | public static event Action EndOfFlashing;
|
| | | [SerializeField] Image m_Image1;
|
| | | [SerializeField] Image m_Image2;
|
| | | [SerializeField] Image m_Image3;
|
| | |
| | | [SerializeField] Image m_Image6;
|
| | | [SerializeField] Image m_Image7;
|
| | | [SerializeField] Image m_Image8;
|
| | | [SerializeField] Image m_Image9; |
| | | |
| | | [SerializeField] Image m_Image9;
|
| | | [Header("闪烁时间")]
|
| | | public float FlashingTime = 2f; |
| | | private float _time=0; |
| | | bool IsBool = false; |
| | | private void OnEnable()
|
| | | {
|
| | | IsBool = false;
|
| | | _time = 0;
|
| | | } |
| | | private void LateUpdate()
|
| | | {
|
| | | if (IsBool)
|
| | | {
|
| | | _time += Time.deltaTime;
|
| | | if (FlashingTime < _time)
|
| | | {
|
| | | CloseAll();
|
| | | if (EndOfFlashing != null)
|
| | | {
|
| | | EndOfFlashing();
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | } |
| | | public void CloseAll()
|
| | | {
|
| | | m_Image1.gameObject.SetActive(false);
|
| | |
| | | m_Image7.gameObject.SetActive(false);
|
| | | m_Image8.gameObject.SetActive(false);
|
| | | m_Image9.gameObject.SetActive(false);
|
| | | IsBool = false;
|
| | | _time = 0;
|
| | | } |
| | | |
| | | public void ShowSelected(int Index)
|
| | |
| | | case 9:
|
| | | m_Image9.gameObject.SetActive(true);
|
| | | break;
|
| | |
|
| | | }
|
| | |
|
| | | IsBool = true;
|
| | | } |
| | | } |
| | | |
| | |
| | | using DG.Tweening; |
| | | using System;
|
| | |
|
| | | namespace Snxxz.UI { |
| | | |
| | | public class RotatePointer:MonoBehaviour {
|
| | | namespace Snxxz.UI
|
| | | { |
| | | public class RotatePointer : MonoBehaviour
|
| | | {
|
| | | public bool _isRotate = false;//是否旋转
|
| | | public float Speed = 2000;//旋转速度
|
| | | public float Angle = 0; // 这个是设置停止的角度
|
| | |
| | | [Header("加速减速时间")]
|
| | | public float SpeedTime = 1;
|
| | | [Header("最小速度")]
|
| | | public float MinSpeed= 400;
|
| | | public float MinSpeed = 400;
|
| | | [Header("最大速度")]
|
| | | public float MaxSpeed = 800;
|
| | | WheelOfFortuneModel wheelOfFortuneModel { get { return ModelCenter.Instance.GetModel<WheelOfFortuneModel>(); } }
|
| | |
| | | public void Init()
|
| | | {
|
| | | IsRotateBool = false;
|
| | | _time = 0;
|
| | | transform.localRotation = Quaternion.Euler(0, 0, -wheelOfFortuneModel.AngleSave);
|
| | | _time = 0; |
| | | Angle = wheelOfFortuneModel.AngleSave;
|
| | | transform.localRotation = Quaternion.Euler(0, 0, -Angle); |
| | | Acceleration = (MaxSpeed - MinSpeed) / SpeedTime;
|
| | | m_CheckDisplay.CloseAll();
|
| | | }
|
| | | private void OnEnable()
|
| | | {
|
| | | |
| | | }
|
| | |
|
| | | |
| | | }
|
| | | void Update()
|
| | | {
|
| | |
|
| | | if (!_isRotate)
|
| | | {
|
| | | if (-Angle != transform.localRotation.z)
|
| | | { |
| | | if (Math.Abs((360 - Angle) - transform.eulerAngles.z) > 2) |
| | | {
|
| | | transform.localRotation = Quaternion.Euler(0, 0, -Angle);
|
| | | m_CheckDisplay.ShowSelected(wheelOfFortuneModel.Lattice);
|
| | |
| | | IsButtonShow(true);
|
| | | }
|
| | | IsRotateBool = false;
|
| | | } |
| | | }
|
| | | return; //不旋转结束
|
| | | }
|
| | | |
| | |
|
| | | if (IsRotateBool)
|
| | | {
|
| | |
|
| | | _time += Time.deltaTime;
|
| | |
|
| | | if (_time < SpeedTime)//匀加速
|
| | | {
|
| | | Speed = MinSpeed + Acceleration * _time;
|
| | |
| | | //这里有个360,使用来防止指针回转的,如果不加这个360,你会看到指针倒退
|
| | | Sequence sequence = DOTween.Sequence();
|
| | | sequence.Append(transform.DORotate(new Vector3(0, 0, -(360 + Angle)), 2f, RotateMode.FastBeyond360));
|
| | | sequence.AppendCallback(()=> |
| | | sequence.AppendCallback(() =>
|
| | | {
|
| | | _isRotate = false; // 设置不旋转
|
| | | if (IsButtonShow != null)
|
| | |
| | | IsButtonShow(true);
|
| | | }
|
| | | m_CheckDisplay.ShowSelected(wheelOfFortuneModel.Lattice);
|
| | | }); |
| | | });
|
| | | IsRotateBool = false;
|
| | | }
|
| | | } |
| | | }
|
| | | }
|
| | |
|
| | | //外部调用,初始化时间和打开旋转
|
| | | //外部调用,初始化时间和打开旋转,设置停止角度
|
| | | public void SetTime(bool _bool)
|
| | | {
|
| | | _time =0;
|
| | | _time = 0; |
| | | Angle = wheelOfFortuneModel.AngleSave; |
| | | if (_bool)
|
| | | {
|
| | | IsRotateBool = false;
|
| | |
| | | IsRotateBool = true;
|
| | | _isRotate = true;
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | private void TweenOver()
|
| | | {
|
| | |
|
| | | }
|
| | | //外部调用,设置停止角度 |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Thursday, September 27, 2018 |
| | | //-------------------------------------------------------- |
| | |
|
| | | using LitJson;
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | |
| | | using LitJson; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using TableConfig; |
| | | using UnityEngine;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | using UnityEngine; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class WheelOfFortuneModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | public class AngleClass
|
| | | {
|
| | | public float AngleStart;
|
| | | public float AngleEnd;
|
| | | }
|
| | |
|
| | | public int Lattice = -1;//格子
|
| | | public int Number = 0;//次数
|
| | | public int NeedJade = 0;//需要仙玉
|
| | | public float AngleSave = 0f;//角度记录
|
| | | public Dictionary<int, AngleClass> AngleDic = new Dictionary<int, AngleClass>();
|
| | | private int[][] AngleList;
|
| | | public event Action<float> WheelOfFortuneUpdate;
|
| | |
|
| | | private string StrKey = string.Empty;
|
| | | private bool IsOk = false;
|
| | |
|
| | | private const int Redpoint_key1 = 66666;//幸运转盘红点
|
| | | public Redpoint redPointStre1 = new Redpoint(6666, Redpoint_key1);
|
| | | VipModel m_Vipmodel;
|
| | | VipModel vipmodel { get { return m_Vipmodel ?? (m_Vipmodel = ModelCenter.Instance.GetModel<VipModel>()); } }
|
| | | public override void Init()
|
| | | {
|
| | | var BindJadewheel = Config.Instance.Get<FuncConfigConfig>("BindJadeWheelCfg");
|
| | | NeedJade = int.Parse(BindJadewheel.Numerical1);
|
| | | AngleList = JsonMapper.ToObject<int[][]>(BindJadewheel.Numerical5);
|
| | | for (int i = 0; i < AngleList.Length; i++)
|
| | | public class WheelOfFortuneModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk |
| | | { |
| | | public class AngleClass |
| | | { |
| | | public float AngleStart; |
| | | public float AngleEnd; |
| | | } |
| | | |
| | | public int Lattice = -1;//格子 |
| | | public int Number = 0;//次数(当日已转次数) |
| | | public int NeedJade = 0;//需要仙玉 |
| | | public float AngleSave = 0f;//角度记录 |
| | | public Dictionary<int, AngleClass> AngleDic = new Dictionary<int, AngleClass>(); |
| | | private double[][] AngleList; |
| | | public event Action<float> WheelOfFortuneUpdate; |
| | | |
| | | private string StrKey = string.Empty; |
| | | private bool IsOk = false; |
| | | private const int Redpoint_key1 = 20106;//幸运转盘红点 |
| | | public Redpoint redPointStre1 = new Redpoint(201, Redpoint_key1); |
| | | VipModel m_Vipmodel; |
| | | VipModel vipmodel { get { return m_Vipmodel ?? (m_Vipmodel = ModelCenter.Instance.GetModel<VipModel>()); } } |
| | | public override void Init() |
| | | { |
| | | var BindJadewheel = Config.Instance.Get<FuncConfigConfig>("BindJadeWheelCfg"); |
| | | NeedJade = int.Parse(BindJadewheel.Numerical1); |
| | | AngleList = JsonMapper.ToObject<double[][]>(BindJadewheel.Numerical5); |
| | | if (AngleDic.Count <= 0)
|
| | | {
|
| | | if (AngleDic.Count <= 0)
|
| | | for (int i = 0; i < AngleList.Length; i++)
|
| | | {
|
| | | int Type = i + 1;
|
| | | AngleClass angleClass = new AngleClass();
|
| | | angleClass.AngleStart = AngleList[i][0];
|
| | | angleClass.AngleEnd = AngleList[i][1];
|
| | | angleClass.AngleStart = (float)AngleList[i][0];
|
| | | angleClass.AngleEnd = (float)AngleList[i][1];
|
| | | AngleDic.Add(Type, angleClass);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | IsOk = false;
|
| | | |
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= Updatefighting;//数据的刷新(h0418)
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += Updatefighting;//数据的刷新(h0418)
|
| | | IsOk = true;
|
| | | StrKey = "IsOpenFiaryJadeRedPoint" + PlayerDatas.Instance.baseData.PlayerID;
|
| | | AngleSave = LocalSave.GetFloat(StrKey);
|
| | | RedPoint();
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | public void BindJadeWheelResult(HA324_tagMCBindJadeWheelResult Info)
|
| | | {
|
| | | Lattice = Info.Index;
|
| | | Number = Info.Cnt;
|
| | | if (IsOk)
|
| | | {
|
| | | if (AngleDic.ContainsKey(Lattice))
|
| | | {
|
| | |
|
| | | float flo = UnityEngine.Random.Range(AngleDic[Lattice].AngleStart + 0.05f, AngleDic[Lattice].AngleEnd - 0.05f);
|
| | | LocalSave.SetFloat(StrKey, flo);
|
| | | AngleSave = LocalSave.GetFloat(StrKey);
|
| | | }
|
| | | if (WheelOfFortuneUpdate != null)
|
| | | {
|
| | | WheelOfFortuneUpdate(AngleSave);
|
| | | }
|
| | | RedPoint();
|
| | | }
|
| | | |
| | | }
|
| | | public void StartTheDraw()//开始抽奖
|
| | | {
|
| | | CA517_tagCMStartBindJadeWheel _tagC517 = new CA517_tagCMStartBindJadeWheel();
|
| | | GameNetSystem.Instance.SendInfo(_tagC517);
|
| | | }
|
| | |
|
| | | private void Updatefighting(PlayerDataRefresh obj)//红点
|
| | | {
|
| | | if (obj == PlayerDataRefresh.VIPLv)
|
| | | {
|
| | | RedPoint();
|
| | | }
|
| | | }
|
| | | private void RedPoint()
|
| | | {
|
| | | redPointStre1.state = RedPointState.None;
|
| | | int LotteryNumber = vipmodel.GetVipPrivilegeCnt(VipPrivilegeType.BindJadeWheel);
|
| | | if (LotteryNumber > Number)
|
| | | {
|
| | | redPointStre1.state = RedPointState.Simple;
|
| | | }
|
| | | }
|
| | | } |
| | | } |
| | | |
| | | public override void UnInit() |
| | | { |
| | | |
| | | } |
| | | |
| | | public void OnBeforePlayerDataInitialize() |
| | | { |
| | | IsOk = false;
|
| | |
|
| | | } |
| | | |
| | | public void OnPlayerLoginOk() |
| | | { |
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= Updatefighting;//数据的刷新(h0418) |
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += Updatefighting;//数据的刷新(h0418) |
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent; |
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent; |
| | | IsOk = true; |
| | | StrKey = "IsOpenFiaryJadeRedPoint" + PlayerDatas.Instance.baseData.PlayerID; |
| | | AngleSave = LocalSave.GetFloat(StrKey); |
| | | RedPoint(); |
| | | }
|
| | |
|
| | |
|
| | |
|
| | | private void OnFuncStateChangeEvent(int obj) |
| | | { |
| | | if (obj == 144) |
| | | { |
| | | RedPoint(); |
| | | } |
| | | } |
| | | |
| | | public void BindJadeWheelResult(HA324_tagMCBindJadeWheelResult Info) |
| | | { |
| | | Lattice = Info.Index; |
| | | Number = Info.Cnt; |
| | | if (IsOk) |
| | | { |
| | | if (AngleDic.ContainsKey(Lattice)) |
| | | { |
| | | float flo = UnityEngine.Random.Range(AngleDic[Lattice].AngleStart + 1f, AngleDic[Lattice].AngleEnd - 1f);
|
| | | flo = (float)Math.Round((double)flo, 2); |
| | | if (flo > 360f) |
| | | { |
| | | flo = flo - 360f; |
| | | } |
| | | LocalSave.SetFloat(StrKey, flo); |
| | | AngleSave = LocalSave.GetFloat(StrKey); |
| | | } |
| | | if (WheelOfFortuneUpdate != null) |
| | | { |
| | | WheelOfFortuneUpdate(AngleSave); |
| | | } |
| | | RedPoint(); |
| | | }
|
| | | } |
| | | public void StartTheDraw()//开始抽奖 |
| | | { |
| | | CA517_tagCMStartBindJadeWheel _tagC517 = new CA517_tagCMStartBindJadeWheel(); |
| | | GameNetSystem.Instance.SendInfo(_tagC517); |
| | | } |
| | | |
| | | private void Updatefighting(PlayerDataRefresh obj)//红点 |
| | | { |
| | | if (obj == PlayerDataRefresh.VIPLv) |
| | | { |
| | | RedPoint(); |
| | | } |
| | | } |
| | | private void RedPoint() |
| | | { |
| | | if (!FuncOpen.Instance.IsFuncOpen(144) /*|| Number<=0*/) |
| | | { |
| | | return; |
| | | } |
| | | int GetDayOfYear = DateTime.Now.DayOfYear; |
| | | string strKey = "WheelOfRedPoint" + PlayerDatas.Instance.baseData.PlayerID; |
| | | int day = LocalSave.GetInt(strKey); |
| | | if (day != GetDayOfYear) |
| | | { |
| | | redPointStre1.state = RedPointState.Simple; |
| | | } |
| | | else |
| | | { |
| | | redPointStre1.state = RedPointState.None; |
| | | } |
| | | } |
| | | |
| | | public int GetTheGrid(float angle) |
| | | { |
| | | foreach (var key in AngleDic.Keys) |
| | | { |
| | | if (angle > AngleDic[key].AngleStart && angle < AngleDic[key].AngleEnd) |
| | | { |
| | | return key; |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | [SerializeField] Text Money1_Text;
|
| | | [SerializeField] Text Money2_Text;
|
| | | [SerializeField] Text m_Text_remainingTimes;
|
| | | [SerializeField] Button m_PromotionBtn;
|
| | | [Header("最大速度")]
|
| | | public float RollingTime = 1f;
|
| | |
|
| | | [SerializeField] Button m_PromotionBtn; |
| | | [Header("滚动时间")]
|
| | | public float RollingTime = 1f; |
| | | VipModel m_Vipmodel;
|
| | | VipModel vipmodel { get { return m_Vipmodel ?? (m_Vipmodel = ModelCenter.Instance.GetModel<VipModel>()); } } |
| | | WheelOfFortuneModel wheelOfFortuneModel { get { return ModelCenter.Instance.GetModel<WheelOfFortuneModel>(); } }
|
| | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | wheelOfFortuneModel.WheelOfFortuneUpdate += WheelOfFortuneUpdate; |
| | | RotatePointer.IsButtonShow += IsButtonShow; |
| | | RotatePointer.IsButtonShow += IsButtonShow;
|
| | | CheckDisplay.EndOfFlashing += EndOfFlashing; |
| | | if (wheelOfFortuneModel.redPointStre1.state == RedPointState.Simple)
|
| | | {
|
| | | int GetDayOfYear = DateTime.Now.DayOfYear;
|
| | | string strKey = "WheelOfRedPoint" + PlayerDatas.Instance.baseData.PlayerID;
|
| | | LocalSave.SetInt(strKey, GetDayOfYear);
|
| | | wheelOfFortuneModel.redPointStre1.state = RedPointState.None;
|
| | | } |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | {
|
| | | wheelOfFortuneModel.WheelOfFortuneUpdate -= WheelOfFortuneUpdate;
|
| | | RotatePointer.IsButtonShow -= IsButtonShow; |
| | | RotatePointer.IsButtonShow -= IsButtonShow;
|
| | | CheckDisplay.EndOfFlashing -= EndOfFlashing; |
| | | }
|
| | |
|
| | |
|
| | | private void EndOfFlashing()
|
| | | {
|
| | | TiedJadeChange();
|
| | | }
|
| | |
|
| | | private void WheelOfFortuneUpdate(float Angel)
|
| | | {
|
| | | m_LotteryBtn.interactable = false;
|
| | | m_RotatePointer.SetTime(m_Toggle.isOn);
|
| | | IsLottery();
|
| | | }
|
| | |
|
| | |
| | | |
| | | private void OnClickButton()
|
| | | {
|
| | | // m_UIEffectFly.StartFly(Text);
|
| | | m_CheckDisplay.CloseAll();
|
| | | wheelOfFortuneModel.StartTheDraw();//开始抽奖
|
| | | m_LotteryBtn.interactable = false;
|
| | | float angel = UnityEngine.Random.Range(0f, 360f);
|
| | | m_RotatePointer.Angle = angel;
|
| | | m_RotatePointer.SetTime(m_Toggle.isOn);
|
| | | wheelOfFortuneModel.StartTheDraw();//开始抽奖 |
| | | } |
| | | private void OnClickToggle(bool _bool)
|
| | | {
|
| | |
| | | {
|
| | | m_RotatePointer._isRotate = true;
|
| | | }
|
| | |
|
| | | }
|
| | | private void OnClickPromotionBtn()
|
| | | {
|
| | |
| | | tables["accid"] = SDKUtility.Instance.FreePlatformInfo.account;
|
| | | tables["sid"] = ServerListCenter.Instance.currentServer.region_flag.ToString();
|
| | | tables["pushurl"] = ServerListCenter.Instance.currentServer.region_domain;
|
| | | tables["spid"] = VersionConfig.Get().SpID;
|
| | | HttpRequest.Instance.RequestHttpGet(StringUtility.Contact(exchangeUrl, HttpRequest.HashtablaToString(tables)), HttpRequest.defaultHttpContentType, 1, null);
|
| | | }
|
| | | }
|
| | |
| | | List<string> closeAllIgnoreWindows = new List<string>() {
|
| | | "MessageWin", "NewBieWin", "NewItemGetWin", "AttributePromoteShowWin" ,"DungeonBeginCoolDownWin","DungeonFightWin","StatusTipWin"
|
| | | ,"ScrollTipWin","MarqueeWin","ExperienceOpenWin","TrumpetWin","BattlePrepareCoolDownWin","DungeonGradeWin","BattleHintWin",
|
| | | "TreasureDungeonMissionHintWin","FairyGrabBossHintWin","DungeonFairyFeastHintWin","PetAndMountPushWin",
|
| | | "TreasureDungeonMissionHintWin","FairyGrabBossHintWin","DungeonFairyFeastHintWin","PetAndMountPushWin","UpgradeWin",
|
| | | };
|
| | |
|
| | | UIRoot m_UIRoot;
|
| | |
| | | break;
|
| | | case JumpUIType.DogzFunc1Type1:
|
| | | case JumpUIType.DogzFunc1Type2:
|
| | | case JumpUIType.DogzFunc2Type1:
|
| | | case JumpUIType.DogzFunc2Type2:
|
| | | SetJumpLogic<DogzWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.FaBaoSoul_BenYuan:
|
| | |
| | | CeremonyOutof = 247, //仙界盛典绝版降临界面
|
| | | DogzFunc1Type1 = 248, //神兽界面
|
| | | DogzFunc1Type2 = 249, //神兽界面
|
| | | DogzFunc2Type1 = 250, //神兽强化界面
|
| | | DogzFunc2Type2 = 251, //神兽强化界面
|
| | | DhszTs = 1001,//定海神针功法提升界面
|
| | | HyqTs = 1002,//皓月枪功法提升界面
|
| | | GyzTs = 1003,//鬼牙刃功法提升界面
|
| | |
| | | BossHomeAwardLimit = 27,
|
| | | DemonJarDouble = 28,
|
| | | BindJadeWheel=30,
|
| | | PrayForDrug = 31,
|
| | | }
|
| | |
|
| | |
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | int attrValue = _propertyDict[_key];
|
| | | float attrValue = _propertyDict[_key];
|
| | | int fightParm = GetFightPowerParmByAttrId(_key);
|
| | | if(_key == 11)
|
| | | {
|
| | |
| | | attrValue = attrValue * fightParm;
|
| | | }
|
| | | }
|
| | | Equation.Instance.AddKeyValue(cfg.Parameter,attrValue);
|
| | | Equation.Instance.AddKeyValue(cfg.Parameter, attrValue);
|
| | | }
|
| | | }
|
| | |
|