Skip to content

Commit

Permalink
MRTK3's bounding box runtime example needs to cycle around to start. (#…
Browse files Browse the repository at this point in the history
…11748)

The bounding box runtime example needs to cycle.  Also adding the ability to move bounding box runtime scene content, and added simple profiler to scene.
  • Loading branch information
AMollis committed Jul 27, 2023
1 parent b30acdb commit bf1336b
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 48 deletions.
Expand Up @@ -568,7 +568,7 @@ MonoBehaviour:
<OnDisabled>k__BackingField:
m_PersistentCalls:
m_Calls: []
hostTransform: {fileID: 95915944}
hostTransform: {fileID: 1006616005}
allowedManipulations: 7
allowedInteractionTypes: -2147483641
applyTorque: 1
Expand Down Expand Up @@ -611,46 +611,6 @@ MonoBehaviour:
m_EditorClassIdentifier:
autoConstraintSelection: 1
selectedConstraints: []
--- !u!114 &95915948
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 95915943}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f3f2652d4ff14543be4d1ece28036a0, type: 3}
m_Name:
m_EditorClassIdentifier:
boundsVisualsPrefab: {fileID: 5671351296789090341, guid: 7b542306e34a62f4c9a822fcb19b7d99, type: 3}
boundsCalculationMethod: 0
includeInactiveObjects: 0
overrideBounds: 0
boundsOverride: {fileID: 0}
flattenMode: 1
boundsPadding: 0.02
interactable: {fileID: 0}
toggleHandlesOnClick: 1
dragToggleThreshold: 0.005
target: {fileID: 0}
handlesActive: 0
enabledHandles: 2
rotateAnchor: 1
scaleAnchor: 0
scaleBehavior: 0
smoothingActive: 1
rotateLerpTime: 0.00001
scaleLerpTime: 0.00001
translateLerpTime: 0.00001
enableConstraints: 1
constraintsManager: {fileID: 0}
manipulationStarted:
m_PersistentCalls:
m_Calls: []
manipulationEnded:
m_PersistentCalls:
m_Calls: []
--- !u!114 &95915949
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -761,7 +721,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 1220126736778559586, guid: 5e1e5c2fb89ded5469dd37ccbed1a896, type: 3}
propertyPath: m_RootOrder
value: 3
value: 4
objectReference: {fileID: 0}
- target: {fileID: 1220126736778559586, guid: 5e1e5c2fb89ded5469dd37ccbed1a896, type: 3}
propertyPath: m_LocalPosition.x
Expand Down Expand Up @@ -923,8 +883,8 @@ MonoBehaviour:
m_Calls: []
m_text: Status Text
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontAsset: {fileID: 11400000, guid: fea6b26abeefbc547b6aca1dbda0a34d, type: 2}
m_sharedMaterial: {fileID: -2049848100760321927, guid: fea6b26abeefbc547b6aca1dbda0a34d, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
Expand Down Expand Up @@ -1013,7 +973,7 @@ MeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
- {fileID: -2049848100760321927, guid: fea6b26abeefbc547b6aca1dbda0a34d, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
Expand Down Expand Up @@ -1048,7 +1008,7 @@ RectTransform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1006616005}
m_RootOrder: 2
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
Expand Down Expand Up @@ -1282,11 +1242,43 @@ Transform:
m_Children:
- {fileID: 95915944}
- {fileID: 1886794917}
- {fileID: 1321897323}
- {fileID: 414943983}
- {fileID: 291233361}
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1321897322
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1321897323}
m_Layer: 0
m_Name: Cube Container
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1321897323
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1321897322}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1006616005}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1531496039
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1401,6 +1393,67 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: ad5b753b73e311143a85055b15cea562, type: 3}
--- !u!1001 &1864273390
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 7781529056550460865, guid: c07c4bd04b45c014fad0e3cd30747f06, type: 3}
propertyPath: m_RootOrder
value: 6
objectReference: {fileID: 0}
- target: {fileID: 7781529056550460865, guid: c07c4bd04b45c014fad0e3cd30747f06, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7781529056550460865, guid: c07c4bd04b45c014fad0e3cd30747f06, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7781529056550460865, guid: c07c4bd04b45c014fad0e3cd30747f06, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7781529056550460865, guid: c07c4bd04b45c014fad0e3cd30747f06, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7781529056550460865, guid: c07c4bd04b45c014fad0e3cd30747f06, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7781529056550460865, guid: c07c4bd04b45c014fad0e3cd30747f06, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7781529056550460865, guid: c07c4bd04b45c014fad0e3cd30747f06, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7781529056550460865, guid: c07c4bd04b45c014fad0e3cd30747f06, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7781529056550460865, guid: c07c4bd04b45c014fad0e3cd30747f06, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7781529056550460865, guid: c07c4bd04b45c014fad0e3cd30747f06, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7781529056550460866, guid: c07c4bd04b45c014fad0e3cd30747f06, type: 3}
propertyPath: m_Name
value: SimpleProfiler
objectReference: {fileID: 0}
- target: {fileID: 7781529056550460866, guid: c07c4bd04b45c014fad0e3cd30747f06, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c07c4bd04b45c014fad0e3cd30747f06, type: 3}
--- !u!1 &1886794915
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1435,6 +1488,7 @@ MonoBehaviour:
redMaterial: {fileID: 2100000, guid: db61b94b23e5fb444b86c231d13e46ef, type: 2}
cyanMaterial: {fileID: 2100000, guid: 0c3570eeff29ef44e9fed596a4cc3ffd, type: 2}
boundsVisualsPrefab: {fileID: 5671351296789090341, guid: ecbf05ce2121a744cb893e82377ba3cd, type: 3}
cubeParent: {fileID: 1321897323}
--- !u!4 &1886794917
Transform:
m_ObjectHideFlags: 0
Expand Down
Expand Up @@ -23,14 +23,19 @@ public class BoundsControlRuntimeExample : MonoBehaviour

[SerializeField]
private Material darkGrayMaterial;

[SerializeField]
private Material redMaterial;

[SerializeField]
private Material cyanMaterial;

[SerializeField]
private GameObject boundsVisualsPrefab;

[SerializeField]
private Transform cubeParent;

private bool nextTriggeredFlag;
private Vector3 cubePosition = new Vector3(0, 1.2f, 2);
private Vector3 cubeSize = new Vector3(0.5f, 0.5f, 0.5f);
Expand Down Expand Up @@ -63,10 +68,13 @@ private void SetStatus(string status)
/// </summary>
private IEnumerator Sequence()
{
// Keep cycling through test until scene is exitted.
while (true)
{
var cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
Debug.Assert(darkGrayMaterial != null);
cube.GetComponent<MeshRenderer>().material = darkGrayMaterial;
cube.transform.SetParent(cubeParent == null ? transform : cubeParent);
cube.transform.position = cubePosition;
cube.transform.localScale = cubeSize;

Expand Down Expand Up @@ -198,9 +206,10 @@ private IEnumerator Sequence()
yield return WaitForButtonPressOrCommand();

Destroy(multiRoot);
}

SetStatus("Done!");
SetStatus("Done!");
yield return WaitForButtonPressOrCommand();
}
}

/// <summary>
Expand Down

0 comments on commit bf1336b

Please sign in to comment.