Exemple #1
0
        protected void SetupAsset(LoadableAsset <T> asset)
        {
            Add(asset.Key, asset.Asset);
            requests.Add(asset);

            asset.OnAssetLoaded    += OnAssetLoaded;
            asset.OnAssetLoadError += OnAssetError;
        }
        private LoadableAsset <Texture2D> MakeAsset(ResourceNode node, string name)
        {
            var asset = new LoadableAsset <Texture2D>
            {
                AssetLoaders = FARAssets.Instance.Loaders.Textures,
                Key          = name,
                Node         = node
            };

            SetupAsset(asset);
            return(asset);
        }
 public FARTextureCache()
 {
     IconLarge  = MakeAsset(FARConfig.Textures.IconButtonStock, "stock_button");
     IconSmall  = MakeAsset(FARConfig.Textures.IconButtonBlizzy, "blizzy_button");
     DebugVoxel = MakeAsset(FARConfig.Textures.SpriteDebugVoxel, "debug_voxel");
 }