public void ReplaceTransactionMapObject(Features.Config.MapObject newMapObject)
    {
        var index     = GameComponentsLookup.TransactionMapObject;
        var component = (Features.Components.Transaction.TransactionMapObjectComponent)CreateComponent(index, typeof(Features.Components.Transaction.TransactionMapObjectComponent));

        component.MapObject = newMapObject;
        ReplaceComponent(index, component);
    }
コード例 #2
0
    public void ReplaceMapObjectPlacement(Features.Config.MapObject newValue)
    {
        var index     = GameComponentsLookup.MapObjectPlacement;
        var component = (Features.Components.MapObjectPlacementComponent)CreateComponent(index, typeof(Features.Components.MapObjectPlacementComponent));

        component.Value = newValue;
        ReplaceComponent(index, component);
    }
コード例 #3
0
    public GameEntity SetMapObjectPlacement(Features.Config.MapObject newValue)
    {
        if (hasMapObjectPlacement)
        {
            throw new Entitas.EntitasException("Could not set MapObjectPlacement!\n" + this + " already has an entity with Features.Components.MapObjectPlacementComponent!",
                                               "You should check if the context already has a mapObjectPlacementEntity before setting it or use context.ReplaceMapObjectPlacement().");
        }
        var entity = CreateEntity();

        entity.AddMapObjectPlacement(newValue);
        return(entity);
    }
コード例 #4
0
    public void ReplaceMapObjectPlacement(Features.Config.MapObject newValue)
    {
        var entity = mapObjectPlacementEntity;

        if (entity == null)
        {
            entity = SetMapObjectPlacement(newValue);
        }
        else
        {
            entity.ReplaceMapObjectPlacement(newValue);
        }
    }