Skip to content

Commit 7f0c1b0

Browse files
authored
patch for 1.2.4
-fixed toon gorilla - patch for Gorilla Summer Celebration
1 parent 2ee9e37 commit 7f0c1b0

5 files changed

Lines changed: 75 additions & 51 deletions

File tree

PlayerAssets/Toon Gorilla.gtmodel

5.28 KB
Binary file not shown.

Plugin.cs

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,12 @@ public void OnGameInitialized(object sender, EventArgs e)
195195
PlayerModelController.PreviewModel(Convert.ToInt32(defaultdata[0]));
196196
if (defaultdata[2] == model_text.text)//matching playermodel name
197197
{
198-
Debug.Log("Loading Default PlayerModel");
198+
//Debug.Log("Loading Default PlayerModel");
199199
playerIndex = Convert.ToInt32(defaultdata[0]);
200200
PlayerModelController.PreviewModel(playerIndex);
201201
IsGorilla = false;
202+
assignedIndex = playerIndex;
203+
202204
}
203205

204206
}
@@ -212,7 +214,7 @@ public void OnGameInitialized(object sender, EventArgs e)
212214

213215
}
214216
STARTPLAYERMOD = true;
215-
217+
Debug.Log("PlayerModel v1.2.4");
216218
}
217219

218220

@@ -350,7 +352,7 @@ public static void ButtonPress(int button)
350352
{
351353

352354
case 1:
353-
Debug.Log("Selector Button Pressed");
355+
//Debug.Log("Selector Button Pressed");
354356
if (nachotext == false)
355357
{
356358
Destroy(GameObject.Find("nachoengine_playermodelmod"));
@@ -374,14 +376,14 @@ public static void ButtonPress(int button)
374376

375377
if (assignedIndex == playerIndex)//playermodel to gorilla
376378
{
377-
Debug.Log("PlayerModel to Gorilla");
379+
//Debug.Log("PlayerModel to Gorilla");
378380
PlayerModelController.UnloadModel();
379381
IsGorilla = true;
380382
player_main_material = null;
381383
}
382384
else//playermodel to playermodel
383385
{
384-
Debug.Log("PlayerModel to PlayerModel");
386+
//Debug.Log("PlayerModel to PlayerModel");
385387
PlayerModelController.UnloadModel();
386388
player_main_material = null;
387389

@@ -397,7 +399,7 @@ public static void ButtonPress(int button)
397399
break;
398400
case 2:
399401
playerIndex++; //righjt
400-
Debug.Log("Right");
402+
//Debug.Log("Right");
401403

402404
if (playerIndex > fileName.Length-1)
403405
playerIndex = 0;
@@ -406,7 +408,7 @@ public static void ButtonPress(int button)
406408
break;
407409
case 3:
408410
playerIndex--;
409-
Debug.Log("Left");
411+
//Debug.Log("Left");
410412
if (playerIndex < 0)
411413
playerIndex = fileName.Length-1;//10 items but starts from 0 so 0 to 9 = 10 items
412414
PlayerModelController.PreviewModel(playerIndex);
@@ -471,13 +473,48 @@ public void voiceSmoothing()
471473
public float LipSyncWeight = 0;
472474

473475
public bool LipSyncFlag = true;
476+
477+
public bool InRoom = false;
478+
479+
480+
/*private void RoomJoined(object sender, Events.RoomJoinedArgs e)
481+
{
482+
Debug.Log("Joined room");
483+
InRoom = true;
484+
}
485+
486+
private void RoomLeft(object sender, Events.RoomJoinedArgs e)
487+
{
488+
Debug.Log("Left room");
489+
InRoom = false;
490+
}*/
491+
474492
private void Update()
475493
{
494+
476495
if (!STARTPLAYERMOD)
477496
{
478497
return;
479498
}
499+
500+
if (Time.time > currentTime)
501+
{
502+
currentTime = Time.time + 1;
503+
504+
if (PlayerModelController.localPositionY == 1f)
505+
{
506+
PlayerModelController.localPositionY = -1f;
507+
}
508+
else
509+
{
510+
PlayerModelController.localPositionY = 1f;
511+
}
512+
}
513+
514+
480515

516+
PlayerModelController.rotationY -= 0.2f;
517+
481518
/*loudness = GetLoudnessFromMic() * loudnessSensitivity;
482519
483520
voiceSmoothing();
@@ -495,14 +532,14 @@ private void Update()
495532

496533
if (Keyboard.current.jKey.wasPressedThisFrame)
497534
SelectButton.GetComponent<PlayerModelButton>().Press();
498-
535+
499536
if (Keyboard.current.hKey.wasPressedThisFrame)
500537
LeftButton.GetComponent<PlayerModelButton>().Press();
501538

502539
if (Keyboard.current.kKey.wasPressedThisFrame)
503540
RightButton.GetComponent<PlayerModelButton>().Press();
504541

505-
PlayerModelController.rotationY -= 0.5f;
542+
506543
//Debug.Log(IsGorilla);
507544

508545
/*if (GorillaParent.instance.vrrigs.Count >= 1)
@@ -548,7 +585,7 @@ private void Update()
548585
{
549586

550587
PlayerModelAppearance.ShowOfflineRig();
551-
PlayerModelAppearance.ShowOnlineRig();
588+
//PlayerModelAppearance.ShowOnlineRig();
552589
flag_inroom = true;
553590
PlayerModelAppearance.flag1 = true;
554591

@@ -560,7 +597,7 @@ private void Update()
560597
{
561598

562599
PlayerModelAppearance.HideOfflineRig();
563-
PlayerModelAppearance.HideOnlineRig();
600+
//PlayerModelAppearance.HideOnlineRig();
564601

565602
if (PlayerModelController.CustomColors)
566603
PlayerModelAppearance.AssignColor();

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.3";
11+
public const string Version = "1.2.4";
1212
}
1313
}

Scripts/PlayerModelAppearance.cs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,27 @@ static public void HideOnlineRig()
3131
}
3232
static public void HideOfflineRig()
3333
{
34-
Debug.Log("hidding gorilla");
34+
//Debug.Log("hidding gorilla");
3535
int LayerCameraIgnore = LayerMask.NameToLayer("Bake");//hidden layer
3636

37-
GameObject gorillaface = GorillaTagger.Instance.offlineVRRig.mainSkin.transform.parent.Find("rig/body/head/gorillaface").gameObject;
37+
GameObject gorillaface = GameObject.Find("Global/Local VRRig/Local Gorilla Player/rig/body/head/gorillaface").gameObject;
3838
gorillaface.layer = LayerCameraIgnore;
39-
GameObject gorillabody = GorillaTagger.Instance.offlineVRRig.mainSkin.gameObject;
39+
GameObject gorillabody = GameObject.Find("Global/Local VRRig/Local Gorilla Player/gorilla");
4040
gorillabody.layer = LayerCameraIgnore;
41-
GameObject gorillachest = GorillaTagger.Instance.offlineVRRig.mainSkin.transform.parent.Find("rig/body/gorillachest").gameObject;
41+
GameObject gorillachest = GameObject.Find("Global/Local VRRig/Local Gorilla Player/rig/body/gorillachest").gameObject;
4242
gorillachest.layer = LayerCameraIgnore;
4343

4444

4545
}
4646

4747
static public void ShowOfflineRig()
4848
{
49+
//Debug.Log("showing gorilla");
4950
int LayerCameraIgnore = LayerMask.NameToLayer("Default");
5051

5152
GameObject gorillaface = GorillaTagger.Instance.offlineVRRig.mainSkin.transform.parent.Find("rig/body/head/gorillaface").gameObject;
5253
gorillaface.layer = LayerCameraIgnore;
53-
GameObject gorillabody = GorillaTagger.Instance.offlineVRRig.mainSkin.gameObject;
54+
GameObject gorillabody = GameObject.Find("Global/Local VRRig/Local Gorilla Player/gorilla");
5455
gorillabody.layer = LayerCameraIgnore;
5556
GameObject gorillachest = GorillaTagger.Instance.offlineVRRig.mainSkin.transform.parent.Find("rig/body/gorillachest").gameObject;
5657
gorillachest.layer = LayerCameraIgnore;
@@ -110,7 +111,7 @@ static public void ResetMaterial(GameObject playermodel)
110111
if (playermats[mat_index] != Plugin.player_main_material)
111112
{
112113
playermats[mat_index] = Plugin.player_main_material;
113-
Debug.Log("reset mat");
114+
//Debug.Log("reset mat");
114115
playermodel.GetComponent<SkinnedMeshRenderer>().materials = playermats;
115116
}
116117
}
@@ -176,21 +177,22 @@ static public void AssignMaterial(GameObject playermodel)
176177
{
177178
mat_index = PlayerModelController.gamemat_index;
178179
colormat_index = PlayerModelController.colormat_index;
179-
GameObject clone_body = GameObject.Find("Global/GorillaParent/GorillaVRRigs/Gorilla Player Networked(Clone)/gorilla");
180-
if(clone_body != null) //if in a lobby
180+
GameObject gorillabody = GorillaTagger.Instance.offlineVRRig.mainSkin.gameObject;
181+
//GameObject clone_body = GameObject.Find("Global/GorillaParent/GorillaVRRigs/Gorilla Player Networked(Clone)/gorilla");
182+
if(gorillabody != null) //if in a lobby
181183
{
182-
if (clone_body.GetComponent<Renderer>().material.name == "darkfur 1(Clone) (Instance)")//if not main mat
184+
if (gorillabody.GetComponent<Renderer>().material.name == "darkfur 1(Clone) (Instance)")//if not main mat
183185
{
184186
if (playermats[mat_index] != Plugin.player_main_material)
185187
{
186188
playermats[mat_index] = Plugin.player_main_material;
187-
Debug.Log("Playermodel main mat assigned");
189+
//Debug.Log("Playermodel main mat assigned");
188190
}
189191

190192
}
191193
else
192194
{
193-
playermats[mat_index] = clone_body.GetComponent<Renderer>().material; //lava ice rockstones
195+
playermats[mat_index] = gorillabody.GetComponent<Renderer>().material; //lava ice rockstones
194196
}
195197

196198

Scripts/PlayerModelController.cs

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static public void PreviewModel(int index)
127127
{
128128
if (bool.Parse(player_info[6]))
129129
{
130-
Debug.Log("This Playermodel has lipsync on");
130+
//Debug.Log("This Playermodel has lipsync on");
131131
}
132132
}
133133

@@ -166,7 +166,7 @@ static public void UnloadModel()
166166
GameObject playermodel = GameObject.Find("playermodel.ParentObject(Clone)");
167167
if (playermodel != null)
168168
{
169-
Debug.Log("Unloading Playermodel");
169+
//Debug.Log("Unloading Playermodel");
170170
GameObject headbone = GameObject.Find(playermodel_head);
171171
GameObject HandRight = GameObject.Find(playermodel_lefthand);
172172
GameObject HandLeft = GameObject.Find(playermodel_righthand);
@@ -212,7 +212,7 @@ static public void UnloadModel()
212212
public static Quaternion headoffset;
213213
static public void LoadModel(int index)
214214
{
215-
Debug.Log("Loading Playermodel: "+index);
215+
//Debug.Log("Loading Playermodel: "+index);
216216
LipSync = false;
217217

218218
AssetBundle playerbundle = AssetBundle.LoadFromFile(Path.Combine(PlayerModel.Plugin.playerpath, PlayerModel.Plugin.fileName[index]));
@@ -226,11 +226,11 @@ static public void LoadModel(int index)
226226
playerbundle.Unload(false);
227227

228228
player_info_stream = parentAsset.GetComponent<Text>().text;
229-
229+
Debug.Log(player_info_stream);
230230
player_info = player_info_stream.Split('$');
231231

232232
parentAsset.GetComponent<Text>().enabled = false;
233-
Debug.Log(player_info[0]);
233+
//Debug.Log(player_info[0]);
234234
CustomColors = bool.Parse(player_info[2]);
235235

236236
GameModeTextures = bool.Parse(player_info[3]);
@@ -270,12 +270,14 @@ static public void LoadModel(int index)
270270
{
271271
Plugin.player_main_material = PlayerModelAppearance.playermats[i];
272272
gamemat_index = i;
273-
Debug.Log("Assigned Main mat: "+ Plugin.player_main_material + " to: " + i + " " + PlayerModelAppearance.playermats[i]);
273+
//Debug.Log("Assigned Main mat: "+ Plugin.player_main_material + " to: " + i + " " + PlayerModelAppearance.playermats[i]);
274274
}
275275
}
276276

277-
if (player_info.Length == 7)
277+
if (player_info.Length == 7) //PlayerModel v3
278278
{
279+
modelVersion = 2;
280+
Debug.Log("playermodel v3 lipsync");
279281
if (bool.Parse(player_info[6]))
280282
{
281283
LipSync = true;
@@ -297,7 +299,7 @@ static public void LoadModel(int index)
297299
public static int modelVersion;
298300
static public void AssignModel()
299301
{
300-
Debug.Log("playermodel assigned");
302+
//Debug.Log("playermodel assigned");
301303
if (player_info.Length > 4)
302304
{
303305
modelVersion = 1;
@@ -306,6 +308,7 @@ static public void AssignModel()
306308
{
307309
modelVersion = 0;
308310
}
311+
Debug.Log(modelVersion);
309312
GameObject hand_l = GameObject.Find("Global/Local VRRig/Local Gorilla Player/rig/body/shoulder.L/upper_arm.L/forearm.L/hand.L");
310313
GameObject hand_r = GameObject.Find("Global/Local VRRig/Local Gorilla Player/rig/body/shoulder.R/upper_arm.R/forearm.R/hand.R");
311314

@@ -377,6 +380,7 @@ static public void AssignModel()
377380
headbone.transform.localPosition = new Vector3(0,0,0);
378381
if(player_info.Length == 7)
379382
{
383+
Debug.Log("scaling for v3 model");
380384
Vector3 scale = new Vector3(100, 100, 100);
381385
root.transform.localScale = scale;
382386
headbone.transform.localScale = scale;
@@ -416,26 +420,7 @@ static public void assignDigit(GameObject hand, List<GameObject> digits)
416420
digits.Add(hand.transform.GetChild(thumb).gameObject);
417421
}
418422
float currentTime;
419-
public void Update()
420-
{
421-
422-
423-
424-
425-
426-
if (Time.time < currentTime)
427-
return;
428-
429-
currentTime = Time.time + 1;
430-
431-
if (PlayerModelController.localPositionY == 1f)
432-
PlayerModelController.localPositionY = -1f;
433-
else
434-
PlayerModelController.localPositionY = 1f;
435-
436-
437-
438-
}
423+
439424

440425
public class SpinYouBaboon : MonoBehaviour
441426
{

0 commit comments

Comments
 (0)