Exemplo n.º 1
0
            public bool Draw(MaterialEditor materialEditor, List <string> keywords, OceanMode mask)
            {
                if (autoDrawer.Drawers.Count == 0)
                {
                    return(false);
                }
                if ((accessor.Mask & (int)mask) == 0)
                {
                    return(false);
                }

                bool isExpanded = expandSave[expandedID] = EditorGUILayout.Foldout(expandSave[expandedID], displayName);

                if (isExpanded)
                {
                    using (new EditorGUI.IndentLevelScope())
                    {
                        autoDrawer.Draw(materialEditor, keywords, (int)mask);
                        return(autoDrawer.IsKeywordChanged);
                    }
                }
                else
                {
                    autoDrawer.Extract(materialEditor, keywords, (int)mask);
                    return(false);
                }
            }
Exemplo n.º 2
0
            public bool Draw(MaterialEditor materialEditor, List <string> keywords, OceanMode mask)
            {
                bool isExpanded = expandSave[IsExpanded] = EditorGUILayout.Foldout(expandSave[IsExpanded], nameof(OceanShaderOptions.Wave));

                if (isExpanded)
                {
                    using (new EditorGUI.IndentLevelScope())
                    {
                        materialEditor.ShaderProperty(Texture, Texture.displayName);
                        SliderRadian(WaveOptionsDrawData.UniformRadianDisplayName, UniformRadian, WaveOptionsDrawData.AngleLeftValue, WaveOptionsDrawData.AngleRightValue);

                        if ((mask & OceanMode.Wave1) != 0)
                        {
                            DrawWaveOptions(materialEditor, WaveOptionsDrawData.Wave1Names[0], 2);
                            DrawWaveHorizontalOffset(materialEditor, WaveOptionsDrawData.Wave1Names[1], 3);
                        }
                        else if ((mask & OceanMode.Wave2) != 0)
                        {
                            DrawWaveOptions(materialEditor, WaveOptionsDrawData.Wave2Names[0], 0);
                            DrawWaveOptions(materialEditor, WaveOptionsDrawData.Wave2Names[1], 1);
                        }
                        else if ((mask & OceanMode.Wave3) != 0)
                        {
                            DrawWaveOptions(materialEditor, WaveOptionsDrawData.Wave4Names[0], 0);
                            DrawWaveOptions(materialEditor, WaveOptionsDrawData.Wave4Names[1], 1);
                            DrawWaveOptions(materialEditor, WaveOptionsDrawData.Wave4Names[2], 2);
                            DrawWaveHorizontalOffset(materialEditor, WaveOptionsDrawData.Wave4Names[3], 3);
                        }
                    }
                }
                return(false);
            }
Exemplo n.º 3
0
        public void SetMode(OceanMode mode)
        {
            Debug.Log("SETTING OCEAN MODE TO " + mode.ToString());
            mLastMode = mMode;
            mMode     = mode;
            switch (mMode)
            {
            case OceanMode.Full:
            default:
                gameObject.SetLayerRecursively(Globals.LayerNumFluidTerrain);
                OceanWaterRenderer.enabled   = true;
                OceanFloorRenderer.enabled   = true;
                OceanOverlayRenderer.enabled = true;
                break;

            case OceanMode.Partial:
                gameObject.SetLayerRecursively(Globals.LayerNumScenery);
                OceanWaterRenderer.enabled   = true;
                OceanFloorRenderer.enabled   = true;
                OceanOverlayRenderer.enabled = true;
                break;

            case OceanMode.Disabled:
                gameObject.SetLayerRecursively(Globals.LayerNumHidden);
                OceanWaterRenderer.enabled   = false;
                OceanFloorRenderer.enabled   = false;
                OceanOverlayRenderer.enabled = false;
                break;
            }
        }