Example #1
0
 void OnDestroy()
 {
     if (instance == this)
     {
         instance = null;
     }
 }
Example #2
0
        //-----------------------------------------------

        private void Awake()
        {
            instance = this;

            gradient.colorKeys = new GradientColorKey[] { new GradientColorKey(new Color(1, 0, 0, 1), 0), new GradientColorKey(new Color(1, 1, 0, 1), 0.5f), new GradientColorKey(new Color(0, 1, 0, 1), 1f) };
        }