コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }