Skip to content

Commit 992318b

Browse files
authored
Update to 1.2.5
updated gameobject paths
1 parent 7f0c1b0 commit 992318b

4 files changed

Lines changed: 42 additions & 16 deletions

File tree

Plugin.cs

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ void Awake()
4747

4848
public void OnGameInitialized(object sender, EventArgs e)
4949
{
50-
50+
GameObject headcollider = GorillaLocomotion.Player.Instance.headCollider.gameObject;
51+
Debug.LogError("headcollider name is: "+headcollider.name);
5152
//LipSyncStart();
5253
for (int thisReading = 0; thisReading < samples; thisReading++)
5354
{
@@ -214,7 +215,7 @@ public void OnGameInitialized(object sender, EventArgs e)
214215

215216
}
216217
STARTPLAYERMOD = true;
217-
Debug.Log("PlayerModel v1.2.4");
218+
//Debug.Log("PlayerModel v1.2.5");
218219
}
219220

220221

@@ -488,10 +489,28 @@ private void RoomLeft(object sender, Events.RoomJoinedArgs e)
488489
Debug.Log("Left room");
489490
InRoom = false;
490491
}*/
491-
492+
bool flagcode = false;
492493
private void Update()
493494
{
494-
495+
/*if (Keyboard.current.cKey.wasPressedThisFrame)
496+
{
497+
if (flagcode)
498+
{
499+
var embedcode = new EmbeddedEncoding();
500+
embedcode.Update();
501+
flagcode = false;
502+
}
503+
}
504+
else
505+
{
506+
flagcode = true;
507+
}*/
508+
509+
/*var embedcode = new EmbeddedEncoding();
510+
embedcode.Update();
511+
flagcode = false;
512+
*/
513+
495514
if (!STARTPLAYERMOD)
496515
{
497516
return;

PluginInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ class PluginInfo
88
{
99
public const string GUID = "com.nachoengine.playermodel";
1010
public const string Name = "PlayerModel";
11-
public const string Version = "1.2.4";
11+
public const string Version = "1.2.5";
1212
}
1313
}

Scripts/PlayerModelAppearance.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@ static public void HideOfflineRig()
3434
//Debug.Log("hidding gorilla");
3535
int LayerCameraIgnore = LayerMask.NameToLayer("Bake");//hidden layer
3636

37-
GameObject gorillaface = GameObject.Find("Global/Local VRRig/Local Gorilla Player/rig/body/head/gorillaface").gameObject;
37+
GameObject gorillaface = GameObject.Find("Player Objects/Local VRRig/Local Gorilla Player/rig/body/head/gorillaface").gameObject;
3838
gorillaface.layer = LayerCameraIgnore;
39-
GameObject gorillabody = GameObject.Find("Global/Local VRRig/Local Gorilla Player/gorilla");
39+
GameObject gorillabody = GameObject.Find("Player Objects/Local VRRig/Local Gorilla Player/gorilla");
40+
4041
gorillabody.layer = LayerCameraIgnore;
41-
GameObject gorillachest = GameObject.Find("Global/Local VRRig/Local Gorilla Player/rig/body/gorillachest").gameObject;
42+
GameObject gorillachest = GameObject.Find("Player Objects/Local VRRig/Local Gorilla Player/rig/body/gorillachest").gameObject;
4243
gorillachest.layer = LayerCameraIgnore;
4344

4445

@@ -51,7 +52,7 @@ static public void ShowOfflineRig()
5152

5253
GameObject gorillaface = GorillaTagger.Instance.offlineVRRig.mainSkin.transform.parent.Find("rig/body/head/gorillaface").gameObject;
5354
gorillaface.layer = LayerCameraIgnore;
54-
GameObject gorillabody = GameObject.Find("Global/Local VRRig/Local Gorilla Player/gorilla");
55+
GameObject gorillabody = GameObject.Find("Player Objects/Local VRRig/Local Gorilla Player/gorilla");
5556
gorillabody.layer = LayerCameraIgnore;
5657
GameObject gorillachest = GorillaTagger.Instance.offlineVRRig.mainSkin.transform.parent.Find("rig/body/gorillachest").gameObject;
5758
gorillachest.layer = LayerCameraIgnore;

Scripts/PlayerModelController.cs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ static public void LoadModel(int index)
245245
root = GameObject.Find(playermodel_torso);
246246

247247
headbone = GameObject.Find(playermodel_head);
248-
headtarget = GameObject.Find("Global/Local VRRig/Local Gorilla Player/rig/body/head");
248+
headtarget = GorillaTagger.Instance.offlineVRRig.mainSkin.transform.parent.Find("rig/body/head").gameObject;
249+
249250

250251
PlayerModelAppearance.playermats = GameObject.Find("playermodel.body").GetComponent<SkinnedMeshRenderer>().materials;
251252

@@ -299,7 +300,7 @@ static public void LoadModel(int index)
299300
public static int modelVersion;
300301
static public void AssignModel()
301302
{
302-
//Debug.Log("playermodel assigned");
303+
Debug.Log("playermodel assigned");
303304
if (player_info.Length > 4)
304305
{
305306
modelVersion = 1;
@@ -308,10 +309,15 @@ static public void AssignModel()
308309
{
309310
modelVersion = 0;
310311
}
311-
Debug.Log(modelVersion);
312-
GameObject hand_l = GameObject.Find("Global/Local VRRig/Local Gorilla Player/rig/body/shoulder.L/upper_arm.L/forearm.L/hand.L");
313-
GameObject hand_r = GameObject.Find("Global/Local VRRig/Local Gorilla Player/rig/body/shoulder.R/upper_arm.R/forearm.R/hand.R");
314-
312+
Debug.Log("Model Version: " + modelVersion);
313+
314+
GameObject hand_l = GorillaTagger.Instance.offlineVRRig.mainSkin.transform.parent.Find("rig/body/shoulder.L/upper_arm.L/forearm.L/hand.L").gameObject;
315+
Debug.Log(hand_l);
316+
GameObject hand_r = GorillaTagger.Instance.offlineVRRig.mainSkin.transform.parent.Find("rig/body/shoulder.R/upper_arm.R/forearm.R/hand.R").gameObject;
317+
Debug.Log(hand_r);
318+
GameObject bodyrig = GorillaTagger.Instance.offlineVRRig.mainSkin.transform.parent.Find("rig/body").gameObject;
319+
Debug.Log(bodyrig);
320+
//Debug.Log("CHECK1");
315321
offsetL.transform.SetParent(hand_l.transform, false);
316322

317323
offsetR.transform.SetParent(hand_r.transform, false);
@@ -370,7 +376,7 @@ static public void AssignModel()
370376
HandRight.AddComponent<FastIKFabric>();
371377
HandRight.GetComponent<FastIKFabric>().Target = offsetR.transform;
372378
HandRight.GetComponent<FastIKFabric>().Pole = poleR.transform;
373-
root.transform.SetParent(GameObject.Find("Global/Local VRRig/Local Gorilla Player/rig/body").transform, false);
379+
root.transform.SetParent(bodyrig.transform, false);
374380
root.transform.localRotation = Quaternion.Euler(0f, 0.0f, 0.0f);
375381

376382
headbone.transform.localRotation = headtarget.transform.localRotation;

0 commit comments

Comments
 (0)