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:
Родитель
2dcb8f980d
Коммит
31e1650d57
|
@ -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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче