Beispiel #1
0
    public void ReplaceGameplayServicesInputInputService(GameplayServices.Input.IInputService newInstance)
    {
        var index     = ServiceComponentsLookup.GameplayServicesInputInputService;
        var component = (GameplayServices.Input.InputServiceComponent)CreateComponent(index, typeof(GameplayServices.Input.InputServiceComponent));

        component.instance = newInstance;
        ReplaceComponent(index, component);
    }
Beispiel #2
0
    public ServiceEntity SetGameplayServicesInputInputService(GameplayServices.Input.IInputService newInstance)
    {
        if (hasGameplayServicesInputInputService)
        {
            throw new Entitas.EntitasException("Could not set GameplayServicesInputInputService!\n" + this + " already has an entity with GameplayServices.Input.InputServiceComponent!",
                                               "You should check if the context already has a gameplayServicesInputInputServiceEntity before setting it or use context.ReplaceGameplayServicesInputInputService().");
        }
        var entity = CreateEntity();

        entity.AddGameplayServicesInputInputService(newInstance);
        return(entity);
    }
Beispiel #3
0
    public void ReplaceGameplayServicesInputInputService(GameplayServices.Input.IInputService newInstance)
    {
        var entity = gameplayServicesInputInputServiceEntity;

        if (entity == null)
        {
            entity = SetGameplayServicesInputInputService(newInstance);
        }
        else
        {
            entity.ReplaceGameplayServicesInputInputService(newInstance);
        }
    }