Esempio n. 1
0
        public bool Inspect()
        {
            var changed = false;

            pegi.toggleDefaultInspector(this);

            pegi.FullWindow.DocumentationClickOpen("This component will set noise texture as a global parameter. Using texture is faster then generating noise in shader.", "About Noise Texture Manager");

            pegi.nl();

            _noiseTextureGlobal.ToString().edit(90, ref prerenderedNoiseTexture).nl(ref changed);

            if (prerenderedNoiseTexture)
            {
                _noiseTexture.ToString().toggleIcon(ref enableNoise).nl(ref changed);
                if (enableNoise)
                {
                    _noiseTextureGlobal.ToString().write_ForCopy().nl();
                }
            }

            pegi.nl();

            "Custom Time Parameter".write_ForCopy(_shaderTime.ToString());

            pegi.FullWindow.DocumentationClickOpen(
                "Use NoiseTextureMGMT.instance.ResetTime to reset time when all animated shaders are hiddent from the screen." +
                " Alternatively the time will be reset every 64 seconds resulting in noticible jitter");

            pegi.nl();

            if (changed)
            {
                UpdateShaderGlobal();
            }

            return(changed);
        }
 private static Texture2D SetTexture(TextureValue texture, Game game)
 {
     return game.Content.Load<Texture2D>(texture.ToString());
 }