コード例 #1
0
 public void RegisterCreationFunction(UInt32 inFourCCName, GameObjectCreationFunc inCreationFunction, bool is_server)
 {
     if (IsHost == true && is_server == true)
     {
         mNameToGameObjectCreationFunctionMapInHost[inFourCCName] = inCreationFunction;
     }
     else
     {
         mNameToGameObjectCreationFunctionMap[inFourCCName] = inCreationFunction;
     }
 }
コード例 #2
0
        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);
        }
コード例 #3
0
 public void RegisterCreationFunction(uint32_t inFourCCName, GameObjectCreationFunc inCreationFunction)
 {
     mNameToGameObjectCreationFunctionMap[inFourCCName] = inCreationFunction;
 }