-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathExposedAnchorPrefabSpawner.cs
More file actions
37 lines (30 loc) · 976 Bytes
/
ExposedAnchorPrefabSpawner.cs
File metadata and controls
37 lines (30 loc) · 976 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (c) Meta Platforms, Inc. and affiliates.
using Meta.XR.Samples;
using Meta.XR.MRUtilityKit;
/// <summary>
/// This shallow class is necessitated by the private/protected nature of many useful fixtures inside MRUK's
/// AnchorPrefabSpawner component. This is a disgruntled workaround to expose said fixtures, allowing other scripts
/// and UI callbacks alike to call into this previously-sequestered functionality.
/// </summary>
/// <remarks>
/// Sealed = the madness ends here.
/// </remarks>
[MetaCodeSample("SpaceSharing")]
public sealed class ExposedAnchorPrefabSpawner : AnchorPrefabSpawner
{
public void ClearSpawnees()
{
base.ClearPrefabs();
}
public void SpawnPrefabs()
{
base.SpawnPrefabs(clearPrefabs: true);
}
public void SetSpawneesActive(bool active)
{
foreach (var spawnee in AnchorPrefabSpawnerObjects.Values)
{
spawnee.SetActive(active);
}
}
}