mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
Integrates sound and shapeAnimation assets into the importer
Added drag-n-drop spawn action for soundAssets
This commit is contained in:
parent
20479cd818
commit
1942535923
6 changed files with 279 additions and 13 deletions
|
|
@ -9,4 +9,40 @@ function AssetBrowser::buildSoundAssetPreview(%this, %assetDef, %previewData)
|
|||
%previewData.assetFriendlyName = %assetDef.assetName;
|
||||
%previewData.assetDesc = %assetDef.description;
|
||||
%previewData.tooltip = %assetDef.assetName;
|
||||
}
|
||||
|
||||
function AssetBrowser::onSoundAssetEditorDropped(%this, %assetDef, %position)
|
||||
{
|
||||
%targetPosition = EWorldEditor.unproject(%position SPC 1000);
|
||||
%camPos = LocalClientConnection.camera.getPosition();
|
||||
%rayResult = containerRayCast(%camPos, %targetPosition, -1);
|
||||
|
||||
%pos = EWCreatorWindow.getCreateObjectPosition();
|
||||
|
||||
if(%rayResult != 0)
|
||||
{
|
||||
%pos = getWords(%rayResult, 1, 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
%pos = "0 0 0";
|
||||
}
|
||||
|
||||
%assetId = %assetDef.getAssetId();
|
||||
|
||||
%newSFXEmitter = new SFXEmitter()
|
||||
{
|
||||
position = %pos;
|
||||
fileName = %assetDef.getSoundPath();
|
||||
pitch = %assetDef.pitchAdjust;
|
||||
volume = %assetDef.volumeAdjust;
|
||||
};
|
||||
|
||||
getScene(0).add(%newSFXEmitter);
|
||||
|
||||
EWorldEditor.clearSelection();
|
||||
EWorldEditor.selectObject(%newSFXEmitter);
|
||||
|
||||
EWorldEditor.isDirty = true;
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue