Fixing lighting on foreground objects. Also making it so that local assets in the ForegroundObjectPlacementRandomizer continue to work for local testing

This commit is contained in:
Jon Hogins 2021-04-22 15:09:19 -07:00
Родитель 2dcb8f980d
Коммит 31e1650d57
2 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -61,12 +61,23 @@ namespace SynthDet.Randomizers
foreach (var prefab in prefabs)
{
ConfigureLayerRecursive(prefab);
ConfigureRandomizerTags(prefab);
}
m_GameObjectOneWayCache = new GameObjectOneWayCache(m_Container.transform, prefabs);
}
private static void ConfigureLayerRecursive(GameObject prefab)
{
prefab.layer = LayerMask.NameToLayer("Foreground");
for (int i = 0; i < prefab.transform.childCount; i++)
{
var child = prefab.transform.GetChild(i).gameObject;
ConfigureLayerRecursive(child);
}
}
/// <summary>
/// Generates a foreground layer of objects at the start of each scenario iteration
/// </summary>

Просмотреть файл

@ -115,7 +115,7 @@ namespace SynthDet.Scenarios
// Inject the loaded prefabs into the ForegroundObjectPlacementRandomizer
var randomizer = GetRandomizer<ForegroundObjectPlacementRandomizer>();
randomizer.prefabs = prefabsList.ToArray();
randomizer.prefabs = randomizer.prefabs.Concat(prefabsList).ToArray();
}
void ConfigureLabeling(GameObject gObj)