@akashic/akashic-engine
Advanced tools
Comparing version 3.17.0 to 3.17.1
@@ -217,2 +217,9 @@ import type { AudioAsset, BinaryAsset, ImageAsset, ScriptAsset, TextAsset, VectorImageAsset } from "@akashic/pdi-types"; | ||
getBinaryDataById(assetId: string): ArrayBuffer; | ||
/** | ||
* アセットIDからアセットのパスを返す。 | ||
* 当該のアセットが読み込まれていない場合、 null を返す。 | ||
* | ||
* @param assetId 取得するアセットのID | ||
*/ | ||
pathOf(assetId: string): string | null; | ||
} |
@@ -267,2 +267,11 @@ "use strict"; | ||
}; | ||
/** | ||
* アセットIDからアセットのパスを返す。 | ||
* 当該のアセットが読み込まれていない場合、 null を返す。 | ||
* | ||
* @param assetId 取得するアセットのID | ||
*/ | ||
AssetAccessor.prototype.pathOf = function (assetId) { | ||
return this._assetManager.resolveAccessorPath(assetId); | ||
}; | ||
return AssetAccessor; | ||
@@ -269,0 +278,0 @@ }()); |
@@ -220,2 +220,9 @@ import type { AssetConfigurationMap, AudioSystemConfigurationMap, ModuleMainScriptsMap, AssetConfigurationCommonBase, ImageAssetConfigurationBase, ScriptAssetConfigurationBase, TextAssetConfigurationBase, AudioAssetConfigurationBase, VideoAssetConfigurationBase, VectorImageAssetConfigurationBase, BinaryAssetConfigurationBase } from "@akashic/game-configuration"; | ||
/** | ||
* アセットIDから読み込み済みのアクセッサパス返す。 | ||
* 当該のアセットが読み込まれていない場合、 null を返す。 | ||
* | ||
* @param assetId 取得するアセットのID | ||
*/ | ||
resolveAccessorPath(assetId: string): string | null; | ||
/** | ||
* @ignore | ||
@@ -222,0 +229,0 @@ */ |
@@ -370,2 +370,17 @@ "use strict"; | ||
/** | ||
* アセットIDから読み込み済みのアクセッサパス返す。 | ||
* 当該のアセットが読み込まれていない場合、 null を返す。 | ||
* | ||
* @param assetId 取得するアセットのID | ||
*/ | ||
AssetManager.prototype.resolveAccessorPath = function (assetId) { | ||
var asset = this._assets[assetId]; | ||
if (!asset) | ||
return null; | ||
var virtualPath = this._liveAssetPathTable[asset.path]; | ||
if (!virtualPath) | ||
return null; | ||
return "/" + virtualPath; | ||
}; | ||
/** | ||
* @ignore | ||
@@ -372,0 +387,0 @@ */ |
@@ -5,2 +5,3 @@ import type { GameConfiguration } from "@akashic/game-configuration"; | ||
import { Trigger } from "@akashic/trigger"; | ||
import { AssetAccessor } from "./AssetAccessor"; | ||
import { AssetManager } from "./AssetManager"; | ||
@@ -213,2 +214,12 @@ import { AudioSystemManager } from "./AudioSystemManager"; | ||
/** | ||
* アセットへのアクセッサ。 | ||
* `g.Scene#asset` はこの値のエイリアスである。 | ||
* | ||
* 歴史的経緯による `assets` との違いに注意。 | ||
* `assets` はグローバルアセットをアセットIDをキーにしてアクセスするテーブルである。 | ||
* 他方この `asset` は `getImageById()`, `getAllTexts()` などのメソッドを持つオブジェクトである。 | ||
* アセットIDだけでなくパスでのアクセスや、複数アセットの一括取得ができる点で異なる。 | ||
*/ | ||
asset: AssetAccessor; | ||
/** | ||
* グローバルアセットのマップ。this._initialScene.assets のエイリアス。 | ||
@@ -215,0 +226,0 @@ */ |
@@ -5,2 +5,3 @@ "use strict"; | ||
var trigger_1 = require("@akashic/trigger"); | ||
var AssetAccessor_1 = require("./AssetAccessor"); | ||
var AssetManager_1 = require("./AssetManager"); | ||
@@ -134,2 +135,3 @@ var AudioSystemManager_1 = require("./AudioSystemManager"); | ||
this._moduleManager = undefined; | ||
this.asset = new AssetAccessor_1.AssetAccessor(this._assetManager); | ||
this.operationPluginManager = new OperationPluginManager_1.OperationPluginManager(this, param.operationPluginViewInfo || null); | ||
@@ -878,2 +880,3 @@ this._onOperationPluginOperated = new trigger_1.Trigger(); | ||
this._assetManager = undefined; | ||
this.asset = undefined; | ||
this._eventConverter = undefined; | ||
@@ -880,0 +883,0 @@ this._pointEventResolver = undefined; |
import type { Asset, CommonOffset } from "@akashic/pdi-types"; | ||
import { Trigger } from "@akashic/trigger"; | ||
import { AssetAccessor } from "./AssetAccessor"; | ||
import type { AssetAccessor } from "./AssetAccessor"; | ||
import type { AssetGenerationConfiguration } from "./AssetGenerationConfiguration"; | ||
@@ -5,0 +5,0 @@ import { AssetHolder } from "./AssetHolder"; |
@@ -5,3 +5,2 @@ "use strict"; | ||
var trigger_1 = require("@akashic/trigger"); | ||
var AssetAccessor_1 = require("./AssetAccessor"); | ||
var AssetHolder_1 = require("./AssetHolder"); | ||
@@ -38,3 +37,3 @@ var Camera2D_1 = require("./Camera2D"); | ||
this.assets = {}; | ||
this.asset = new AssetAccessor_1.AssetAccessor(game._assetManager); | ||
this.asset = game.asset; | ||
this.vars = {}; | ||
@@ -41,0 +40,0 @@ this._loaded = false; |
{ | ||
"name": "@akashic/akashic-engine", | ||
"version": "3.17.0", | ||
"version": "3.17.1", | ||
"description": "The core library of Akashic Engine", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1587108
27425