| 122 | } |
| 123 | |
| 124 | void ScriptAsset::initializeAsset() |
| 125 | { |
| 126 | mScriptPath = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptPath; |
| 127 | |
| 128 | if (Torque::FS::IsScriptFile(mScriptPath)) |
| 129 | { |
| 130 | //We're initialized properly, so we'll go ahead and kick along any dependencies we may have as well |
| 131 | AssetManager::typeAssetDependsOnHash::Iterator assetDependenciesItr = mpOwningAssetManager->getDependedOnAssets()->find(mpAssetDefinition->mAssetId); |
| 132 | |
| 133 | // Does the asset have any dependencies? |
| 134 | if (assetDependenciesItr != mpOwningAssetManager->getDependedOnAssets()->end()) |
| 135 | { |
| 136 | // Iterate all dependencies. |
| 137 | while (assetDependenciesItr != mpOwningAssetManager->getDependedOnAssets()->end() && assetDependenciesItr->key == mpAssetDefinition->mAssetId) |
| 138 | { |
| 139 | AssetPtr<ScriptAsset> scriptAsset = assetDependenciesItr->value; |
| 140 | |
| 141 | mScriptAssets.push_front(scriptAsset); |
| 142 | |
| 143 | // Next dependency. |
| 144 | assetDependenciesItr++; |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | Con::executeFile(mScriptPath, false, false); |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | void ScriptAsset::onAssetRefresh() |
| 153 | { |
nothing calls this directly
no test coverage detected