Ejemplo n.º 1
0
        override public void SetupPane()
        {
            this.resolutionBox               = new CustomComboBox(SUNSHAFTS_RESOLUTIONS);
            this.resolutionBox.Text          = Translation.GetText("SunShafts", "resolution");
            this.resolutionBox.SelectedIndex = (int)SunShaftsDef.sunShaftsEffect.resolution;
            this.ChildControls.Add(this.resolutionBox);
            this.screenBlendModeBox               = new CustomComboBox(SUNSHAFTS_BLENDMODES);
            this.screenBlendModeBox.Text          = Translation.GetText("SunShafts", "screenBlendMode");
            this.screenBlendModeBox.SelectedIndex = (int)SunShaftsDef.sunShaftsEffect.screenBlendMode;
            this.ChildControls.Add(this.screenBlendModeBox);

            this.useDepthTextureCheckbox      = new CustomToggleButton(SunShaftsDef.sunShaftsEffect.useDepthTexture, "toggle");
            this.useDepthTextureCheckbox.Text = Translation.GetText("SunShafts", "useDepthTexture");
            this.ChildControls.Add(this.useDepthTextureCheckbox);

            this.dragSourceButton        = new CustomButton();
            this.dragSourceButton.Text   = Translation.GetText("UI", "dragSource");
            this.dragSourceButton.Click += (o, e) => {
                if (SunShaftsDef.isDrag)
                {
                    SunShaftsDef.StoptDrag();
                }
                else
                {
                    SunShaftsDef.StartDrag();
                }
            };
            this.ChildControls.Add(this.dragSourceButton);

            this.sunColorPicker        = new CustomColorPicker(SunShaftsDef.sunShaftsEffect.sunColor);
            this.sunColorPicker.Text   = Translation.GetText("SunShafts", "sunColor");
            this.sunColorPicker.IsRGBA = false;
            this.ChildControls.Add(this.sunColorPicker);

            this.maxRadiusSlider      = new CustomSlider(SunShaftsDef.sunShaftsEffect.maxRadius, 0f, 1f, 4);
            this.maxRadiusSlider.Text = Translation.GetText("SunShafts", "maxRadius");
            this.ChildControls.Add(this.maxRadiusSlider);

            this.sunShaftBlurRadiusSlider      = new CustomSlider(SunShaftsDef.sunShaftsEffect.sunShaftBlurRadius, -40f, 40, 2);
            this.sunShaftBlurRadiusSlider.Text = Translation.GetText("SunShafts", "sunShaftBlurRadius");
            this.ChildControls.Add(this.sunShaftBlurRadiusSlider);
            this.radialBlurIterationsSlider      = new CustomSlider(SunShaftsDef.sunShaftsEffect.radialBlurIterations, 0f, 10f, 0);
            this.radialBlurIterationsSlider.Text = Translation.GetText("SunShafts", "radialBlurIterations");
            this.ChildControls.Add(this.radialBlurIterationsSlider);
            this.sunShaftIntensitySlider      = new CustomSlider(SunShaftsDef.sunShaftsEffect.sunShaftIntensity, 0f, 20f, 2);
            this.sunShaftIntensitySlider.Text = Translation.GetText("SunShafts", "sunShaftIntensity");
            this.ChildControls.Add(this.sunShaftIntensitySlider);

            this.useSkyBoxAlphaSlider      = new CustomSlider(SunShaftsDef.sunShaftsEffect.useSkyBoxAlpha, 0f, 50f, 2);
            this.useSkyBoxAlphaSlider.Text = Translation.GetText("SunShafts", "useSkyBoxAlpha");
            this.ChildControls.Add(this.useSkyBoxAlphaSlider);
        }
        ///-------------------------------------------------------------------------
        /// <summary>GUI処理</summary>
        ///-------------------------------------------------------------------------
        public void OnGUI()
        {
            try
            {
                // 機能有効の場合
                // if( this.Enable )

                this.envView.ShowGizmos(GizmoRender.UIVisible);

                if (GizmoRender.UIVisible)
                {
                    // 補助キーの押下有無確認
                    bool isCtrl  = Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl);
                    bool isShift = Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift);
                    bool isAlt   = Input.GetKey(KeyCode.LeftAlt) || Input.GetKey(KeyCode.RightAlt);

                    // 表示中
                    if (this.modeSelectView.SelectedMode != ConstantValues.EditMode.Disable)
                    {
                        float windowWidth = Screen.width / 4 - ControlBase.FixedMargin * 2;

                        // Vector2 point = new Vector2( Input.mousePosition.x, Screen.height - Input.mousePosition.y );
                        Rect pluginPos = new Rect(Screen.width - windowWidth, Screen.height / 15 + ControlBase.FixedMargin, Screen.width / 5 - Screen.width / 65, Screen.height - Screen.height / 5);

                        // プラグイン画面の外にある場合、かつ補助キーを押下していない場合
                        // bool isEnableControl = ( pluginPos.Contains( point ) == false && ( isCtrl == false && isShift == false && isAlt == false ) );
                        // GameMain.Instance.MainCamera.SetControl( isEnableControl );
                        // UICamera.InputEnable = isEnableControl;

                        // モード選択ウィンドウ
                        this.modeSelectView.OnGUI();

                        // メイド設定中
                        if (this.modeSelectView.SelectedMode == ConstantValues.EditMode.Effect)
                        {
                            // メイド設定ウィンドウ
                            this.effectView.rectGui.x     = this.modeSelectView.Left;
                            this.effectView.rectGui.y     = this.modeSelectView.Top + this.modeSelectView.Height + ControlBase.FixedMargin;
                            this.effectView.Left          = 0;
                            this.effectView.Top           = 0;
                            this.effectView.Width         = this.modeSelectView.Width;
                            this.effectView.rectGui.width = this.effectView.Width;
                            this.effectView.OnGUI();
                        }
                        // 環境設定中
                        else if (this.modeSelectView.SelectedMode == ConstantValues.EditMode.Environment)
                        {
                            // 環境設定ウィンドウ
                            this.envView.rectGui.x     = this.modeSelectView.Left;
                            this.envView.rectGui.y     = this.modeSelectView.Top + this.modeSelectView.Height + ControlBase.FixedMargin;
                            this.envView.Left          = 0;
                            this.envView.Top           = 0;
                            this.envView.Width         = this.modeSelectView.Width;
                            this.envView.rectGui.width = this.envView.Width;
                            this.envView.OnGUI();
                        }
                        else if (this.modeSelectView.SelectedMode == ConstantValues.EditMode.Data)
                        {
                            // 環境設定ウィンドウ
                            this.dataView.rectGui.x     = this.modeSelectView.Left;
                            this.dataView.rectGui.y     = this.modeSelectView.Top + this.modeSelectView.Height + ControlBase.FixedMargin;
                            this.dataView.Left          = 0;
                            this.dataView.Top           = 0;
                            this.dataView.Width         = this.modeSelectView.Width;
                            this.dataView.rectGui.width = this.dataView.Width;
                            this.dataView.OnGUI();
                        }

                        // update external windows
                        // only one of these are ever needed at a time
                        GlobalComboBox.Update();
                        GlobalColorPicker.Update();
                        GlobalCurveWindow.Update();
                        GlobalItemPicker.Update();
                        GlobalTexturePicker.Update();

                        // Update
                        SunShaftsDef.Update();
                    }
                    else
                    {
                        // 補助キーを押下していない場合
                        bool isEnableControl = (isCtrl == false && isShift == false && isAlt == false);
                        GameMain.Instance.MainCamera.SetControl(isEnableControl);
                        UICamera.InputEnable = isEnableControl;
                    }
                }
                // else
                // {
                //     GameMain.Instance.MainCamera.SetControl( true );
                //     UICamera.InputEnable = true;
                // }
            }
            catch (Exception e)
            {
                Debug.LogError(e.ToString());
            }
        }
Ejemplo n.º 3
0
        override public void Update()
        {
            try
            {
                if (Instances.needEffectWindowReload)
                {
                    this.ChildControls.Clear();
                    this.Awake();
                }

                ColorCorrectionCurvesDef.Update(this.colorCorrectionCurvesPane);
                SepiaDef.Update(this.sepiaPane);
                GrayscaleDef.Update(this.grayscalePane);
                ContrastDef.Update(this.contrastPane);
                EdgeDetectDef.Update(this.edgeDetectPane);
                // SSAODef.Update(this.ssaoPane);
                CreaseDef.Update(this.creasePane);
                AntialiasingDef.Update(this.antialiasingPane);
                NoiseAndGrainDef.Update(this.noiseAndGrainPane);
                BlurDef.Update(this.blurPane);
                DepthOfFieldDef.Update(this.depthOfFieldPane);
                MotionBlurDef.Update(this.motionBlurPane);
                BloomDef.Update(this.bloomPane);
                GlobalFogDef.Update(this.globalFogPane);
                TiltShiftHdrDef.Update(this.tiltShiftHdrPane);
                FisheyeDef.Update(this.fisheyePane);
                VignettingDef.Update(this.vignettingPane);
                SunShaftsDef.Update(this.sunShaftsPane);
                LensDistortionBlurDef.Update(this.lensDistortionBlurPane);
                LetterboxDef.Update(this.letterboxPane);
                HueFocusDef.Update(this.hueFocusPane);
                ChannelSwapDef.Update(this.channelSwapPane);
                TechnicolorDef.Update(this.technicolorPane);
                DynamicLookupDef.Update(this.dynamicLookupPane);
                AnalogGlitchDef.Update(this.analogGlitchPane);
                DigitalGlitchDef.Update(this.digitalGlitchPane);
                BokehDef.Update(this.bokehPane);
                ObscuranceDef.Update(this.obscurancePane);
                AnalogTVDef.Update(this.analogTVPane);
                BleachBypassDef.Update(this.bleachBypassPane);
                BlendDef.Update(this.blendPane);
                BrightnessContrastGammaDef.Update(this.brightnessContrastGammaPane);
                ChannelMixerDef.Update(this.channelMixerPane);
                ComicBookDef.Update(this.comicBookPane);
                ContrastVignetteDef.Update(this.contrastVignettePane);
                Convolution3x3Def.Update(this.convolution3x3Pane);
                DoubleVisionDef.Update(this.doubleVisionPane);
                HalftoneDef.Update(this.halftonePane);
                IsolineDef.Update(this.isolinePane);
                KuwaharaDef.Update(this.kuwaharaPane);
                LookupFilterDef.Update(this.lookupFilterPane);
                PixelateDef.Update(this.pixelatePane);
                RGBSplitDef.Update(this.rgbSplitPane);
                ShadowsMidtonesHighlightsDef.Update(this.shadowsMidtonesHighlightsPane);
                WaveDistortionDef.Update(this.waveDistortionPane);
                WhiteBalanceDef.Update(this.whiteBalancePane);
                WiggleDef.Update(this.wigglePane);

                if (Instances.needEffectWindowReload)
                {
                    Instances.needEffectWindowReload = false;
                }
            }

            catch (Exception e)
            {
                Debug.LogError(e.ToString());
            }
        }