1//************************************ bs::framework - Copyright 2018 Marko Pintera **************************************//
2//*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********//
3#include "Scene/BsGameObject.h"
4#include "Private/RTTI/BsGameObjectRTTI.h"
5#include "Scene/BsGameObjectManager.h"
6
7namespace bs
8{
9 void GameObject::initialize(const SPtr<GameObject>& object, UINT64 instanceId)
10 {
11 mInstanceData = bs_shared_ptr_new<GameObjectInstanceData>();
12 mInstanceData->object = object;
13 mInstanceData->mInstanceId = instanceId;
14 }
15
16 void GameObject::_setInstanceData(GameObjectInstanceDataPtr& other)
17 {
18 SPtr<GameObject> myPtr = mInstanceData->object;
19 UINT64 oldId = mInstanceData->mInstanceId;
20
21 mInstanceData = other;
22 mInstanceData->object = myPtr;
23
24 GameObjectManager::instance().remapId(oldId, mInstanceData->mInstanceId);
25 }
26
27 RTTITypeBase* GameObject::getRTTIStatic()
28 {
29 return GameObjectRTTI::instance();
30 }
31
32 RTTITypeBase* GameObject::getRTTI() const
33 {
34 return GameObject::getRTTIStatic();
35 }
36}