コード例 #1
0
        private bool OnPlayerLoginRsp(PlayerLoginRsp rsp)
        {
            if (rsp.get_retcode() == null)
            {
                MonoTestUI sceneCanvas = Singleton <MainUIManager> .Instance.SceneCanvas as MonoTestUI;
                if (sceneCanvas.avatar3dModelContext != null)
                {
                    return(false);
                }
                sceneCanvas.MainCamera.SetActive(true);
                sceneCanvas.MainMenu_SpaceShip.SetActive(true);
                sceneCanvas.avatar3dModelContext = new Avatar3dModelContext(null);
                Singleton <MainUIManager> .Instance.ShowWidget(sceneCanvas.avatar3dModelContext, UIType.Root);

                GameObject            view         = GameObject.Find("MainMenu_SpaceShip");
                GameObject            uiMainCamera = GameObject.Find("MainCamera");
                SpaceShipModelContext widget       = new SpaceShipModelContext(view, uiMainCamera);
                Singleton <MainUIManager> .Instance.ShowWidget(widget, UIType.Any);

                GraphicsSettingData.ApplySettingConfig();
                AudioSettingData.ApplySettingConfig();
                this.TestCode(sceneCanvas);
            }
            else
            {
                GeneralDialogContext dialogContext = new GeneralDialogContext {
                    type  = GeneralDialogContext.ButtonType.SingleButton,
                    title = LocalizationGeneralLogic.GetText("Menu_Title_Tips", new object[0]),
                    desc  = LocalizationGeneralLogic.GetNetworkErrCodeOutput(rsp.get_retcode(), new object[0]),
                    notDestroyAfterTouchBG = true
                };
                Singleton <MainUIManager> .Instance.ShowDialog(dialogContext, UIType.Any);
            }
            return(false);
        }
コード例 #2
0
        public void Start()
        {
            Singleton <LevelManager> .Instance.InitAtStart();

            GraphicsSettingData.ApplySettingConfig();
            AudioSettingData.ApplySettingConfig();
        }
コード例 #3
0
ファイル: MonoSettingImageTab.cs プロジェクト: slb1988/agame
 public void SetupView()
 {
     base.transform.FindChild("Content/RT/3dModel").GetComponent <MonoGammaSettingRenderImage>().SetupView();
     GraphicsSettingData.ApplyPersonalContrastDelta();
     this._contrastSlider = base.transform.FindChild("Content/Contrast/Slider").GetComponent <Slider>();
     this.RecoverOriginState();
 }
コード例 #4
0
        private void ShowDefaultRecommendCompleteConfig()
        {
            this.EnableAllConfigBtns(false);
            GraphicsRecommendGrade graphicsRecommendGrade = GraphicsSettingData.GetGraphicsRecommendGrade();

            this.ShowRecommendCompleteConfig(graphicsRecommendGrade);
        }
コード例 #5
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);
         }
     }
 }
コード例 #6
0
        private void ShowRecommendCompleteConfig(GraphicsRecommendGrade grade)
        {
            this.ShowRecommendGradeInfo(grade);
            ConfigGraphicsSetting graphicsRecommendCompleteConfig = GraphicsSettingData.GetGraphicsRecommendCompleteConfig(grade);

            this.ShowGraphicsSettingConfig(graphicsRecommendCompleteConfig, true);
        }
コード例 #7
0
 public void SetupView(bool inLevelSimpleSetting = false)
 {
     this.isInLevelSimpleSetting   = inLevelSimpleSetting;
     this._modifiedPersonalSetting = new ConfigGraphicsPersonalSetting();
     GraphicsSettingData.CopyPersonalGraphicsConfig(ref this._modifiedPersonalSetting);
     this.ResetView();
 }
コード例 #8
0
        private void ShowEcoModeConfig()
        {
            this.EnableAllConfigBtns(false);
            this.ShowEcoModeGradeInfo();
            ConfigGraphicsSetting graphicsEcoModeConfig = GraphicsSettingData.GetGraphicsEcoModeConfig();

            this.ShowGraphicsSettingConfig(graphicsEcoModeConfig, true);
        }
コード例 #9
0
ファイル: MonoSettingImageTab.cs プロジェクト: slb1988/agame
        private void RecoverOriginState()
        {
            GraphicsSettingData.ApplyPersonalContrastDelta();
            GraphicsSettingData.CopyPersonalContrastDelta(ref this._contrastDelta);
            int showValue = ((int)((((float)(this._contrastShowMaxValue - this._contrastShowMinValue)) / 2f) * (this._contrastDelta + 1f))) + this._contrastShowMinValue;

            this._contrastSlider.value = showValue;
            this.ShowContrast(showValue);
        }
コード例 #10
0
 private void Start()
 {
     Input.gyro.enabled     = GraphicsSettingData.IsEnableGyroscope();
     this._bEnable          = true;
     this._cameraSM         = base.GetComponent <MonoIslandCameraSM>();
     this.baseAttitude      = this.GetInputGyroAttitude();
     this.referenceAttitude = base.transform.rotation;
     this._gyroRot          = base.transform.rotation;
 }
コード例 #11
0
        public void SwitchEcoMode()
        {
            GraphicsSettingData.CopyPersonalGraphicsConfig(!this._modifiedPersonalSetting.IsEcoMode, ref this._modifiedPersonalSetting);
            GraphicsSettingData.SavePersonalConfigIgnoreContrast(this._modifiedPersonalSetting);
            this.ResetView();
            string textID = !this._modifiedPersonalSetting.IsEcoMode ? "Menu_SettingEcoModeOffTip" : "Menu_SettingEcoModeOnTip";

            Singleton <MainUIManager> .Instance.ShowDialog(new GeneralHintDialogContext(LocalizationGeneralLogic.GetText(textID, new object[0]), 2f), UIType.Any);
        }
コード例 #12
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);
        }
コード例 #13
0
ファイル: MonoIslandUICanvas.cs プロジェクト: slb1988/agame
        public override void Start()
        {
            this.buildingDataDict             = new Dictionary <MonoIslandBuilding, CabinDataItemBase>();
            this.buildingDataDict[this.power] = Singleton <IslandModule> .Instance.GetCabinDataByType(1);

            this.buildingDataDict[this.collect] = Singleton <IslandModule> .Instance.GetCabinDataByType(3);

            this.buildingDataDict[this.misc] = Singleton <IslandModule> .Instance.GetCabinDataByType(4);

            this.buildingDataDict[this.mission] = Singleton <IslandModule> .Instance.GetCabinDataByType(5);

            this.buildingDataDict[this.kianaEnhance] = Singleton <IslandModule> .Instance.GetCabinDataByType(2);

            this.buildingDataDict[this.meiEnhance] = Singleton <IslandModule> .Instance.GetCabinDataByType(6);

            this.buildingDataDict[this.bronyaEnhance] = Singleton <IslandModule> .Instance.GetCabinDataByType(7);

            this.SetupBuildings();
            this.playerBar = new PlayerStatusWidgetContext();
            Singleton <MainUIManager> .Instance.ShowWidget(this.playerBar, UIType.Any);

            CabinDetailPageContext context = new CabinDetailPageContext(this.buildingDataDict[this.power], true)
            {
                EnableTutorial = false
            };

            Singleton <MainUIManager> .Instance.ShowPage(context, UIType.Page);

            context.Destroy();
            CabinOverviewPageContext context2 = new CabinOverviewPageContext(this.buildingDataDict[this.power], this.buildingDataDict)
            {
                EnableTutorial = false
            };

            Singleton <MainUIManager> .Instance.ShowPage(context2, UIType.Page);

            context2.Destroy();
            this.islandMainPage.SetActive(true);
            this.mainPageContext = new IslandMainPageContext(this.islandMainPage, this.buildingDataDict);
            Singleton <MainUIManager> .Instance.ShowPage(this.mainPageContext, UIType.Page);

            this.mainPageContext.view.name = "IslandMainPageContext";
            GraphicsSettingData.ApplySettingConfig();
            AudioSettingData.ApplySettingConfig();
            this.TriggerFullScreenBlock(false);
            Singleton <NotifyManager> .Instance.FireNotify(new Notify(NotifyTypes.DestroyLoadingScene, null));

            base.Start();
        }
コード例 #14
0
ファイル: MainCameraStoryState.cs プロジェクト: slb1988/agame
        public override void Enter()
        {
            Singleton <AvatarManager> .Instance.SetMuteAllAvatarControl(true);

            Singleton <MainUIManager> .Instance.GetInLevelUICanvas().mainPageContext.SetInLevelMainPageActive(false, false, false);

            this.avatar = Singleton <AvatarManager> .Instance.GetLocalAvatar();

            this.SetOtherAvatarsVisibility(false);
            this.avatar.PlayState("StandBy");
            this.avatar.SetLocomotionBool("IsStoryMode", true, false);
            this.anchorRadius = this.avatar.config.StoryCameraSetting.anchorRadius;
            this.yaw          = this.avatar.config.StoryCameraSetting.yaw;
            this.pitch        = this.avatar.config.StoryCameraSetting.pitch;
            this.yOffset      = this.avatar.config.StoryCameraSetting.yOffset;
            this.xOffset      = this.avatar.config.StoryCameraSetting.xOffset;
            this.fov          = this.avatar.config.StoryCameraSetting.fov;
            Vector3 axis = Vector3.Cross(this.avatar.FaceDirection, Vector3.up);

            base.cameraForward  = (Vector3)(Quaternion.AngleAxis(this.yaw, Vector3.up) * this.avatar.FaceDirection);
            base.cameraForward  = (Vector3)(Quaternion.AngleAxis(this.pitch, axis) * base.cameraForward);
            base.cameraPosition = (Vector3)(((this.avatar.XZPosition - (base.cameraForward * this.anchorRadius)) + (Vector3.up * this.yOffset)) + (axis * this.xOffset));
            base.cameraFOV      = this.fov;
            this._storyScreenID = Singleton <DynamicObjectManager> .Instance.CreateStoryScreen(this.avatar.GetRuntimeID(), "StoryScreen", this.avatar.XZPosition + this.avatar.FaceDirection, this.avatar.FaceDirection, this._currentPlotID);

            this.avatar.SetLocomotionBool("IsStoryMode", true, false);
            Singleton <LevelDesignManager> .Instance.SetMuteAvatarVoice(true);

            MonoStoryScreen dynamicObjectByRuntimeID = (MonoStoryScreen)Singleton <DynamicObjectManager> .Instance.GetDynamicObjectByRuntimeID(this._storyScreenID);

            if (dynamicObjectByRuntimeID != null)
            {
                dynamicObjectByRuntimeID.onOpenAnimationChange = (Action <bool>)Delegate.Combine(dynamicObjectByRuntimeID.onOpenAnimationChange, new Action <bool>(this.OnOpenAnimationChange));
            }
            if (this.blurDataLoaded)
            {
                Singleton <CameraManager> .Instance.GetMainCamera().SetCameraFakeDOFCustommed(this.blurEnterCurve, this.blurEnterDuration);
            }
            this._gyro         = Input.gyro;
            this._gyro.enabled = GraphicsSettingData.IsEnableGyroscope();
            this.SetAllOtherDynamicObjectsAndEfffectsVisibility(false);
            this._baseAttitude = this._gyro.attitude;
            this._baseGravity  = this._gyro.gravity;
            if (this._pauseLevel)
            {
                Singleton <LevelManager> .Instance.SetPause(true);
            }
        }
コード例 #15
0
        public void OnRecommendGradeBtnClick(int index)
        {
            GraphicsRecommendGrade grade = (GraphicsRecommendGrade)index;

            if ((this._modifiedPersonalSetting.IsEcoMode || !this._modifiedPersonalSetting.IsUserDefinedGrade) || (grade != this._modifiedPersonalSetting.RecommendGrade))
            {
                this._modifiedPersonalSetting.IsUserDefinedGrade    = true;
                this._modifiedPersonalSetting.IsUserDefinedVolatile = false;
                this._modifiedPersonalSetting.IsEcoMode             = false;
                this._modifiedPersonalSetting.RecommendGrade        = grade;
                GraphicsSettingData.ApplySettingConfig(GraphicsSettingData.GetGraphicsRecommendCompleteConfig(grade));
                this.EnableAllConfigBtns(false);
                this.ShowRecommendCompleteConfig(grade);
                this.SetupEcoMode();
            }
        }
コード例 #16
0
        private void Start()
        {
            Vector3 eulerAngles = base.transform.eulerAngles;

            this.euler.x   = eulerAngles.y;
            this.euler.y   = eulerAngles.x;
            this.euler.y   = Mathf.Repeat(this.euler.y + 180f, 360f) - 180f;
            this.origEuler = this.euler;
            this.origRot   = this.targetRot = base.transform.rotation;
            if (this.target != null)
            {
                base.transform.position = this.target.position - ((Vector3)(base.transform.forward * this.Distance));
            }
            this.state = State.Idle;
            GameObject obj2 = GameObject.Find("MainMenu_SpaceShip");

            if ((this.pilot1 == null) && (obj2 != null))
            {
                this.pilot1 = obj2.transform.Find("Warship/Warship_ControlDesk01");
            }
            if ((this.pilot2 == null) && (obj2 != null))
            {
                this.pilot2 = obj2.transform.Find("Warship/Warship_ControlDesk02");
            }
            if ((this.pilot3 == null) && (obj2 != null))
            {
                this.pilot3 = obj2.transform.Find("Warship/Warship_ControlDesk03");
            }
            if (this.pilot1 != null)
            {
                this.pilotPosition1 = this.pilot1.transform.position;
            }
            if (this.pilot2 != null)
            {
                this.pilotPosition2 = this.pilot2.transform.position;
            }
            if (this.pilot3 != null)
            {
                this.pilotPosition3 = this.pilot3.transform.position;
            }
            this.PilotShakeX.preWrapMode  = WrapMode.Loop;
            this.PilotShakeX.postWrapMode = WrapMode.Loop;
            this.PilotShakeY.preWrapMode  = WrapMode.Loop;
            this.PilotShakeY.postWrapMode = WrapMode.Loop;
            Input.gyro.enabled            = GraphicsSettingData.IsEnableGyroscope();
            this.baseAttitude             = Input.gyro.attitude;
        }
コード例 #17
0
 public void OnPersonalGradeBtnClick()
 {
     this._modifiedPersonalSetting.IsUserDefinedGrade = false;
     if (Singleton <MiHoYoGameData> .Instance.GeneralLocalData.PersonalGraphicsSetting.IsUserDefinedVolatile)
     {
         GraphicsSettingData.CopyPersonalGraphicsConfig(ref this._modifiedPersonalSetting);
     }
     else
     {
         GraphicsSettingData.CopyToPersonalGraphicsConfig(GraphicsSettingData.GetGraphicsRecommendCompleteConfig(), ref this._modifiedPersonalSetting);
     }
     GraphicsSettingData.ApplySettingConfig(GraphicsSettingData.GetGraphicsPersonalSettingConfig(this._modifiedPersonalSetting));
     this._modifiedPersonalSetting.IsUserDefinedVolatile = true;
     this._modifiedPersonalSetting.IsEcoMode             = false;
     this.ShowPersonalConfig();
     this.SetupEcoMode();
 }
コード例 #18
0
 private void ShowPersonalConfig()
 {
     this.EnableAllConfigBtns(true);
     this.ShowPersonalGradeInfo();
     if (!this._modifiedPersonalSetting.IsUserDefinedGrade || !this._modifiedPersonalSetting.IsUserDefinedVolatile)
     {
         if (this._modifiedPersonalSetting.IsUserDefinedGrade || this._modifiedPersonalSetting.IsUserDefinedVolatile)
         {
             if (this._modifiedPersonalSetting.IsUserDefinedGrade)
             {
                 this.ShowRecommendCompleteConfig(this._modifiedPersonalSetting.RecommendGrade);
             }
             else
             {
                 this.ShowGraphicsSettingConfig(this._modifiedPersonalSetting, false);
             }
         }
         else
         {
             ConfigGraphicsSetting graphicsPersonalSettingConfig = GraphicsSettingData.GetGraphicsPersonalSettingConfig(this._modifiedPersonalSetting);
             this.ShowGraphicsSettingConfig(graphicsPersonalSettingConfig, false);
         }
     }
 }
コード例 #19
0
ファイル: MonoGoods.cs プロジェクト: slb1988/agame
        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();
        }
コード例 #20
0
 public void Start()
 {
     this._gyro         = Input.gyro;
     this._gyro.enabled = GraphicsSettingData.IsEnableGyroscope();
 }
コード例 #21
0
 public void OnNoSaveBtnClick()
 {
     GraphicsSettingData.ApplySettingConfig();
     GraphicsSettingData.CopyPersonalGraphicsConfig(ref this._modifiedPersonalSetting);
     this.ResetView();
 }
コード例 #22
0
 public void OnEcoModeBtnClick(bool willBeOn)
 {
     GraphicsSettingData.CopyPersonalGraphicsConfig(willBeOn, ref this._modifiedPersonalSetting);
     this.ResetView();
 }
コード例 #23
0
ファイル: MonoSettingImageTab.cs プロジェクト: slb1988/agame
 public bool CheckNeedSave()
 {
     return(!GraphicsSettingData.IsEqualToPersonalContrastDelta(this._contrastDelta));
 }
コード例 #24
0
 private void Start()
 {
     Input.gyro.enabled     = GraphicsSettingData.IsEnableGyroscope();
     this.baseAttitude      = Input.gyro.attitude;
     this.referenceAttitude = Quaternion.Euler(GameObject.Find("IslandCameraGroup").transform.eulerAngles.x, 0f, 0f);
 }
コード例 #25
0
 public void OnSaveBtnClick()
 {
     GraphicsSettingData.SavePersonalConfigIgnoreContrast(this._modifiedPersonalSetting);
     Singleton <MainUIManager> .Instance.ShowDialog(new GeneralHintDialogContext(LocalizationGeneralLogic.GetText("Menu_SettingSaveSuccess", new object[0]), 2f), UIType.Any);
 }
コード例 #26
0
 public bool CheckNeedSave()
 {
     return(!GraphicsSettingData.IsEqualToPersonalConfigIgnoreContrast(this._modifiedPersonalSetting));
 }