mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 00:24:40 +00:00
Simplified the code to the important part as we do the position math previously.
Also added the stub for the onGUIEditorDropped
This commit is contained in:
parent
c6213f0d12
commit
65c290a770
1 changed files with 8 additions and 26 deletions
|
|
@ -30,30 +30,12 @@ function AssetBrowser::onFinishCreateObject(%this, %objId)
|
||||||
|
|
||||||
function Creator::onWorldEditorDropped(%this, %position)
|
function Creator::onWorldEditorDropped(%this, %position)
|
||||||
{
|
{
|
||||||
if(EditorIsActive())
|
%func = %this.val[2];
|
||||||
{
|
|
||||||
%targetPosition = EWorldEditor.unproject(%position SPC 1);
|
|
||||||
%camPos = LocalClientConnection.camera.getPosition();
|
|
||||||
%rayResult = containerRayCast(%camPos, %targetPosition, -1);
|
|
||||||
|
|
||||||
%pos = ObjectCreator.getCreateObjectPosition();
|
$CurrentAssetBrowser.createdObjectPos = %position;
|
||||||
|
%newObj = eval(%func);
|
||||||
if(%rayResult != 0)
|
}
|
||||||
{
|
|
||||||
%pos = getWords(%rayResult, 1, 3);
|
function Creator::onGUIEditorDropped(%this, %position)
|
||||||
}
|
{
|
||||||
else
|
|
||||||
{
|
|
||||||
%pos = "0 0 0";
|
|
||||||
}
|
|
||||||
|
|
||||||
%func = %this.val[2];
|
|
||||||
|
|
||||||
$CurrentAssetBrowser.createdObjectPos = %pos;
|
|
||||||
%newObj = eval(%func);
|
|
||||||
}
|
|
||||||
else if(GuiEditorIsActive())
|
|
||||||
{
|
|
||||||
%placeholderVar = "";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue