Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | SoundPlayer.CreateSoundPlayer();
|
| | | SoundPlayer.Instance.PlayLoginMusic();
|
| | | SystemSetting.Instance.SetSoundVolume(SystemSetting.Instance.GetSoundVolume());
|
| | | SystemSetting.Instance.SetVSyncCount(SystemSetting.Instance.GetVSyncCount());
|
| | |
|
| | | SDKUtility.Instance.Init();
|
| | | GameObjectPoolManager.Instance.gameObject.name = "GameObjectPool";
|
| | |
| | | && InGameDownLoad.Instance.completeDownLoadAccount == PlayerDatas.Instance.baseData.AccID)
|
| | | {
|
| | | m_ProgressText.gameObject.SetActive(true);
|
| | | m_ProgressText.text = "100%";
|
| | | var progress = Mathf.RoundToInt(InGameDownLoad.Instance.progress * 100);
|
| | | m_ProgressText.text = StringUtility.Contact(progress, "%");
|
| | | this.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | |
| | | case InGameDownLoad.State.Award:
|
| | | this.gameObject.SetActive(true);
|
| | | m_ProgressText.gameObject.SetActive(true);
|
| | | m_ProgressText.text = "100%";
|
| | | var progress = Mathf.RoundToInt(InGameDownLoad.Instance.progress * 100);
|
| | | m_ProgressText.text = StringUtility.Contact(progress, "%");
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | public const string POTENTIAL_NO_NOTIFY = "PotentialNoNotify";
|
| | | public const string FLASHSALE_REDPOINT = "FlashSale_Redpoint";
|
| | | public const string OSTIMEGIFT_REDPOINT = "OSTimeGift_Redpoint";
|
| | | public const string TRIALEXCHANGE_REDPOINT = "TrialExchange_Redpoint";
|
| | | public const string OSGIFT_REDPOINT = "OSGitf_Redpoint";
|
| | | public Dictionary<string, int[]> dayRemindDic = new Dictionary<string, int[]>();
|
| | |
|
| | | public bool GetDayRemind(string _remindKey)
|
| | |
| | | SetDayRemind(POTENTIAL_NO_NOTIFY);
|
| | | SetDayRemind(FLASHSALE_REDPOINT);
|
| | | SetDayRemind(OSTIMEGIFT_REDPOINT);
|
| | | SetDayRemind(TRIALEXCHANGE_REDPOINT);
|
| | | SetDayRemind(OSGIFT_REDPOINT);
|
| | | }
|
| | |
|
| | | private void SetDayRemind(string _key)
|
| | |
| | | [SerializeField] Transform m_ContainerPoivt;
|
| | | [SerializeField] Transform m_KillRewardExplain;
|
| | | [SerializeField] Text m_Rank;
|
| | | [SerializeField] Text m_RewardType;
|
| | | [SerializeField] RectTransform m_FirstRankRewardTip;
|
| | | [SerializeField] Transform m_DoubleReward;
|
| | | [SerializeField] Transform m_DoubleChallenge;
|
| | | [SerializeField] ScrollRect m_RewardsScroll;
|
| | |
| | |
|
| | | var rank = model.dungeonResult.rank;
|
| | | m_Rank.text = Language.Get("DemonJar7", rank);
|
| | | m_RewardType.text = Language.Get(rank == 1 ? "DemonJar9" : "DemonJar11");
|
| | | m_FirstRankRewardTip.gameObject.SetActive(rank == 1);
|
| | | m_KillRewardExplain.gameObject.SetActive(rank == 1);
|
| | | m_DamageFirstEffect.gameObject.SetActive(rank == 1);
|
| | | m_VictoryFontContainer.gameObject.SetActive(rank != 1);
|
| | |
| | | [SerializeField] Text m_ReBornTimer; |
| | | [SerializeField] Button m_Reborn; |
| | | |
| | | PlayerDeadModel _deadModel; |
| | | PlayerDeadModel DeadModel |
| | | { |
| | | get { return _deadModel ?? (_deadModel = ModelCenter.Instance.GetModel<PlayerDeadModel>()); } |
| | | } |
| | | PlayerDeadModel DeadModel { get { return ModelCenter.Instance.GetModel<PlayerDeadModel>(); } } |
| | | |
| | | float rebornTime = 0f; |
| | | float secondTimer = 0f; |
| | | bool sendReborn = false; |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | TimeDownMgr.CoolTimeData coolDown; |
| | | if (TimeDownMgr.Instance.Get(TimeDownMgr.CoolTimeType.DuplicatesReborn, out coolDown)) |
| | | { |
| | | RefreshTime(Mathf.RoundToInt(coolDown.duration - coolDown.time)); |
| | | } |
| | | secondTimer = 0f; |
| | | sendReborn = false; |
| | | |
| | | DeadModel.RefreshDuplicatesRebornCDEvent = RefreshTime; |
| | | try |
| | | { |
| | | rebornTime = Time.time + GeneralConfig.Instance.dungeonRebornClientTimes[ElderGodAreaModel.ELDERGODAREA_MAPID]; |
| | | if (rebornTime <= Time.time) |
| | | { |
| | | Reborn(); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Debug.Log(ex); |
| | | rebornTime = Time.time + 10f; |
| | | } |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | if (!sendReborn) |
| | | { |
| | | Reborn(); |
| | | } |
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | |
| | | } |
| | | #endregion |
| | | |
| | | private void RefreshTime(int _time) |
| | | |
| | | protected override void LateUpdate() |
| | | { |
| | | if (_time > 0) |
| | | base.LateUpdate(); |
| | | |
| | | if (Time.time >= rebornTime) |
| | | { |
| | | m_ReBornTimer.text = StringUtility.Contact("(", _time, ")"); |
| | | if (!sendReborn) |
| | | { |
| | | Reborn(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Reborn(); |
| | | secondTimer -= Time.deltaTime; |
| | | if (secondTimer < 0f) |
| | | { |
| | | secondTimer = 1f; |
| | | var surplusSecond = Mathf.RoundToInt(rebornTime - Time.time); |
| | | m_ReBornTimer.text = StringUtility.Contact("(", surplusSecond, ")"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void Reborn() |
| | | { |
| | | sendReborn = true; |
| | | DeadModel.SendRebornQuest(0); |
| | | WindowCenter.Instance.Close<ElderGodAreaRebornWin>(); |
| | | } |
| | |
| | |
|
| | | public List<int> dungeonCanUseMoneyIds { get; private set; }
|
| | |
|
| | | public Dictionary<int, int> dungeonRebornClientTimes { get; private set; }
|
| | |
|
| | | public void Init()
|
| | | {
|
| | | try
|
| | |
| | | inGameDownLoadHighestLevelPoint = GetInt("DownReward", 2);
|
| | |
|
| | | dungeonCanUseMoneyIds = new List<int>(GetIntArray("FBEnterTickeyAuto", 1));
|
| | | dungeonRebornClientTimes = ConfigParse.GetDic<int, int>(GetInputString("DuplicatesRebornTime", 2));
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | |
| | | {
|
| | | if(itemAttrData.packType != PackType.rptDogzItem && itemAttrData.packType != PackType.rptDogzEquip)
|
| | | {
|
| | | if (dogzEquipDesText != null)
|
| | | {
|
| | | dogzEquipDesText.gameObject.SetActive(false);
|
| | | }
|
| | | if (itemAttrData.itemConfig.Description == "" || string.IsNullOrEmpty(itemAttrData.itemConfig.Description))
|
| | | {
|
| | | equipSourceNormal.gameObject.SetActive(true);
|
| | |
| | | equipSourceNormal.gameObject.SetActive(false);
|
| | | equipSourceDes.gameObject.SetActive(false);
|
| | | equipSourceText.gameObject.SetActive(false);
|
| | | if (dogzEquipDesText != null)
|
| | | {
|
| | | dogzEquipDesText.gameObject.SetActive(true);
|
| | | dogzEquipDesText.text = itemAttrData.itemConfig.Description;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | m_TitleText.text = "<color=#ec4bf6>" + TaskTitle(TaskID) + "</color>";
|
| | | }
|
| | | int itemNumber = playerPack.GetItemCountByID(PackType.rptItem, mainModel.ItemID);//获取特殊物品
|
| | | if (mainModel.TaskId_Skill1.Contains(TaskID))
|
| | | {
|
| | | if (itemNumber >= mainModel.ItemNumber)
|
| | | {
|
| | | m_TitleText.text = "<color=#109d06>" + TaskTitle(TaskID) + "</color>";
|
| | | }
|
| | | else
|
| | | {
|
| | | m_TitleText.text = "<color=#feed28>" + TaskTitle(TaskID) + "</color>";
|
| | | }
|
| | | }
|
| | | string str = taskmodel.allMissionDict[TaskID].InforList;
|
| | | var taskinfo = Config.Instance.Get<TASKINFOConfig>(str);
|
| | | if (mainModel.TaskId_Skill1.Contains(TaskID))//特殊任务
|
| | | {
|
| | | int itemNumber = playerPack.GetItemCountByID(PackType.rptItem, mainModel.ItemID);//获取特殊物品
|
| | | |
| | | string Str_A = string.Format(Language.Get("PassiveSkillTask1"), mainModel.ItemID, itemNumber);
|
| | | string Str_B = Language.Get("PassiveSkillTask2");
|
| | | if (itemNumber >= mainModel.ItemNumber)
|
| | |
| | | {
|
| | | get
|
| | | {
|
| | | if (font == null)
|
| | | if (font == null && Application.isPlaying)
|
| | | {
|
| | | font = FontUtility.preferred;
|
| | | }
|
| | |
| | | {
|
| | | get
|
| | | {
|
| | | if (font == null)
|
| | | if (font == null && Application.isPlaying)
|
| | | {
|
| | | font = FontUtility.preferred;
|
| | | }
|
| | |
| | | fitterText = fitterText.Replace("\n", "");
|
| | | float width = 0;
|
| | | textBuilder.Length = 0;
|
| | | if (null == font)
|
| | | if (null == font && Application.isPlaying)
|
| | | {
|
| | | font = FontUtility.preferred;
|
| | | }
|
| | |
| | | private void Awake()
|
| | | {
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitializeEvent;
|
| | | StageManager.Instance.onStageLoadFinish += OnStageLoadFinish;
|
| | | }
|
| | |
|
| | | protected override void OnDestroy()
|
| | | {
|
| | | base.OnDestroy();
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= BeforePlayerDataInitializeEvent;
|
| | | StageManager.Instance.onStageLoadFinish -= OnStageLoadFinish;
|
| | | }
|
| | |
|
| | | private void OnStageLoadFinish()
|
| | | {
|
| | | ServerTipDetails.OnStageLoadFinish();
|
| | | }
|
| | |
|
| | | private void BeforePlayerDataInitializeEvent()
|
| | |
| | | public bool CanGetAward(int _type, out int _displayIndex)
|
| | | {
|
| | | _displayIndex = 0;
|
| | | if (IsMissImpactRank(_type) || !IsActivityClose(_type))
|
| | | bool _locked = IsLock(_type);
|
| | | if (IsMissImpactRank(_type) || _locked)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | else if (IsActivityClose(_type))
|
| | | {
|
| | | var _start = (_cfg as OSCBillRankAwardConfig).RankA;
|
| | | var _end = (_cfg as OSCBillRankAwardConfig).RankB;
|
| | |
| | | [SerializeField] Text m_OriginalMoneyValue;
|
| | | [SerializeField] Button m_BuyBtn;
|
| | | [SerializeField] Image m_Complete;
|
| | | [SerializeField] Text m_OwnMoney;
|
| | |
|
| | | StoreModel m_StoreModel;
|
| | | StoreModel storeModel
|
| | |
| | | private void OnEnable()
|
| | | {
|
| | | storeModel.RefreshBuyShopLimitEvent += RefreshBuyShopLimitEvent;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent;
|
| | | }
|
| | |
|
| | | private void OnDisable()
|
| | | {
|
| | | storeModel.RefreshBuyShopLimitEvent -= RefreshBuyShopLimitEvent;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= PlayerDataRefreshInfoEvent;
|
| | | }
|
| | |
|
| | | private void PlayerDataRefreshInfoEvent(PlayerDataRefresh refreshType)
|
| | | {
|
| | | if (refreshType == PlayerDataRefresh.Gold || refreshType == PlayerDataRefresh.GoldPaper)
|
| | | {
|
| | | DisplayOwnMoney();
|
| | | }
|
| | | }
|
| | |
|
| | | private void RefreshBuyShopLimitEvent()
|
| | |
| | | m_OriginalMoneyValue.text = _storeConfig.MoneyOriginal.ToString();
|
| | | }
|
| | |
|
| | | DisplayOwnMoney();
|
| | |
|
| | | var _limit = storeModel.GetBuyShopLimit((uint)storeId);
|
| | | m_Complete.gameObject.SetActive(_limit != null && _limit.BuyCnt >= _storeConfig.PurchaseNumber[0]);
|
| | | m_BuyBtn.gameObject.SetActive(_limit == null || _limit.BuyCnt < _storeConfig.PurchaseNumber[0]);
|
| | | }
|
| | |
|
| | | private void DisplayOwnMoney()
|
| | | {
|
| | | if (m_OwnMoney != null)
|
| | | {
|
| | | var config = Config.Instance.Get<StoreConfig>(storeId);
|
| | | m_OwnMoney.text = UIHelper.GetMoneyCnt(config == null ? 1 : config.MoneyType).ToString();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnBuyBtn()
|
| | | {
|
| | | var _storeConfig = Config.Instance.Get<StoreConfig>(storeId);
|
| | |
| | | {
|
| | | onStateUpate(6);
|
| | | }
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | public event Action<int> onStateUpate;
|
| | |
|
| | | public bool activate { get; private set; }
|
| | |
|
| | | private bool m_GiftGetNotify = false;
|
| | | public bool giftGetNotify
|
| | | {
|
| | | get { return m_GiftGetNotify; }
|
| | | set
|
| | | {
|
| | | m_GiftGetNotify = value;
|
| | | OSGiftRedpoint.state = value ? RedPointState.Simple : RedPointState.None;
|
| | | }
|
| | | }
|
| | |
|
| | | StoreModel storeModel
|
| | | {
|
| | |
| | | {
|
| | | onStateUpate(6);
|
| | | }
|
| | | UpdateRedpoint();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | onStateUpate(6);
|
| | | }
|
| | | }
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | public bool CheckActivate()
|
| | |
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | giftGetNotify = false;
|
| | | }
|
| | | |
| | | public void SetDayRemind()
|
| | | {
|
| | | if (OSGiftRedpoint.state == RedPointState.Simple)
|
| | | {
|
| | | DayRemind.Instance.SetDayRemind(DayRemind.OSGIFT_REDPOINT, true);
|
| | | UpdateRedpoint();
|
| | | }
|
| | | }
|
| | |
|
| | | void UpdateRedpoint()
|
| | | {
|
| | | OSGiftRedpoint.state = RedPointState.None;
|
| | | if (CheckActivate() && !DayRemind.Instance.GetDayRemind(DayRemind.OSGIFT_REDPOINT))
|
| | | {
|
| | | OSGiftRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | | }
|
| | |
|
| | | public Redpoint OSGiftRedpoint = new Redpoint(MainRedDot.REDPOINT_OPENSERVER, 20906);
|
| | |
| | | {
|
| | | m_ActivitySpreadDict[m_SortArray[i]] = false;
|
| | | }
|
| | | impactRankModel.presentSelectType = impactRankModel.GetDefaultSelectType();
|
| | | var impactDefaultType= impactRankModel.GetDefaultSelectType();
|
| | | if (impactRankModel.IsLock(impactDefaultType))
|
| | | {
|
| | | impactDefaultType = impactRankModel.billRankCfgDict.Keys.First();
|
| | | }
|
| | | impactRankModel.presentSelectType = impactDefaultType;
|
| | | impactRankModel.gotoImpactRankType = 0;
|
| | | envelopeModel.selectType = 1;
|
| | | CheckAlreadyOpen();
|
| | |
| | |
|
| | | private void OnStepServerDayEvent()
|
| | | {
|
| | | m_ActivityCtrl.m_Scorller.RefreshActiveCellViews();
|
| | | //m_ActivityCtrl.m_Scorller.RefreshActiveCellViews();
|
| | | UpdateFunctionBtns();
|
| | | }
|
| | |
|
| | | private void RefreshActivityTypeCell(OpenActivityRankTypeCell _cell)
|
| | |
| | | }
|
| | | foreach (var _type in impactRankModel.billRankCfgDict.Keys)
|
| | | {
|
| | | if (impactRankModel.IsLock(_type))
|
| | | {
|
| | | continue;
|
| | | }
|
| | | m_ActivityCtrl.AddCell(ScrollerDataType.Normal, sort * 100 + _type);
|
| | | }
|
| | | break;
|
| | |
| | | return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<StoreModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | OSGiftModel giftModel { get { return ModelCenter.Instance.GetModel<OSGiftModel>(); } }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | |
| | | {
|
| | | WindowCenter.Instance.windowAfterOpenEvent += WindowAfterOpenEvent;
|
| | | WindowCenter.Instance.windowAfterCloseEvent += windowAfterCloseEvent;
|
| | | ModelCenter.Instance.GetModel<OSGiftModel>().giftGetNotify = false;
|
| | | model.RefreshBuyShopLimitEvent += RefreshBuyShopLimitEvent;
|
| | |
|
| | | giftModel.SetDayRemind();
|
| | | Display();
|
| | |
|
| | | m_ContainerDisplay.gameObject.SetActive(!WindowCenter.Instance.CheckOpen<OffLineOnHookWin>());
|
| | |
| | | [SerializeField] Text presentRuneNameTxt;
|
| | | [SerializeField] Text presentRuneAttrTxt;
|
| | |
|
| | | [SerializeField] RectTransform m_ContainerLevelUp;
|
| | | //[SerializeField] RectTransform m_ContainerLevelUp;
|
| | | [SerializeField] RectTransform m_ContainerLvUp1;
|
| | | [SerializeField] RectTransform m_ContainerLvUp2;
|
| | | [SerializeField] RectTransform m_ContainerItem;
|
| | | [SerializeField] RectTransform m_ContaienrMaxLevel;
|
| | | [SerializeField] Text runeLevelUpAttr1;
|
| | | [SerializeField] Text runeLevelUpAttr2;
|
| | | [SerializeField] Text runeLevelUpAttrNum1;
|
| | |
| | | m_ContainerLvUp1.gameObject.SetActive(!_isRuneMaxLv);
|
| | | m_ContainerItem.gameObject.SetActive(!_isRuneMaxLv);
|
| | | m_RuneLevelUpBtn.gameObject.SetActive(!_isRuneMaxLv);
|
| | | m_ContainerLevelUp.gameObject.SetActive(!_isRuneMaxLv);
|
| | | //m_ContainerLevelUp.gameObject.SetActive(!_isRuneMaxLv);
|
| | | m_ContaienrMaxLevel.gameObject.SetActive(_isRuneMaxLv);
|
| | | runeLevelUpItemNum.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(
|
| | | model.RuneSplinters >= _levelUpExp ? TextColType.Green : TextColType.Red
|
| | | , model.RuneSplinters.ToString(), true), "/", _levelUpExp);
|
| | |
| | | [SerializeField] Toggle m_HighQuality;
|
| | | [SerializeField] Toggle m_MediumQuality;
|
| | | [SerializeField] Toggle m_LowQuality;
|
| | | [SerializeField] OnOffToggle m_SixtyFrame;
|
| | |
|
| | | [SerializeField] Toggle m_OtherPlayer;
|
| | | [SerializeField] Toggle m_Monster;
|
| | |
| | | m_HighQuality.AddListener(OnSetQualityHigh);
|
| | | m_MediumQuality.AddListener(OnSetQualityMedium);
|
| | | m_LowQuality.AddListener(OnSetQualityLow);
|
| | | m_SixtyFrame.AddListener(SwitchVSyncCount);
|
| | |
|
| | | m_OtherPlayer.AddListener(OnShowOrHideOtherPlayers);
|
| | | m_Monster.AddListener(OnShowOrHideMonsters);
|
| | |
|
| | |
| | | UpdateToggleSkin(m_LowQuality);
|
| | | UpdateToggleSkin(m_OtherPlayer);
|
| | | UpdateToggleSkin(m_Monster);
|
| | |
|
| | | m_SixtyFrame.isOn = SystemSetting.Instance.GetVSyncCount() == 1;
|
| | |
|
| | | var serverName = ServerListCenter.Instance.GetServerData(ServerListCenter.Instance.currentServer.region_flag).name;
|
| | | var playerAccount = PlayerDatas.Instance.baseData.AccID.Split('@');
|
| | |
| | |
|
| | | loginModel.accountBindOkEvent += UpdateAccountBindTitle;
|
| | | SDKUtility.Instance.onFreePlatfromDoIDAuthenticationOk += OnAuthenticationOk;
|
| | | SystemSetting.Instance.vSyncCountChangeEvent += OnSwitchVSyncCount;
|
| | | SystemSetting.Instance.playerSyncCountChangeEvent += OnPlayerSyncCountChange;
|
| | |
|
| | | isInited = true;
|
| | |
| | | isInited = false;
|
| | | loginModel.accountBindOkEvent -= UpdateAccountBindTitle;
|
| | | SDKUtility.Instance.onFreePlatfromDoIDAuthenticationOk -= OnAuthenticationOk;
|
| | | SystemSetting.Instance.vSyncCountChangeEvent -= OnSwitchVSyncCount;
|
| | | SystemSetting.Instance.playerSyncCountChangeEvent -= OnPlayerSyncCountChange;
|
| | | SystemSetting.Instance.SetPlayerSyncCount(playerSyncCountRef);
|
| | | }
|
| | |
| | | UpdateToggleSkin(m_LowQuality);
|
| | | }
|
| | |
|
| | | private void SwitchVSyncCount()
|
| | | {
|
| | | var currentVSyncCount = SystemSetting.Instance.GetVSyncCount();
|
| | | switch (currentVSyncCount)
|
| | | {
|
| | | case 1:
|
| | | SystemSetting.Instance.SetVSyncCount(2);
|
| | | break;
|
| | | case 2:
|
| | | SystemSetting.Instance.SetVSyncCount(1);
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnSwitchVSyncCount()
|
| | | {
|
| | | m_SixtyFrame.isOn = SystemSetting.Instance.GetVSyncCount() == 1;
|
| | | }
|
| | |
|
| | | private void OnShowOrHideOtherPlayers(bool _value)
|
| | | {
|
| | | SystemSetting.Instance.SetSystemSettingSwitch(SystemSwitch.OtherPlayer, _value);
|
| | |
| | | const string SOUND_VOLUME_KEY = "SoundRatioKey"; //音乐
|
| | | const string SOUND_EFFECT_KEY = "SoundEffect"; //音效
|
| | | const string FPS_KEY = "FPSKey";
|
| | | const string VSYNC_KEY = "GameVSyncCountSetting";//垂直同步率
|
| | |
|
| | | public Dictionary<SystemSwitch, bool> systemSettings = new Dictionary<SystemSwitch, bool>();
|
| | |
|
| | |
| | | public event Action<SystemSwitch, bool> OnSettingChanged;
|
| | | public event Action qualityLevelChangeEvent;
|
| | | public event Action playerSyncCountChangeEvent;
|
| | | public event Action vSyncCountChangeEvent;
|
| | |
|
| | | public SystemSetting()
|
| | | {
|
| | |
| | | public float GetSoundEffect()
|
| | | {
|
| | | return LocalSave.GetFloat(SOUND_EFFECT_KEY, 1);
|
| | | }
|
| | |
|
| | | public void SetVSyncCount(int _vSync)
|
| | | {
|
| | | LocalSave.SetInt(VSYNC_KEY, QualitySettings.vSyncCount = Mathf.Clamp(_vSync, 0, 2));
|
| | |
|
| | | if (vSyncCountChangeEvent != null)
|
| | | {
|
| | | vSyncCountChangeEvent();
|
| | | }
|
| | | }
|
| | |
|
| | | public int GetVSyncCount()
|
| | | {
|
| | | return LocalSave.GetInt(VSYNC_KEY, 2);
|
| | | }
|
| | |
|
| | | public void SetSystemSettingSwitch(SystemSwitch type, bool _value)
|
| | |
| | | public void SetQualityLevel(GameQuality _quality, bool _disabeCamera = true)
|
| | | {
|
| | | LocalSave.SetInt(QUALITY_LEVEL_KEY, Mathf.Clamp((int)_quality, 0, 2));
|
| | | QualitySettings.SetQualityLevel((int)GameQuality.High);
|
| | |
|
| | | switch (_quality)
|
| | | {
|
| | |
| | | Shader.DisableKeyword("QUALITY_HGH");
|
| | | Shader.DisableKeyword("QUALITY_MED");
|
| | | Shader.EnableKeyword("QUALITY_LOW");
|
| | | SetVSyncCount(2);
|
| | | break;
|
| | | case GameQuality.Medium:
|
| | | Shader.globalMaximumLOD = 250;
|
| | |
| | |
|
| | | public class MarqueeWin : Window
|
| | | {
|
| | | [SerializeField]
|
| | | RichText marqueeText;
|
| | | [SerializeField]
|
| | | RectTransform marqueeBg;
|
| | | [SerializeField]
|
| | | TweenCurve tweenCurve;
|
| | |
|
| | | [SerializeField] RectTransform m_ContainerMarquee;
|
| | | [SerializeField] RichText marqueeText;
|
| | | [SerializeField] RectTransform marqueeBg;
|
| | | [SerializeField] TweenCurve tweenCurve;
|
| | | [SerializeField] UIEffect m_Effect;
|
| | | #region 参数
|
| | | Vector3 fromPos;
|
| | | Vector3 toPos;
|
| | |
| | |
|
| | | [SerializeField]
|
| | | float speed = 5.0f;
|
| | |
|
| | | Coroutine cacheCoroutine = null;
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | |
| | | m_Time = 0;
|
| | | ServerTipDetails.OnTweening = false;
|
| | | presentCnt = 0;
|
| | | m_ContainerMarquee.gameObject.SetActive(false);
|
| | | if (cacheCoroutine != null)
|
| | | {
|
| | | StopCoroutine(cacheCoroutine);
|
| | | cacheCoroutine = null;
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | | m_Effect.Play();
|
| | | cacheCoroutine = StartCoroutine(Co_StartTween());
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | BeginMarquee();
|
| | | //BeginMarquee();
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | ServerTipDetails.OnTweening = false;
|
| | | presentCnt = 0;
|
| | | if (cacheCoroutine != null)
|
| | | {
|
| | | StopCoroutine(cacheCoroutine);
|
| | | cacheCoroutine = null;
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | |
|
| | | }
|
| | |
|
| | | IEnumerator Co_StartTween()
|
| | | {
|
| | | yield return WaitingForSecondConst.WaitMS500;
|
| | | m_ContainerMarquee.gameObject.SetActive(true);
|
| | | BeginMarquee();
|
| | | }
|
| | |
|
| | | protected override void LateUpdate()
|
| | | {
|
| | | base.LateUpdate();
|
| | |
| | | |
| | | m_Marquees.Sort(SysNotifyMgr.Instance.Compare); |
| | | |
| | | if (!CheckOpenMarquee())
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (!WindowCenter.Instance.CheckOpen<MarqueeWin>()) |
| | | { |
| | | WindowCenter.Instance.Open<MarqueeWin>(); |
| | | } |
| | | } |
| | | |
| | | public static void OnStageLoadFinish()
|
| | | {
|
| | | if (StageManager.Instance.CurrentStage is LoginStage
|
| | | || StageManager.Instance.CurrentStage is SelectRoleStage)
|
| | | {
|
| | | m_Marquees.Clear();
|
| | | return;
|
| | | }
|
| | | SnxxzGame.Instance.StartCoroutine(Co_StageLoadFinish());
|
| | | }
|
| | |
|
| | | static IEnumerator Co_StageLoadFinish()
|
| | | {
|
| | | yield return null;
|
| | | if (CheckOpenMarquee() && m_Marquees.Count > 0)
|
| | | {
|
| | | if (!WindowCenter.Instance.CheckOpen<MarqueeWin>())
|
| | | {
|
| | | WindowCenter.Instance.Open<MarqueeWin>();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | static bool CheckOpenMarquee()
|
| | | {
|
| | | return (StageManager.Instance.CurrentStage is DungeonStage) && !StageManager.Instance.isLoading;
|
| | | }
|
| | |
|
| | | public static SystemHintData RequireMarquee() |
| | | { |
| | | if (m_Marquees.Count > 0) |
| | |
| | | var stage = m_Treasure.treasureStages[m_Treasure.stage];
|
| | | var _index = m_Treasure.GetStageIndex(stage.stage);
|
| | | model.SetTreasureStageShow(m_Treasure.id, stage.stage);
|
| | |
|
| | | if (WindowCenter.Instance.CheckOpen<TreasureStageTipWin>())
|
| | | {
|
| | | WindowCenter.Instance.CloseImmediately<TreasureStageTipWin>();
|
| | | }
|
| | |
|
| | | switch (stage.unlockType)
|
| | | {
|
| | | case TreasureStageUnlock.Skill:
|
| | |
| | | VipInvestModel VipInvestModel { get { return m_VipInvestModel ?? (m_VipInvestModel = ModelCenter.Instance.GetModel<VipInvestModel>()); } }
|
| | | private bool IsOk = false;
|
| | | public bool IsRedpoint = false;
|
| | |
|
| | | private int DisplayLevel = 0;//显示等级
|
| | | private int DisplayDays = 0;//显示天数
|
| | | //----
|
| | | private bool IsOneRedPoint = true;
|
| | | public override void Init()
|
| | | {
|
| | | var InvestRedPoint = Config.Instance.Get<FuncConfigConfig>("InvestRedPoint");
|
| | | DisplayLevel = int.Parse(InvestRedPoint.Numerical2);
|
| | | DisplayDays = int.Parse(InvestRedPoint.Numerical3);
|
| | |
|
| | | int[] MultipleIntList = ConfigParse.GetMultipleStr<int>(Config.Instance.Get<FuncConfigConfig>("JadeInvest").Numerical1);
|
| | | MultipleList.Clear();
|
| | | for (int i = 0; i < MultipleIntList.Length; i++)
|
| | |
| | | IsOk = true;
|
| | | InvestmentAmount();
|
| | | InvestmentRedPoint();
|
| | | if (TimeUtility.CreateDays <= 3 && redPointStre1.state == RedPointState.None)
|
| | | if (TimeUtility.CreateDays <= DisplayDays && redPointStre1.state == RedPointState.None)
|
| | | {
|
| | | IsRedpoint = true;
|
| | | if (PlayerDatas.Instance.baseData.LV >= 30)
|
| | | if (PlayerDatas.Instance.baseData.LV >= DisplayLevel)
|
| | | {
|
| | | RedPointSate();
|
| | | }
|
| | |
| | | }
|
| | | if (_tCDBPlayerRefresh == PlayerDataRefresh.LV)
|
| | | {
|
| | | if (TimeUtility.CreateDays <= 3 && redPointStre1.state == RedPointState.None && PlayerDatas.Instance.baseData.LV >= 30)
|
| | | if (TimeUtility.CreateDays <= DisplayDays && redPointStre1.state == RedPointState.None && PlayerDatas.Instance.baseData.LV >= DisplayLevel)
|
| | | {
|
| | | if (IsRedpoint)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | | int type1 = -1;
|
| | | if (JumpInedx == 0 && InvestmentGrade != 0)
|
| | |
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | private void RedPointSate()//月卡投资创角前三天红点
|
| | |
| | | }
|
| | | if (IsRedpoint)
|
| | | {
|
| | | if (IsOneRedPoint)
|
| | | {
|
| | | redPointStre1.state = RedPointState.Simple;
|
| | | IsOneRedPoint = false;
|
| | | } |
| | | }
|
| | | else
|
| | | {
|
| | |
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | if (fairyJadeInvestmentModel.IsRedpoint)
|
| | | if (fairyJadeInvestmentModel.redPointStre1.state==RedPointState.Simple)
|
| | | {
|
| | | fairyJadeInvestmentModel.IsRedpoint = false;
|
| | | if (FairyJadeInvestmentRedPointEvent != null)
|
| | |
| | | if(PlayerDatas.Instance.baseData.coinPointTotal > 0
|
| | | && !model.firstChargeRewardGet)
|
| | | {
|
| | | ModelCenter.Instance.GetModel<OSGiftModel>().giftGetNotify = true;
|
| | | CA504_tagCMPlayerGetReward pak = new CA504_tagCMPlayerGetReward();
|
| | | pak.RewardType = (byte)GotServerRewardType.Def_RewardType_GoldGiftFirst;
|
| | | pak.DataEx = 0;
|
| | |
| | | public int NeedVipLv { get; private set;}
|
| | | private bool IsOkBool = false;
|
| | | public bool IsRedpoint = false;
|
| | |
|
| | | private int DisplayLevel = 0;//显示等级
|
| | | private int DisplayDays = 0;//显示天数
|
| | | //----
|
| | | private bool IsOneRedPoint = true;
|
| | | public override void Init()
|
| | | {
|
| | | vipInvestDict.Clear();
|
| | |
| | | vipInvestLvlimitDict.Clear();
|
| | | investGoldDict.Clear();
|
| | | investMaxDayDict.Clear();
|
| | |
|
| | | var InvestRedPoint = Config.Instance.Get<FuncConfigConfig>("InvestRedPoint");
|
| | | DisplayLevel = int.Parse(InvestRedPoint.Numerical1);
|
| | | DisplayDays = int.Parse(InvestRedPoint.Numerical3);
|
| | | FuncConfigConfig vipInvestLv = Config.Instance.Get<FuncConfigConfig>("VIPInvest");
|
| | | NeedVipLv = int.Parse(vipInvestLv.Numerical2);
|
| | | JsonData vipInvestData = JsonMapper.ToObject(vipInvestLv.Numerical1);
|
| | |
| | | VipInvestWin.VipInvestRedPointEvent += VipInvestRedPointEvent;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= Updatefighting;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += Updatefighting;
|
| | | if (TimeUtility.CreateDays <= 3 && redPointStre1.state==RedPointState.None)
|
| | | if (TimeUtility.CreateDays <= DisplayDays && redPointStre1.state==RedPointState.None)
|
| | | {
|
| | | IsRedpoint = true;
|
| | | if (PlayerDatas.Instance.baseData.LV >= 30)
|
| | | if (PlayerDatas.Instance.baseData.LV >= DisplayLevel)
|
| | | {
|
| | | RedPointSate();
|
| | | }
|
| | |
| | | {
|
| | | if (_tCDBPlayerRefresh == PlayerDataRefresh.LV)
|
| | | {
|
| | | if (TimeUtility.CreateDays <= 3 && redPointStre1.state == RedPointState.None && PlayerDatas.Instance.baseData.LV >= 30)
|
| | | if (TimeUtility.CreateDays <= DisplayDays && redPointStre1.state == RedPointState.None && PlayerDatas.Instance.baseData.LV >= DisplayLevel)
|
| | | {
|
| | | if (IsRedpoint)
|
| | | {
|
| | |
| | | {
|
| | | return investGoldDict[type][index];
|
| | | }
|
| | |
|
| | | return 0;
|
| | | }
|
| | |
|
| | |
| | | return index;
|
| | | }
|
| | | }
|
| | |
|
| | | return "";
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | cycle = day / 7;
|
| | | }
|
| | |
|
| | | return cycle;
|
| | | }
|
| | |
|
| | |
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | ServerInvestInfo InvestInfo;
|
| | | int cycle = 0;
|
| | | private List<InvestConfig> configlist;
|
| | |
| | | break;
|
| | | default:
|
| | | break;
|
| | |
|
| | | }
|
| | | // redPointStre1.state = RedPointState.Simple;
|
| | | JumpIndex = i;
|
| | |
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | if (IsRedpoint)
|
| | | {
|
| | | if (IsOneRedPoint)
|
| | | {
|
| | | redPointStre1.state = RedPointState.Simple;
|
| | | IsOneRedPoint = false;
|
| | | } |
| | | }
|
| | | else
|
| | | {
|
| | | VipInvestRedPoint();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | public struct InvestReward
|
| | |
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | if (investModel.IsRedpoint)
|
| | | if (investModel.redPointStre1.state==RedPointState.Simple)
|
| | | {
|
| | | investModel.IsRedpoint = false;
|
| | | if (VipInvestRedPointEvent != null)
|
| | |
| | | {
|
| | | functionOrder = 3;
|
| | | }
|
| | | else if (sevenDayModel.redPointStre1.state == RedPointState.Simple && FuncOpen.Instance.IsFuncOpen(115))
|
| | | else if (sevenDayModel.redPointStre1.state == RedPointState.GetReward && FuncOpen.Instance.IsFuncOpen(115))
|
| | | {
|
| | | WindowCenter.Instance.Close<MainInterfaceWin>();
|
| | | WindowCenter.Instance.Open<WelfareWin>(false, 2);
|
| | |
| | | {
|
| | | functionOrder = 3;
|
| | | }
|
| | | else if (sevenDayModel.redPointStre1.state == RedPointState.Simple && FuncOpen.Instance.IsFuncOpen(115))
|
| | | else if (sevenDayModel.redPointStre1.state == RedPointState.GetReward && FuncOpen.Instance.IsFuncOpen(115))
|
| | | {
|
| | | return 2;
|
| | | }
|
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Thursday, August 23, 2018 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | using UnityEngine.Events; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class OnOffToggle : MonoBehaviour |
| | | { |
| | | |
| | | [SerializeField] Button m_Button; |
| | | [SerializeField] RectTransform m_Handle; |
| | | [SerializeField] Image m_BackGround; |
| | | [SerializeField] RectTransform m_OnShow; |
| | | [SerializeField] RectTransform m_OffShow; |
| | | [SerializeField] Vector2 m_OnHandleOffset; |
| | | [SerializeField] Vector2 m_OffHandleOffset; |
| | | |
| | | bool m_IsOn = false; |
| | | public bool isOn { |
| | | get { return m_IsOn; } |
| | | set { |
| | | m_IsOn = value; |
| | | SwitchShowState(m_IsOn); |
| | | } |
| | | } |
| | | |
| | | public void AddListener(UnityAction _action) |
| | | { |
| | | if (m_Button != null) |
| | | { |
| | | m_Button.AddListener(_action); |
| | | } |
| | | } |
| | | |
| | | public void RemoveAllListeners() |
| | | { |
| | | if (m_Button != null) |
| | | { |
| | | m_Button.RemoveAllListeners(); |
| | | } |
| | | } |
| | | |
| | | private void SwitchShowState(bool _isOn) |
| | | { |
| | | m_Handle.anchoredPosition = _isOn ? m_OnHandleOffset : m_OffHandleOffset; |
| | | m_BackGround.SetSprite(_isOn ? "SettingUpWin_NO" : "SettingUpWin_OFF"); |
| | | m_OnShow.gameObject.SetActive(_isOn); |
| | | m_OffShow.gameObject.SetActive(!_isOn); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: dd8929af600e643478d3f0a22d7e3c52 |
| | | timeCreated: 1535009068 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |