Пример #1
0
        private void ShowDefaultRecommendCompleteConfig()
        {
            this.EnableAllConfigBtns(false);
            GraphicsRecommendGrade graphicsRecommendGrade = GraphicsSettingData.GetGraphicsRecommendGrade();

            this.ShowRecommendCompleteConfig(graphicsRecommendGrade);
        }
Пример #2
0
 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);
         }
     }
 }
Пример #3
0
        private void ShowRecommendMark()
        {
            GraphicsRecommendGrade graphicsRecommendGrade = GraphicsSettingData.GetGraphicsRecommendGrade();

            for (int i = 0; i < (this.grades.Length - 1); i++)
            {
                Transform transform = this.grades[i];
                transform.FindChild("Recommend").gameObject.SetActive(false);
            }
            Transform transform2 = this.grades[(int)graphicsRecommendGrade];

            transform2.FindChild("Recommend").gameObject.SetActive(true);
        }
Пример #4
0
        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();
        }