mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
Updated demo script
This commit is contained in:
parent
8c2d5ee82c
commit
b8565b2b80
1 changed files with 16 additions and 0 deletions
|
|
@ -38,6 +38,16 @@ function CustomCheetah::onAdd(%this, %obj)
|
||||||
%itemRock.car = %obj;
|
%itemRock.car = %obj;
|
||||||
%obj.mountObject(%itemRock, %this.turretSlot, "-1.4 0 .5 0 0 1 0");
|
%obj.mountObject(%itemRock, %this.turretSlot, "-1.4 0 .5 0 0 1 0");
|
||||||
|
|
||||||
|
// RigidShape
|
||||||
|
%rigidRock = new RigidShape() {
|
||||||
|
datablock = BouncingBoulder;
|
||||||
|
scale = "0.2 0.2 0.2";
|
||||||
|
};
|
||||||
|
%rigidRock.setShapeName("RigidShape");
|
||||||
|
%obj.rigidRock = %itemRock;
|
||||||
|
%rigidRock.car = %obj;
|
||||||
|
%obj.mountObject(%rigidRock, %this.turretSlot, "0 1.4 .6 0 0 1 0");
|
||||||
|
|
||||||
// Vehicle
|
// Vehicle
|
||||||
%vehicleMount = new WheeledVehicle() {
|
%vehicleMount = new WheeledVehicle() {
|
||||||
datablock = CheetahCar;
|
datablock = CheetahCar;
|
||||||
|
|
@ -72,6 +82,12 @@ function CustomCheetah::onRemove(%this, %obj)
|
||||||
%obj.vehicleMount.delete();
|
%obj.vehicleMount.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( isObject(%obj.rigidRock) )
|
||||||
|
{
|
||||||
|
%obj.unmountObject(%obj.rigidRock);
|
||||||
|
%obj.rigidRock.delete();
|
||||||
|
}
|
||||||
|
|
||||||
if( isObject(%obj.itemRock) )
|
if( isObject(%obj.itemRock) )
|
||||||
{
|
{
|
||||||
%obj.unmountObject(%obj.itemRock);
|
%obj.unmountObject(%obj.itemRock);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue