Example #1
0
    public void ReplaceKeyInputService(IKeyInputService newInstance)
    {
        var index     = GameComponentsLookup.KeyInputService;
        var component = (KeyInputServiceComponent)CreateComponent(index, typeof(KeyInputServiceComponent));

        component.instance = newInstance;
        ReplaceComponent(index, component);
    }
Example #2
0
    public GameEntity SetKeyInputService(IKeyInputService newInstance)
    {
        if (hasKeyInputService)
        {
            throw new Entitas.EntitasException("Could not set KeyInputService!\n" + this + " already has an entity with KeyInputServiceComponent!",
                                               "You should check if the context already has a keyInputServiceEntity before setting it or use context.ReplaceKeyInputService().");
        }
        var entity = CreateEntity();

        entity.AddKeyInputService(newInstance);
        return(entity);
    }
Example #3
0
    public void ReplaceKeyInputService(IKeyInputService newInstance)
    {
        var entity = keyInputServiceEntity;

        if (entity == null)
        {
            entity = SetKeyInputService(newInstance);
        }
        else
        {
            entity.ReplaceKeyInputService(newInstance);
        }
    }
Example #4
0
 public Services(ILogService log, IViewService view, IMouseInputService mouseInput, ILoadConfigService loadConfig, ISceneService scene, ICoroutineService coroutine, IKeyInputService keyInput, ITimeService time, IPhysicsService physics, INetworkService network, ILocalStorageService localStorage, IFileService file, ISettingService setting)
 {
     Log          = log;
     View         = view;
     MouseInput   = mouseInput;
     LoadConfig   = loadConfig;
     Scene        = scene;
     Coroutine    = coroutine;
     KeyInput     = keyInput;
     Time         = time;
     Physics      = physics;
     Network      = network;
     LocalStorage = localStorage;
     File         = file;
     Setting      = setting;
 }
 public RegisterKeyInputServiceSystem(Contexts contexts, IKeyInputService keyInputService)
 {
     _context         = contexts.game;
     _keyInputService = keyInputService;
 }