using System;
using UnityEngine;
using UnityEngine.Serialization;

/**
 * https://www.febucci.com/2022/05/custom-post-processing-in-urp/
 */

namespace Shaders
{
    [System.Serializable,
     CreateAssetMenu(fileName = "CustomPostProcessingMaterials", menuName = "CustomMaterial/CustomPostProcessingMaterials")]
    public class CustomPostProcessingMaterials : UnityEngine.ScriptableObject
    {
        //---Your Materials---
        public Material customEffect;

        //---Accessing the data from the Pass---
        static CustomPostProcessingMaterials _instance;

        public static CustomPostProcessingMaterials Instance
        {
            get
            {
                if (_instance != null) return _instance;
                // TODO check if application is quitting
                // and avoid loading if that is the case

                _instance =
                    UnityEngine.Resources.Load("Shaders/CustomPostProcessingMaterials") as CustomPostProcessingMaterials;
                return _instance;
            }
        }
    }
}