public void ReplaceObjectPool(IObjectPoolService newInstance) { var index = MetaComponentsLookup.ObjectPool; var component = (ObjectPoolComponent)CreateComponent(index, typeof(ObjectPoolComponent)); component.instance = newInstance; ReplaceComponent(index, component); }
public MetaEntity SetObjectPool(IObjectPoolService newInstance) { if (hasObjectPool) { throw new Entitas.EntitasException("Could not set ObjectPool!\n" + this + " already has an entity with ObjectPoolComponent!", "You should check if the context already has a objectPoolEntity before setting it or use context.ReplaceObjectPool()."); } var entity = CreateEntity(); entity.AddObjectPool(newInstance); return(entity); }
public void ReplaceObjectPool(IObjectPoolService newInstance) { var entity = objectPoolEntity; if (entity == null) { entity = SetObjectPool(newInstance); } else { entity.ReplaceObjectPool(newInstance); } }
// public readonly IInputService Input; // public readonly IAiService Ai; // public readonly IConfigurationService Config; // public readonly ICameraService Camera; // public readonly IPhysicsService Physics; public Services(IViewService view, ITimeService time, IObjectPoolService objectPool, IGenerateBoardService generateBoard, IUiManagementService uiManagement, IGameConfigureService gameConfigure) { View = view; // Application = application; Time = time; ObjectPool = objectPool; GenerateBoard = generateBoard; UiManagement = uiManagement; GameConfigure = gameConfigure; // GameState = gameState; // Input = input; // Ai = ai; // Config = config; // Camera = camera; // Physics = physics; }
public RegisterObjectPoolServiceSystem(Contexts contexts, IObjectPoolService objectPoolService) { _metaContext = contexts.meta; _objectPoolService = objectPoolService; }