mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
Adds some in-progress gameObject recreation of various legacy game classes, such as PlayerObject, AIPlayerObject, Sound Emitter and Static Shape.
This commit is contained in:
parent
775ca57047
commit
23182eb2a1
23 changed files with 792 additions and 35 deletions
42
Engine/source/T3D/gameObjects/aiPlayerObject.cpp
Normal file
42
Engine/source/T3D/gameObjects/aiPlayerObject.cpp
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
#include "aiPlayerObject.h"
|
||||
|
||||
IMPLEMENT_CO_NETOBJECT_V1(AIPlayerObject);
|
||||
|
||||
AIPlayerObject::AIPlayerObject()
|
||||
: mAIControllerComponent(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
AIPlayerObject::~AIPlayerObject()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool AIPlayerObject::onAdd()
|
||||
{
|
||||
if (!Parent::onAdd())
|
||||
return false;
|
||||
|
||||
//If we don't delinate from the template, just spawn as apropos here
|
||||
if (!mDirtyGameObject)
|
||||
{
|
||||
//AI Controller
|
||||
mAIControllerComponent = new AIControllerComponent();
|
||||
if (!mAIControllerComponent->registerObject())
|
||||
{
|
||||
Con::errorf("PlayerObject::onAdd - unable to add mAIControllerComponent!");
|
||||
return false;
|
||||
}
|
||||
|
||||
mAIControllerComponent->setInternalName("aiControllerComponent");
|
||||
|
||||
addComponent(mAIControllerComponent);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void AIPlayerObject::onRemove()
|
||||
{
|
||||
Parent::onRemove();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue