Ejemplo n.º 1
0
        public override void OnImportAsset(AssetImportContext ctx)
        {
            var asset = ScriptableObject.CreateInstance <UTModule>();

            ctx.AddObjectToAsset("asset", asset);
            ctx.SetMainObject(asset);
            UTinyPersistence.MarkAssetChanged(ctx.assetPath);
        }
        private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets,
                                                   string[] movedFromAssetPaths)
        {
            // scripted importers take care of importedAssets
            // we don't care about moved assets, only deleted ones
            foreach (var a in deletedAssets)
            {
                if (a.EndsWith(UTinyPersistence.ProjectFileExtension) ||
                    a.EndsWith(UTinyPersistence.ModuleFileExtension))
                {
                    UTinyPersistence.MarkAssetChanged(a);
                }
            }

            foreach (var a in movedAssets)
            {
                if (a.EndsWith(UTinyPersistence.ProjectFileExtension) ||
                    a.EndsWith(UTinyPersistence.ModuleFileExtension))
                {
                    UTinyPersistence.MarkAssetMoved(a);
                }
            }
        }