mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-17 21:53:47 +00:00
Expands/Cleans up a lot of the asset functionality, including management, file association, and creation/importing
This commit is contained in:
parent
a366f65047
commit
4422082035
73 changed files with 4468 additions and 1876 deletions
|
|
@ -92,7 +92,7 @@ ConsoleSetType(TypeStateMachineAssetPtr)
|
|||
|
||||
StateMachineAsset::StateMachineAsset()
|
||||
{
|
||||
mStateMachineFileName = StringTable->EmptyString();
|
||||
mStateMachineFile = StringTable->EmptyString();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -112,7 +112,8 @@ void StateMachineAsset::initPersistFields()
|
|||
// Call parent.
|
||||
Parent::initPersistFields();
|
||||
|
||||
addField("stateMachineFile", TypeString, Offset(mStateMachineFileName, StateMachineAsset), "Path to the state machine file.");
|
||||
addProtectedField("stateMachineFile", TypeAssetLooseFilePath, Offset(mStateMachineFile, StateMachineAsset),
|
||||
&setStateMachineFile, &getStateMachineFile, "Path to the state machine file.");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
|
@ -123,9 +124,29 @@ void StateMachineAsset::copyTo(SimObject* object)
|
|||
Parent::copyTo(object);
|
||||
}
|
||||
|
||||
void StateMachineAsset::setStateMachineFile(const char* pStateMachineFile)
|
||||
{
|
||||
// Sanity!
|
||||
AssertFatal(pStateMachineFile != NULL, "Cannot use a NULL state machine file.");
|
||||
|
||||
// Fetch image file.
|
||||
pStateMachineFile = StringTable->insert(pStateMachineFile);
|
||||
|
||||
// Ignore no change,
|
||||
if (pStateMachineFile == mStateMachineFile)
|
||||
return;
|
||||
|
||||
// Update.
|
||||
mStateMachineFile = getOwned() ? expandAssetFilePath(pStateMachineFile) : StringTable->insert(pStateMachineFile);
|
||||
|
||||
// Refresh the asset.
|
||||
refreshAsset();
|
||||
}
|
||||
|
||||
|
||||
DefineEngineMethod(StateMachineAsset, notifyAssetChanged, void, (),,"")
|
||||
{
|
||||
ResourceManager::get().getChangedSignal().trigger(object->getStateMachineFileName());
|
||||
ResourceManager::get().getChangedSignal().trigger(object->getStateMachineFile());
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue