Beispiel #1
0
        public int AddAsset(AssetData asset)
        {
            if (asset == null || asset.buffer == null)
            {
                return(this.assets.Count - 1);
            }

            for (int i = 0, l = this.assets.Count; i < l; i++)
            {
                var item = this.assets[i];
                if (item.uri == asset.uri)
                {
                    this.assets[i] = asset;
                    return(i);
                }
            }

            this.assets.Add(asset);

            return(this.assets.Count - 1);
        }