public void RegisterCreationFunction(UInt32 inFourCCName, GameObjectCreationFunc inCreationFunction, bool is_server) { if (IsHost == true && is_server == true) { mNameToGameObjectCreationFunctionMapInHost[inFourCCName] = inCreationFunction; } else { mNameToGameObjectCreationFunctionMap[inFourCCName] = inCreationFunction; } }
public NetGameObject CreateGameObject(uint32_t inFourCCName, byte worldId = 0) { //no error checking- if the name isn't there, exception! GameObjectCreationFunc creationFunc = mNameToGameObjectCreationFunctionMap[inFourCCName]; var gameObject = creationFunc(worldId); //should the registry depend on the world? this might be a little weird //perhaps you should ask the world to spawn things? for now it will be like this World.Instance(worldId).AddGameObject(gameObject); return(gameObject); }
public void RegisterCreationFunction(uint32_t inFourCCName, GameObjectCreationFunc inCreationFunction) { mNameToGameObjectCreationFunctionMap[inFourCCName] = inCreationFunction; }