This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IEnumerable<T> FindAssetsOfType<T> () where T : UnityEngine.Object | |
{ | |
return AssetDatabase.FindAssets ("t:" + typeof (T).Name) | |
.Select (AssetDatabase.GUIDToAssetPath) | |
.Select ((T)AssetDatabase.LoadMainAssetAtPath); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Reflection; | |
using System.Collections; | |
using System.Collections.Generic; | |
/// <summary> | |
/// Utilties for reflection | |
/// </summary> | |
public static class ReflectionUtils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var props = t.GetProperties().Where( | |
prop => Attribute.IsDefined(prop, typeof(T))); |