Example #1
0
        /// <summary>
        /// Releases any resources currently held by this instance.
        /// </summary>
        public static void Release()
        {
            _data.Lights.Clear();
            _data.Lights = null;
            _data.LitObjects.Clear();
            _data.LitObjects = null;

            if (_data.QueuedLitObjects != null)
            {
                _data.QueuedLitObjects.Clear();
                _data.QueuedLitObjects      = null;
                _data.QueuedLitObjectsCount = 0;
            }

            if (_data.QueuedLights != null)
            {
                _data.QueuedLights.Clear();
                _data.QueuedLights      = null;
                _data.QueuedLightsCount = 0;
            }

            _data.Config = null;

            if (_data.LightmapDependentObjects != null)
            {
                _data.LightmapDependentObjects.Clear();
                _data.LightmapDependentObjects = null;
            }

            _data = null;
        }
Example #2
0
 /// <summary>
 /// Creates a new game object to be used as a Data Holder for this util. It should be called automatically by 'Setup',
 /// but since order of Awake initialization is not guaranteed in Unity, we need to check in multiple methods to see
 /// if this has been called already or not.
 /// </summary>
 private static void SetupData()
 {
     _data = new GameObject("VertexLightingData").AddComponent <VertexLightingData>();
 }