Exemplo n.º 1
0
        private void DeleteAssetInternal(Asset asset, bool silent = false)
        {
            GuidAssetTable.Remove(asset.Guid);
            GuidPathTable.Remove(asset.Guid);
            GuidHashTable.Remove(asset.Guid);

            if (!silent)
            {
                AssetDeleted?.Invoke(asset.Path);
            }
        }
Exemplo n.º 2
0
        private void AddAssetInternal(Asset asset, bool silent = false)
        {
            var guid = AssetGuidManager.GetGuid(asset.Path);

            if (guid != default(Guid))
            {
                asset.SetGuid(guid);
            }

            GuidAssetTable.Add(asset.Guid, asset);
            GuidPathTable.Add(asset.Guid, asset.Path);
            GuidHashTable.Add(asset.Guid, asset.Hash);

            AssetGuidManager.AddNewGuid(asset.Guid, asset.Path, asset.Hash);
            if (!IsEditingAssets)
            {
                AssetGuidManager.Save();
            }

            if (!silent)
            {
                AssetCreated?.Invoke(asset.Path);
            }
        }