mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
On-demand loading of actors (sort of)
This was SVN commit r2017.
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include "UnitManager.h"
|
||||
#include "Unit.h"
|
||||
#include "CConsole.h"
|
||||
#include "ObjectManager.h"
|
||||
|
||||
extern CConsole* g_Console;
|
||||
|
||||
@@ -105,3 +106,17 @@ CUnit* CUnitManager::PickUnit(const CVector3D& origin,const CVector3D& dir) cons
|
||||
}
|
||||
return hit;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// CreateUnit: create a new unit and add it to the world
|
||||
CUnit* CUnitManager::CreateUnit(CStr& actorName, CEntity* entity)
|
||||
{
|
||||
CObjectEntry* obj = g_ObjMan.FindObject(actorName);
|
||||
|
||||
if (! obj)
|
||||
return NULL;
|
||||
|
||||
CUnit* unit = new CUnit(obj, obj->m_Model->Clone(), entity);
|
||||
AddUnit(unit);
|
||||
return unit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user