Beispiel #1
0
    public void ReplaceMissionsDB(MissionsDB newValue)
    {
        var index     = GameComponentsLookup.MissionsDB;
        var component = CreateComponent <MissionsDBComponent>(index);

        component.value = newValue;
        ReplaceComponent(index, component);
    }
Beispiel #2
0
    public GameEntity SetMissionsDB(MissionsDB newValue)
    {
        if (hasMissionsDB)
        {
            throw new Entitas.EntitasException("Could not set MissionsDB!\n" + this + " already has an entity with MissionsDBComponent!",
                                               "You should check if the context already has a missionsDBEntity before setting it or use context.ReplaceMissionsDB().");
        }
        var entity = CreateEntity();

        entity.AddMissionsDB(newValue);
        return(entity);
    }
Beispiel #3
0
    public void ReplaceMissionsDB(MissionsDB newValue)
    {
        var entity = missionsDBEntity;

        if (entity == null)
        {
            entity = SetMissionsDB(newValue);
        }
        else
        {
            entity.ReplaceMissionsDB(newValue);
        }
    }