Skip to content

Commit

Permalink
add missing true centers
Browse files Browse the repository at this point in the history
  • Loading branch information
acmoles committed May 23, 2021
1 parent 5ec9068 commit 49ce740
Show file tree
Hide file tree
Showing 10 changed files with 167 additions and 112 deletions.
35 changes: 33 additions & 2 deletions Assets/Prefabs/Lego/Extra/3660.prefab
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,36 @@ MeshRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &664136998639887110
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2974275131496571592}
m_Layer: 0
m_Name: TrueCenter
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2974275131496571592
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 664136998639887110}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.40000004, y: 0.569, z: 0.39999998}
m_LocalScale: {x: 50, y: 50, z: 50}
m_Children: []
m_Father: {fileID: 1721937457315677544}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1720837940794378551
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -108,6 +138,7 @@ Transform:
m_Children:
- {fileID: 5107738925671915020}
- {fileID: 3753573341636199450}
- {fileID: 2974275131496571592}
- {fileID: 2061674920177176443}
- {fileID: 6384221403784412520}
m_Father: {fileID: 1200569895663145169}
Expand Down Expand Up @@ -145,7 +176,7 @@ Transform:
- {fileID: 1405359044754806876}
- {fileID: 3114926945065804411}
m_Father: {fileID: 1721937457315677544}
m_RootOrder: 2
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2225094115016291412
GameObject:
Expand Down Expand Up @@ -253,7 +284,7 @@ Transform:
- {fileID: 7651642867498827830}
- {fileID: 7470344770554520833}
m_Father: {fileID: 1721937457315677544}
m_RootOrder: 3
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &4040151003470267820
GameObject:
Expand Down
39 changes: 35 additions & 4 deletions Assets/Prefabs/Lego/Extra/3665.prefab
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &20378562439040042
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4867780369065982235}
m_Layer: 0
m_Name: TrueCenter
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4867780369065982235
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 20378562439040042}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0.569, z: 0.39896107}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 6015346986544906394}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &576917873713580301
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -30,7 +60,7 @@ Transform:
- {fileID: 6798789983007725917}
- {fileID: 1377270756792321445}
m_Father: {fileID: 6015346986544906394}
m_RootOrder: 3
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1195664108138478632
GameObject:
Expand Down Expand Up @@ -301,7 +331,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 6015346986544906394}
m_RootOrder: 1
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &4945918417536505154
MeshFilter:
Expand Down Expand Up @@ -465,6 +495,7 @@ Transform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.02, y: 0.02, z: 0.02}
m_Children:
- {fileID: 4867780369065982235}
- {fileID: 6103285480020610770}
- {fileID: 1591041519689998800}
- {fileID: 3892247864312694157}
Expand Down Expand Up @@ -507,7 +538,7 @@ Transform:
- {fileID: 1728719057129246712}
- {fileID: 5560800554238751798}
m_Father: {fileID: 6015346986544906394}
m_RootOrder: 2
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &5262650469454819734
GameObject:
Expand Down Expand Up @@ -705,7 +736,7 @@ Transform:
m_Children:
- {fileID: 2983105900700901346}
m_Father: {fileID: 6015346986544906394}
m_RootOrder: 0
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &7262925524697140869
GameObject:
Expand Down
97 changes: 3 additions & 94 deletions Assets/Scenes/Objects.unity
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &80749898
PrefabInstance:
Expand Down Expand Up @@ -1908,7 +1908,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &662596207 stripped
Transform:
Expand Down Expand Up @@ -5704,7 +5704,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1213642857
MonoBehaviour:
Expand Down Expand Up @@ -5869,51 +5869,6 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 1109620948}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1684546026
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 190014, guid: 323169e9766db69459a435e10f3feed0, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 490014, guid: 323169e9766db69459a435e10f3feed0, type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 490014, guid: 323169e9766db69459a435e10f3feed0, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 490014, guid: 323169e9766db69459a435e10f3feed0, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 490014, guid: 323169e9766db69459a435e10f3feed0, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 490014, guid: 323169e9766db69459a435e10f3feed0, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 490014, guid: 323169e9766db69459a435e10f3feed0, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 490014, guid: 323169e9766db69459a435e10f3feed0, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 490014, guid: 323169e9766db69459a435e10f3feed0, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 323169e9766db69459a435e10f3feed0, type: 3}
--- !u!4 &1748310087 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -5351475938880831575, guid: bea3bd198083a6f4b8919651bc1b8475,
Expand Down Expand Up @@ -6023,52 +5978,6 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 1109620948}
m_PrefabAsset: {fileID: 0}
--- !u!1 &2004418781
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 190014, guid: 323169e9766db69459a435e10f3feed0,
type: 3}
m_PrefabInstance: {fileID: 1684546026}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2004418783}
- component: {fileID: 2004418782}
m_Layer: 0
m_Name: SRDebugger.Init
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!114 &2004418782
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 11490014, guid: 323169e9766db69459a435e10f3feed0,
type: 3}
m_PrefabInstance: {fileID: 1684546026}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2004418781}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 66edd3610b01cce48aed05383fd196e5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &2004418783
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 490014, guid: 323169e9766db69459a435e10f3feed0,
type: 3}
m_PrefabInstance: {fileID: 1684546026}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2004418781}
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_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2059607117
GameObject:
m_ObjectHideFlags: 0
Expand Down
36 changes: 36 additions & 0 deletions Assets/Scripts/Editor/PositionAtBoundsCenter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.IO;
using System;

