public void AddDependency(AssetHandle handle) { if (dependencies.Contains(handle)) { throw new ApplicationException(string.Format( "{0} already has a reference to {1}", this, handle)); } ++handle.RefCount; dependencies.Add(handle); }
public void AddAsset(AssetHandle h) { if (assets.ContainsKey(h.Path)) { throw new ArgumentException(string.Format( "Asset of path {0} already exists in AssetManager", h.Path)); } assets.Add(h.Path, h); if (h.RequireTick) { tickAssets.Add(h); } ResLog.Log("(AssetManager) add asset " + h.Path); }