Esempio n. 1
0
        public static void PingSelectedAssets(AssetList list)
        {
            var newSelection = new List <UnityEngine.Object>(list.GetSelectedCount());

            var iterator = list.GetSelectedEnumerator();

            while (iterator.MoveNext())
            {
                var loadedObject =
                    AssetDatabase.LoadAssetAtPath(iterator.Current.Key, typeof(UnityEngine.Object));
                if (loadedObject != null)
                {
                    newSelection.Add(loadedObject);
                }
            }

            Selection.objects = newSelection.ToArray();
        }