public void SetupView(bool inLevelSimpleSetting = false) { this.isInLevelSimpleSetting = inLevelSimpleSetting; this._modifiedPersonalSetting = new ConfigGraphicsPersonalSetting(); GraphicsSettingData.CopyPersonalGraphicsConfig(ref this._modifiedPersonalSetting); this.ResetView(); }
private void TriggerGoodsAttachEffectPattern(MonoGoods entity) { if (!string.IsNullOrEmpty(entity.AttachEffectPattern)) { bool flag = true; switch (GraphicsSettingData.GetGraphicsRecommendGrade()) { case GraphicsRecommendGrade.Off: case GraphicsRecommendGrade.Low: { ConfigGraphicsPersonalSetting personalGraphicsSetting = Singleton <MiHoYoGameData> .Instance.GeneralLocalData.PersonalGraphicsSetting; if (!personalGraphicsSetting.IsUserDefinedGrade) { flag = false; } else if (personalGraphicsSetting.RecommendGrade != GraphicsRecommendGrade.High) { flag = false; } break; } } if (flag) { Singleton <EffectManager> .Instance.TriggerEntityEffectPattern(entity.AttachEffectPattern, entity, true); } } }
public static bool IsEqualToPersonalConfigIgnoreContrast(ConfigGraphicsPersonalSetting to) { ConfigGraphicsPersonalSetting personalGraphicsSetting = Singleton <MiHoYoGameData> .Instance.GeneralLocalData.PersonalGraphicsSetting; if (personalGraphicsSetting.IsEcoMode != to.IsEcoMode) { return(false); } return((personalGraphicsSetting.IsEcoMode && to.IsEcoMode) || ((((!personalGraphicsSetting.IsUserDefinedGrade && !to.IsUserDefinedGrade) && (!personalGraphicsSetting.IsUserDefinedVolatile && !to.IsUserDefinedVolatile)) || ((personalGraphicsSetting.IsUserDefinedGrade && to.IsUserDefinedGrade) && (personalGraphicsSetting.RecommendGrade == to.RecommendGrade))) || (((((personalGraphicsSetting.IsUserDefinedVolatile && to.IsUserDefinedVolatile) && ((personalGraphicsSetting.ResolutionQuality == to.ResolutionQuality) && (personalGraphicsSetting.TargetFrameRate == to.TargetFrameRate))) && (((personalGraphicsSetting.VolatileSetting.PostFXGrade == to.VolatileSetting.PostFXGrade) && (personalGraphicsSetting.VolatileSetting.UseDistortion == to.VolatileSetting.UseDistortion)) && ((personalGraphicsSetting.VolatileSetting.UseDynamicBone == to.VolatileSetting.UseDynamicBone) && (personalGraphicsSetting.VolatileSetting.UseFXAA == to.VolatileSetting.UseFXAA)))) && ((personalGraphicsSetting.VolatileSetting.UseHDR == to.VolatileSetting.UseHDR) && (personalGraphicsSetting.VolatileSetting.UsePostFX == to.VolatileSetting.UsePostFX))) && (personalGraphicsSetting.VolatileSetting.UseReflection == to.VolatileSetting.UseReflection)))); }
public static void CopyPersonalGraphicsConfig(bool isEcoMode, ref ConfigGraphicsPersonalSetting to) { ConfigGraphicsPersonalSetting personalGraphicsSetting = Singleton <MiHoYoGameData> .Instance.GeneralLocalData.PersonalGraphicsSetting; if (isEcoMode) { CopyToPersonalGraphicsConfig(GetGraphicsEcoModeConfig(), ref to); to.IsUserDefinedGrade = personalGraphicsSetting.IsUserDefinedGrade; to.IsUserDefinedVolatile = personalGraphicsSetting.IsUserDefinedVolatile; } else if (personalGraphicsSetting.IsUserDefinedGrade && personalGraphicsSetting.IsUserDefinedVolatile) { UnityEngine.Debug.LogError("IsUserDefinedGrade and IsUserDefinedVolatile both true"); } else if (!personalGraphicsSetting.IsUserDefinedGrade && !personalGraphicsSetting.IsUserDefinedVolatile) { CopyToPersonalGraphicsConfig(GetGraphicsRecommendCompleteConfig(), ref to); to.IsUserDefinedGrade = false; to.IsUserDefinedVolatile = false; } else if (personalGraphicsSetting.IsUserDefinedGrade) { CopyToPersonalGraphicsConfig(GetGraphicsRecommendCompleteConfig(personalGraphicsSetting.RecommendGrade), ref to); to.RecommendGrade = personalGraphicsSetting.RecommendGrade; to.IsUserDefinedGrade = true; to.IsUserDefinedVolatile = false; } else { ConfigGraphicsRecommendSetting graphicsRecommendConfig = GetGraphicsRecommendConfig(); to.PostFxGradeBufferSize = graphicsRecommendConfig.PostFxGradeBufferSize; to.RecommendResolutionX = graphicsRecommendConfig.RecommendResolutionX; to.RecommendResolutionY = graphicsRecommendConfig.RecommendResolutionY; to.ResolutionPercentage = graphicsRecommendConfig.ResolutionPercentage; to.ResolutionQuality = personalGraphicsSetting.ResolutionQuality; to.TargetFrameRate = personalGraphicsSetting.TargetFrameRate; to.ContrastDelta = 0f; to.VolatileSetting = new ConfigGraphicsVolatileSetting(); CopyGraphicsVolatileConfig(personalGraphicsSetting.VolatileSetting, ref to.VolatileSetting); to.RecommendGrade = personalGraphicsSetting.RecommendGrade; to.IsUserDefinedGrade = false; to.IsUserDefinedVolatile = true; } to.IsEcoMode = isEcoMode; }
private static ConfigGraphicsSetting GetGraphicsEcoModeConfig(string platformName) { if (!_recommendSettingGroupMap.ContainsKey(platformName)) { return(null); } bool flag = false; ConfigGraphicsRecommendSetting config = _recommendSettingGroupMap[platformName].GetConfig <ConfigGraphicsRecommendSetting>("EcoMode"); if (config == null) { flag = true; config = (ConfigGraphicsRecommendSetting)_recommendSettingGroupMap[platformName].Default; } ConfigGraphicsSetting setting2 = new ConfigGraphicsSetting { PostFxGradeBufferSize = config.PostFxGradeBufferSize, RecommendResolutionX = config.RecommendResolutionX, RecommendResolutionY = config.RecommendResolutionY, ResolutionPercentage = config.ResolutionPercentage, ResolutionQuality = !flag ? config.ResolutionQuality : ResolutionQualityGrade.Low, TargetFrameRate = !flag ? config.TargetFrameRate : 30, ContrastDelta = 0f }; ConfigGraphicsVolatileSetting from = _recommendVolatileSettingGroup.GetConfig <ConfigGraphicsVolatileSetting>((!flag ? config.RecommendGrade : GraphicsRecommendGrade.Off).ToString()); setting2.VolatileSetting = new ConfigGraphicsVolatileSetting(); CopyGraphicsVolatileConfig(from, ref setting2.VolatileSetting); GraphicsRecommendGrade graphicsRecommendGrade = GetGraphicsRecommendGrade(); setting2.VolatileSetting.UsePostFX = graphicsRecommendGrade >= GraphicsRecommendGrade.High; setting2.VolatileSetting.UseHDR = graphicsRecommendGrade >= GraphicsRecommendGrade.High; ConfigGraphicsPersonalSetting personalGraphicsSetting = Singleton <MiHoYoGameData> .Instance.GeneralLocalData.PersonalGraphicsSetting; if (personalGraphicsSetting.IsUserDefinedVolatile && !personalGraphicsSetting.VolatileSetting.UsePostFX) { setting2.VolatileSetting.UsePostFX = false; } if (personalGraphicsSetting.IsUserDefinedVolatile && !personalGraphicsSetting.VolatileSetting.UseHDR) { setting2.VolatileSetting.UseHDR = false; } return(setting2); }
public static ConfigGraphicsSetting GetGraphicsPersonalSettingConfig(ConfigGraphicsPersonalSetting personalSetting) { if (personalSetting.IsUserDefinedGrade && personalSetting.IsUserDefinedVolatile) { UnityEngine.Debug.LogError("IsUserDefinedGrade and IsUserDefinedVolatile both true"); return(null); } if (!personalSetting.IsUserDefinedGrade && !personalSetting.IsUserDefinedVolatile) { return(GetGraphicsRecommendCompleteConfig()); } if (personalSetting.IsUserDefinedGrade) { return(GetGraphicsRecommendCompleteConfig(personalSetting.RecommendGrade)); } ConfigGraphicsRecommendSetting graphicsRecommendConfig = GetGraphicsRecommendConfig(); personalSetting.PostFxGradeBufferSize = graphicsRecommendConfig.PostFxGradeBufferSize; personalSetting.RecommendResolutionX = graphicsRecommendConfig.RecommendResolutionX; personalSetting.RecommendResolutionY = graphicsRecommendConfig.RecommendResolutionY; personalSetting.ResolutionPercentage = graphicsRecommendConfig.ResolutionPercentage; return(personalSetting); }
protected override void Update() { float num; if (!this.actDropAnim) { num = (Time.deltaTime * 100f) * this.TimeScale; } else if (this.actDropAnim && !this.dropAnimFinished) { num = (Time.deltaTime * this._selfRotateSpeed) * this.TimeScale; this.CheckBarrierCollider(); } else { this._selfRotateAcceleration = (this._selfRotateAcceleration >= 10f) ? (this._selfRotateAcceleration - 3f) : 10f; this._selfRotateSpeed = (this._selfRotateSpeed >= 100f) ? (this._selfRotateSpeed - this._selfRotateAcceleration) : 100f; num = (Time.deltaTime * this._selfRotateSpeed) * this.TimeScale; } base.transform.Rotate(base.transform.up, num); if (this._state == GoodsState.Appear) { this._state = GoodsState.Idle; } else if (((this._state == GoodsState.Idle) && (base.transform.position.y <= 0.3f)) && ((this._rigidbody != null) && (this._rigidbody.velocity.y <= 0f))) { if (this.reboundTimes > 0) { this._rigidbody.velocity = new Vector3(this._rigidbody.velocity.x, -0.8f * this._rigidbody.velocity.y, this._rigidbody.velocity.z); this.reboundTimes--; } else if (!this.dropAnimFinished) { this.dropAnimFinished = true; UnityEngine.Object.Destroy(this._rigidbody); this._rigidbody = null; base.transform.SetLocalPositionY(0.3f); if (!string.IsNullOrEmpty(this.AttachEffectPattern) && (Singleton <EventManager> .Instance.GetActor <EquipItemActor>(base.GetRuntimeID()) != null)) { bool flag = true; switch (GraphicsSettingData.GetGraphicsRecommendGrade()) { case GraphicsRecommendGrade.Off: case GraphicsRecommendGrade.Low: { ConfigGraphicsPersonalSetting personalGraphicsSetting = Singleton <MiHoYoGameData> .Instance.GeneralLocalData.PersonalGraphicsSetting; if (!personalGraphicsSetting.IsUserDefinedGrade) { flag = false; } else if (personalGraphicsSetting.RecommendGrade != GraphicsRecommendGrade.High) { flag = false; } break; } } if (flag) { int rarity = Singleton <EventManager> .Instance.GetActor <EquipItemActor>(base.GetRuntimeID()).rarity; this.effects = Singleton <EffectManager> .Instance.TriggerEntityEffectPatternReturnValue(this.AttachEffectPattern, this, true); int num3 = 0; int count = this.OutsideEffects.Count; while (num3 < count) { this.SetOutsideParticleColorByRarity(this.OutsideEffects[num3].gameObject, rarity); num3++; } } } } } BaseMonoAvatar localAvatar = Singleton <AvatarManager> .Instance.GetLocalAvatar(); if (this._state == GoodsState.Idle) { if (this.dropAnimFinished || (this.reboundTimes <= 0)) { float property = localAvatar.GetProperty("Actor_GoodsAttrackRadius"); property = Mathf.Clamp(property, 0f, property); this.attractRadius = localAvatar.config.CommonArguments.GoodsAttractRadius * property; if (Vector3.Distance(this.XZPosition, localAvatar.XZPosition) < this.attractRadius) { this._state = GoodsState.Attract; this.attractTimer.SetActive(false); if (!string.IsNullOrEmpty(this.AttachEffectPattern) && (Singleton <EventManager> .Instance.GetActor <EquipItemActor>(base.GetRuntimeID()) != null)) { foreach (MonoEffect effect in this.effects) { if (effect != null) { effect.SetDestroyImmediately(); } } } } } } else if ((this._state == GoodsState.Attract) || this.forceFlyToAvatar) { this.speed += (this.acceleration * this.TimeScale) * Time.deltaTime; this.speed = (this.speed >= 20f) ? 20f : this.speed; Vector3 vector7 = localAvatar.RootNodePosition - base.transform.position; Vector3 vector = (Vector3)((vector7.normalized * this.speed) * this.TimeScale); Transform transform = base.transform; transform.position += (Vector3)(vector * Time.deltaTime); this.attractTimer.Core(1f); if ((Vector3.Distance(this.XZPosition, localAvatar.XZPosition) < localAvatar.config.CommonArguments.CollisionRadius) || this.attractTimer.isTimeUp) { this.OnTriggerEnter(localAvatar.hitbox); } } base.Update(); }
public static void CopyPersonalGraphicsConfig(ref ConfigGraphicsPersonalSetting to) { CopyPersonalGraphicsConfig(Singleton <MiHoYoGameData> .Instance.GeneralLocalData.PersonalGraphicsSetting.IsEcoMode, ref to); }
public static void CopyToPersonalGraphicsConfig(ConfigGraphicsSetting setting, ref ConfigGraphicsPersonalSetting to) { ConfigGraphicsRecommendSetting graphicsRecommendConfig = GetGraphicsRecommendConfig(); to.PostFxGradeBufferSize = graphicsRecommendConfig.PostFxGradeBufferSize; to.RecommendResolutionX = graphicsRecommendConfig.RecommendResolutionX; to.RecommendResolutionY = graphicsRecommendConfig.RecommendResolutionY; to.ResolutionPercentage = graphicsRecommendConfig.ResolutionPercentage; to.ResolutionQuality = setting.ResolutionQuality; to.TargetFrameRate = setting.TargetFrameRate; to.ContrastDelta = setting.ContrastDelta; to.VolatileSetting = new ConfigGraphicsVolatileSetting(); CopyGraphicsVolatileConfig(setting.VolatileSetting, ref to.VolatileSetting); }