public class PositionAtBoundsCenter
{
[MenuItem("Tools/Lego/Position at Bounds Center")]
public static void PositionAtBounds()
{
foreach (GameObject go in Selection.gameObjects)
{
Debug.Log("Object: " + go.name);

Transform myShell = go.transform.Find(go.name + "/Shell");

// Change to whatever gameobject to position
Transform myTarget = go.transform.Find(go.name + "/TrueCenter");


if (myShell && myTarget)
{
Mesh shellMesh = myShell.GetComponent<MeshFilter>().sharedMesh;
Bounds bounds = shellMesh.bounds;
myTarget.localPosition = bounds.center;
}



}

}
}

11 changes: 11 additions & 0 deletions Assets/Scripts/Editor/PositionAtBoundsCenter.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Assets/Scripts/Interaction/CloneSphere.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected virtual void OnCountdownFinished()
}
}
//repeatThreshhold = 0.64f;
cycledOnce = true;
//cycledOnce = true;
Debug.Log("Stop: make clone");
}

Expand Down
6 changes: 3 additions & 3 deletions Packages/manifest.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"com.unity.ide.visualstudio": "2.0.3",
"com.unity.ide.vscode": "1.2.3",
"com.unity.postprocessing": "3.0.3",
"com.unity.test-framework": "1.1.19",
"com.unity.textmeshpro": "2.1.3",
"com.unity.test-framework": "1.1.24",
"com.unity.textmeshpro": "2.1.4",
"com.unity.timeline": "1.3.6",
"com.unity.ugui": "1.0.0",
"com.unity.xr.legacyinputhelpers": "2.1.6",
"com.unity.xr.legacyinputhelpers": "2.1.7",
"com.unity.xr.openvr.standalone": "2.0.5",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
Expand Down
15 changes: 9 additions & 6 deletions Packages/packages-lock.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"url": "https://pkgs.dev.azure.com/aipmr/MixedReality-Unity-Packages/_packaging/Unity-packages/npm/registry"
},
"com.unity.ext.nunit": {
"version": "1.0.5",
"version": "1.0.6",
"depth": 1,
"source": "registry",
"dependencies": {},
Expand Down Expand Up @@ -85,18 +85,18 @@
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.19",
"version": "1.1.24",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ext.nunit": "1.0.5",
"com.unity.ext.nunit": "1.0.6",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.textmeshpro": {
"version": "2.1.3",
"version": "2.1.4",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -121,10 +121,13 @@
}
},
"com.unity.xr.legacyinputhelpers": {
"version": "2.1.6",
"version": "2.1.7",
"depth": 0,
"source": "registry",
"dependencies": {},
"dependencies": {
"com.unity.modules.vr": "1.0.0",
"com.unity.modules.xr": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.xr.openvr.standalone": {
Expand Down
Loading

0 comments on commit 49ce740

Please sign in to comment.