示例#1
0
 public PostCont Reset()
 {
     profile              = null;
     camera               = null;
     materialFactory      = null;
     renderTextureFactory = null;
     interrupted          = false;
     return(this);
 }
示例#2
0
        /* SETUP */
        #region Setup
        private void OnEnable()
        {
            m_Grain = AddComponent(new GrainComp());
            cam     = GetComponent <Camera>();

            mat = new Material(Shader.Find("Unlit/Texture"));


#if UNITY_EDITOR
            string _noiseTexturePath   = "Assets/Stylizer/Resources/Shaders/NoiseAndGrain.png";
            string _defaultPalettePath = "Assets/Stylizer/Styles/Palette/Palette_1.asset";
            string _defaultNoisePath   = "Assets/Stylizer/Styles/Pattern/Pattern_1.asset";

            string _profilePath = "Assets/Stylizer/Resources/Scripts/UnityGrain/Grain.asset";
            string _ubPath      = "Assets/Stylizer/Resources/Scripts/UnityGrain/Shaders/Build materials/ub.mat";
            string _gmPath      = "Assets/Stylizer/Resources/Scripts/UnityGrain/Shaders/Build materials/gm.mat";


            if (profile == null)
            {
                profile = AssetDatabase.LoadAssetAtPath <PostProf>(_profilePath);
                if (profile == null)
                {
                    Debug.LogWarningFormat("No grain profile found.", _profilePath);
                }
            }

            if (ub == null)
            {
                ub = AssetDatabase.LoadAssetAtPath <Material>(_ubPath);
                if (ub == null)
                {
                    Debug.LogWarningFormat("No ub material found.", _ubPath);
                }
            }

            if (gm == null)
            {
                gm = AssetDatabase.LoadAssetAtPath <Material>(_gmPath);
                if (gm == null)
                {
                    Debug.LogWarningFormat("No ub material found.", _gmPath);
                }
            }

            if (_palette == null)
            {
                _palette = AssetDatabase.LoadAssetAtPath <Palette>(_defaultPalettePath);
                if (_palette == null)
                {
                    Debug.LogWarningFormat("No default palette found.", _defaultPalettePath);
                }
            }

            if (_pattern == null)
            {
                _pattern = AssetDatabase.LoadAssetAtPath <Pattern>(_defaultNoisePath);
                if (_pattern == null)
                {
                    Debug.LogWarningFormat("No default pattern found.", _defaultNoisePath);
                }
            }

            if (noiseTexture == null)
            {
                noiseTexture = AssetDatabase.LoadAssetAtPath <Texture2D>(_noiseTexturePath);
                if (noiseTexture == null)
                {
                    Debug.LogWarningFormat("No branding logo texture found at {0}, please make sure a texture is available at that path, or change the path in the variable _brandingLogoPath in this script.", _noiseTexturePath);
                }
            }
#endif

            checkSupport();
        }