コード例 #1
0
 private void OnScreenChanged(Ui.Screen screen)
 {
     _content.ToOption()
     .Select(v => v.Length != 0 ? v : GetChildren())
     .ValueOr(GetChildren)
     .Slinq()
     .ForEach((t, v) => t.gameObject.SetActive(v), _screen == screen);
 }
コード例 #2
0
    public void ReplaceScreen(Ui.Screen newValue)
    {
        var index     = UiComponentsLookup.Screen;
        var component = CreateComponent <Ui.ScreenComponent>(index);

        component.value = newValue;
        ReplaceComponent(index, component);
    }
コード例 #3
0
    public UiEntity SetScreen(Ui.Screen newValue)
    {
        if (hasScreen)
        {
            throw new Entitas.EntitasException("Could not set Screen!\n" + this + " already has an entity with Ui.ScreenComponent!",
                                               "You should check if the context already has a screenEntity before setting it or use context.ReplaceScreen().");
        }
        var entity = CreateEntity();

        entity.AddScreen(newValue);
        return(entity);
    }
コード例 #4
0
    public void ReplaceScreen(Ui.Screen newValue)
    {
        var entity = screenEntity;

        if (entity == null)
        {
            entity = SetScreen(newValue);
        }
        else
        {
            entity.ReplaceScreen(newValue);
        }
    }