示例#1
0
 private static string GetName(ScritableFound <PackagePullPushObject> pullPush)
 {
     if (pullPush == null)
     {
         return("A");
     }
     if (pullPush.m_linked == null)
     {
         return("B");
     }
     if (pullPush.m_linked.m_data == null)
     {
         return("C");
     }
     return(pullPush.m_path);
 }
示例#2
0
    public static List <ScritableFound <T> > GetAllInstancesWithInfo <T>() where T : ScriptableObject
    {
        string[] guids = AssetDatabase.FindAssets("" + typeof(T).Name);  //FindAssets uses tags check documentation for more info
        T[]      a     = new T[guids.Length];

        List <ScritableFound <T> > list = new List <ScritableFound <T> >();

        for (int i = 0; i < guids.Length; i++)
        {
            string path = AssetDatabase.GUIDToAssetPath(guids[i]);
            a[i] = AssetDatabase.LoadAssetAtPath <T>(path);
            ScritableFound <T> result = new ScritableFound <T>();
            result.m_linked = a[i];
            result.m_path   = path;
            list.Add(result);
        }
        return(list);
    }