exclude cache objects from foreground metric
This commit is contained in:
Родитель
beb128f23e
Коммит
0bf42b36dc
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:04d5b2bcfb597bbc7f8410dc3dd7a7fd59439397d69bbefc2a805b2ab94bbed3
|
||||
size 103518
|
||||
oid sha256:5fbbd1379e1e2df31d0f56a3746805dc1512671f33624de4cd0a84c7ab4e7b4a
|
||||
size 103517
|
||||
|
|
|
@ -51,6 +51,10 @@ namespace SynthDet.Randomizers
|
|||
var objectStates = new JArray();
|
||||
foreach (var tag in tags)
|
||||
{
|
||||
if (Math.Abs(tag.gameObject.transform.position.x - GameObjectOneWayCache.outOfViewX) < 0.001)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var taggedObject = tag.gameObject;
|
||||
if (!m_LabelingComponentsCache.TryGetValue(taggedObject, out var labeling))
|
||||
{
|
||||
|
|
|
@ -18,6 +18,7 @@ public class GameObjectOneWayCache
|
|||
List<GameObject>[] m_InstantiatedObjects;
|
||||
int[] m_NumObjectsActive;
|
||||
int NumObjectsInCache { get; set; }
|
||||
public const float outOfViewX = 10000;
|
||||
public int NumObjectsActive { get; private set; }
|
||||
|
||||
public GameObjectOneWayCache(Transform parent, GameObject[] prefabs)
|
||||
|
@ -73,7 +74,7 @@ public class GameObjectOneWayCache
|
|||
foreach (var obj in m_InstantiatedObjects[i])
|
||||
{
|
||||
// Position outside the frame
|
||||
obj.transform.localPosition = new Vector3(10000, 0, 0);
|
||||
obj.transform.localPosition = new Vector3(outOfViewX, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче