コード例 #1
0
        public void doDrawGUI()
        {
            if (myCameras == null)
            {
                myCameras = getDebugCamera.getDebugPanelCameras();
            }
            GameObject mc;

            if (myCameras.Length == 0)
            {
                mc = null;
            }
            else
            {
                mc = myCameras[0];
            }

            FullScreenEffects fSFX = null;

            if (mc != null)
            {
                fSFX = mc.GetComponent <FullScreenEffects>();
            }

            //#########################################################
            //# Refresh Camera button                                 #
            //#########################################################

            if (GUILayout.Button("Refresh Camera Ref"))
            {
                myCameras = getDebugCamera.getDebugPanelCameras();
            }


            //#########################################################
            //# Ambient Light Colour Picker                           #
            //#########################################################
            Color ambiColour = RenderSettings.ambientLight;

            ambiColour = ambientLightColour.DrawGUI(ambiColour);
            RenderSettings.ambientLight = ambiColour;


            //#####################################################
            //# Gamma, brightness, contrast                       #
            //#####################################################
            GammaLUT glut = mc.GetComponent <GammaLUT>();

            if (glut != null && glut.enabled)
            {
                glut.DrawDebugGUI();
            }
            else
            {
                GUILayout.Label("Main Camera does not have \nGammaLUT attached/enabled");
            }

            //#####################################################
            //# Hue, Saturation, Value                            #
            //#####################################################
            ImageShaderScript iss = mc.GetComponent <ImageShaderScript>();

            if (iss != null)
            {
                iss.DrawDebugGUI();
            }
            else if (fSFX != null && fSFX.enabled)
            {
                if (fSFX.mat != null && fSFX.mat.HasProperty("_HsvAdjust"))
                {
                    Color hsv = fSFX.mat.GetColor("_HsvAdjust");
                    hsv = hsvColour.DrawGUI(hsv);
                    fSFX.mat.SetColor("_HsvAdjust", hsv);
                }
                else
                {
                    GUILayout.Label("Warning: No _HsvAdjust in camera's shader");
                }
            }
            //#########################################################
            //# Grid, blend                                           #
            //#########################################################
            foreach (icDebugGUI icdg in otherGlobals)
            {
                try {
                    icdg.DrawDebugGUI();
                } catch (NullReferenceException) {
                    //icdg script is disabled
                }
            }

            this.propagateCameraChanges();
        }