private void ManageViewObjectCreation(PacketCreateViewObject packet) { Console.WriteLine($"Create View Object | Id obj : {packet.LinkedGameObject.UniqueIdentifier} | Is local player : {packet.LinkedGameObject.IsLocalPlayer}"); // Create our view object ViewObject viewObject = m_objectFactory.CreateViewObject(new ViewObjectCreateArgs(packet.LinkedGameObject)); AddObject(viewObject); }
private void ManageViewObjectCreation(PacketCreateViewObject packet) { Debug.Log($"Create View Object | Id obj : {packet.LinkedGameObject.UniqueIdentifier} | Is local player : {packet.LinkedGameObject.IsLocalPlayer}"); // Create our view object GameObject viewObject = ViewObjectFactory.CreateViewObject(new ViewObjectCreateArgs(packet.LinkedGameObject)); m_viewObjects.Add(viewObject); }
public DeusGameObject CreateGameObject(GameObjectCreateArgs args) { // Create all the components List <DeusComponent> components = new List <DeusComponent>(); foreach (var component in args.ComponentsInfos) { components.Add(GameComponentFactory.CreateComponent(component, args.GameObjectId)); } // Create the gameobject DeusGameObject gameObject = new DeusGameObject(args, components); // notify the view that there is a new object to display PacketCreateViewObject packet = new PacketCreateViewObject(); packet.LinkedGameObject = gameObject; packet.ObjectId = gameObject.UniqueIdentifier; EventManager.Get().EnqueuePacket(0, packet); return(gameObject); }