コード例 #1
0
    public void ReplaceMouseInputService(IMouseInputService newInstance)
    {
        var index     = GameComponentsLookup.MouseInputService;
        var component = (MouseInputServiceComponent)CreateComponent(index, typeof(MouseInputServiceComponent));

        component.instance = newInstance;
        ReplaceComponent(index, component);
    }
コード例 #2
0
    public GameEntity SetMouseInputService(IMouseInputService newInstance)
    {
        if (hasMouseInputService)
        {
            throw new Entitas.EntitasException("Could not set MouseInputService!\n" + this + " already has an entity with MouseInputServiceComponent!",
                                               "You should check if the context already has a mouseInputServiceEntity before setting it or use context.ReplaceMouseInputService().");
        }
        var entity = CreateEntity();

        entity.AddMouseInputService(newInstance);
        return(entity);
    }
コード例 #3
0
    public void ReplaceMouseInputService(IMouseInputService newInstance)
    {
        var entity = mouseInputServiceEntity;

        if (entity == null)
        {
            entity = SetMouseInputService(newInstance);
        }
        else
        {
            entity.ReplaceMouseInputService(newInstance);
        }
    }
コード例 #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;
 }
コード例 #5
0
 public RegisterMouseInputServiceSystem(Contexts contexts, IMouseInputService mouseInputService)
 {
     _context           = contexts.game;
     _mouseInputService = mouseInputService;
 }