コード例 #1
0
    public void ReplaceBlueprints(Entitas.Blueprints.Unity.Blueprints newValue)
    {
        var index     = GameComponentsLookup.Blueprints;
        var component = CreateComponent <BlueprintsComponent>(index);

        component.value = newValue;
        ReplaceComponent(index, component);
    }
コード例 #2
0
    public GameEntity SetBlueprints(Entitas.Blueprints.Unity.Blueprints newValue)
    {
        if (hasBlueprints)
        {
            throw new Entitas.EntitasException("Could not set Blueprints!\n" + this + " already has an entity with BlueprintsComponent!",
                                               "You should check if the context already has a blueprintsEntity before setting it or use context.ReplaceBlueprints().");
        }
        var entity = CreateEntity();

        entity.AddBlueprints(newValue);
        return(entity);
    }
コード例 #3
0
    public void ReplaceBlueprints(Entitas.Blueprints.Unity.Blueprints newValue)
    {
        var entity = blueprintsEntity;

        if (entity == null)
        {
            entity = SetBlueprints(newValue);
        }
        else
        {
            entity.ReplaceBlueprints(newValue);
        }
    }