static void Update()
 {
     //
     // THIS IS A HACK. IT DETECTS WHEN A NEW SCENE IS LOADED
     //
     if(Time.realtimeSinceStartup <= EditorPrefs.GetFloat("LastLoadTime", float.MaxValue))
     {
         EditorPrefs.SetFloat("LastLoadTime", Time.realtimeSinceStartup);
         sanityData = SceneSanityData.Create();
     }
 }
Exemple #2
0
 static void Update()
 {
     //
     // THIS IS A HACK. IT DETECTS WHEN A NEW SCENE IS LOADED
     //
     if (Time.realtimeSinceStartup <= EditorPrefs.GetFloat("LastLoadTime", float.MaxValue))
     {
         EditorPrefs.SetFloat("LastLoadTime", Time.realtimeSinceStartup);
         sanityData = SceneSanityData.Create();
     }
 }
Exemple #3
0
        public static SceneSanityData Create()
        {
            var data    = new SceneSanityData();
            var objects = (GameObject[])GameObject.FindObjectsOfType(typeof(GameObject));
            var items   = new List <SceneSanityItem>();

            foreach (var i in objects)
            {
                items.Add(new SceneSanityItem(i));
            }

            items.Sort((x, y) => x.instanceID.CompareTo(y.instanceID));
            data.dataItems = items.ToArray();
            return(data);
        }
        public static SceneSanityData Create()
        {
            var data = new SceneSanityData();
            var objects = (GameObject[])GameObject.FindObjectsOfType(typeof(GameObject));
            var items = new List<SceneSanityItem>();
            foreach(var i in objects)
            {
                items.Add(new SceneSanityItem(i));
            }

            items.Sort((x, y) => x.instanceID.CompareTo(y.instanceID));
            data.dataItems = items.ToArray();
            return data;
        }