Esempio n. 1
0
    public void ReplaceGameRoot(ChessKnight.Unity.GameRootScript newValue)
    {
        var index     = GameComponentsLookup.GameRoot;
        var component = CreateComponent <ChessKnight.Unity.GameRootComponent>(index);

        component.Value = newValue;
        ReplaceComponent(index, component);
    }
Esempio n. 2
0
    public GameEntity SetGameRoot(ChessKnight.Unity.GameRootScript newValue)
    {
        if (hasGameRoot)
        {
            throw new Entitas.EntitasException("Could not set GameRoot!\n" + this + " already has an entity with ChessKnight.Unity.GameRootComponent!",
                                               "You should check if the context already has a gameRootEntity before setting it or use context.ReplaceGameRoot().");
        }
        var entity = CreateEntity();

        entity.AddGameRoot(newValue);
        return(entity);
    }
Esempio n. 3
0
    public void ReplaceGameRoot(ChessKnight.Unity.GameRootScript newValue)
    {
        var entity = gameRootEntity;

        if (entity == null)
        {
            entity = SetGameRoot(newValue);
        }
        else
        {
            entity.ReplaceGameRoot(newValue);
        }
    }