예제 #1
0
        public static TypeData GetTypeData()
        {
            var typeData = new TypeData();

            var assets = new List <string>();

            // Concat all potential assets
            assets.AddRange(AssetDatabase.FindAssets("uSequencerRuntime"));
            assets.AddRange(AssetDatabase.FindAssets("uSequencerEditor"));
            assets.AddRange(AssetDatabase.FindAssets("sharedRuntime"));
            assets.AddRange(AssetDatabase.FindAssets("sharedEditor"));
            assets.AddRange(AssetDatabase.FindAssets("WellFired.Direct.Runtime"));
            assets.AddRange(AssetDatabase.FindAssets("WellFired.Direct.Editor"));
            assets.AddRange(AssetDatabase.FindAssets("WellFired.Shared.Runtime"));
            assets.AddRange(AssetDatabase.FindAssets("WellFired.Shared.Editor"));

            foreach (var asset in assets)
            {
                var assetPath    = AssetDatabase.GUIDToAssetPath(asset);
                var loadedAssets = AssetDatabase.LoadAllAssetsAtPath(assetPath);
                foreach (var unityObject in loadedAssets)
                {
                    string guid;
                    long   fileId;

                    if (AssetDatabase.TryGetGUIDAndLocalFileIdentifier(unityObject, out guid, out fileId))
                    {
                        typeData.AddEntry(TypeDataEntry.Create(unityObject.name, guid, fileId));
                    }
                }
            }

            return(typeData);
        }
        public void AddEntry(TypeDataEntry typeDataEntry)
        {
            if (Data.Contains(typeDataEntry))
            {
                return;
            }

            Data.Add(typeDataEntry);
        }
 private bool Equals(TypeDataEntry other)
 {
     return(string.Equals(Type, other.Type) && string.Equals(GUID, other.GUID) && FileId == other.FileId);
 }
예제 #4
0
 private static string BuildString(TypeDataEntry data)
 {
     // m_Script: {fileID: 11500000, guid: 3dd072ebad4384a4c96e1049872b47a4, type: 1}
     return(string.Format("m_Script: {{fileID: {0}, guid: {1}", data.FileId, data.GUID));
 }