Skip to content

Commit 4388e24

Browse files
authored
patch for v1.2.8
patch for Back To School update
1 parent f39dadf commit 4388e24

4 files changed

Lines changed: 81 additions & 109 deletions

File tree

Plugin.cs

Lines changed: 17 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
using UnityEngine.Audio;
1212
using UnityEngine.InputSystem;
1313
using UnityEngine.UI;
14-
using Utilla;
14+
1515

1616

1717
namespace PlayerModel
1818
{
19-
20-
[BepInDependency("org.legoandmars.gorillatag.utilla", "1.6.9")]
19+
/// <summary>
20+
/// This is your mod's main class.
21+
/// </summary>
22+
2123
[BepInPlugin(PluginInfo.GUID, PluginInfo.Name, PluginInfo.Version)]
2224
public class Plugin : BaseUnityPlugin
2325
{
@@ -26,11 +28,7 @@ public class Plugin : BaseUnityPlugin
2628
static public string _selectedDevice;
2729
static public AudioMixerGroup _mixerGroupMic;
2830
static public bool Cheaking = true;
29-
void Awake()
30-
{
31-
Utilla.Events.GameInitialized += OnGameInitialized;
32-
}
33-
31+
3432

3533
string rootPath;
3634
public static string textSavePath;
@@ -44,16 +42,19 @@ void Awake()
4442

4543
private ClientScript clientScript;
4644

47-
48-
public void OnGameInitialized(object sender, EventArgs e)
45+
void Awake()
4946
{
50-
47+
Utilla.Events.GameInitialized += OnGameInitialized;
48+
}
49+
void OnGameInitialized(object sender, EventArgs e)
50+
{
51+
//Debug.Log("PlayerModel Start");
5152
//LipSyncStart();
52-
for (int thisReading = 0; thisReading < samples; thisReading++)
53+
/*for (int thisReading = 0; thisReading < samples; thisReading++)
5354
{
5455
readings[thisReading] = 0;
55-
}
56-
56+
}*/
57+
//Debug.Log("PlayerModel this");
5758
PlayerModelAppearance.playerGameObjects.Add(GameObject.Find("Global/Local VRRig/Local Gorilla Player/gorilla"));
5859
PlayerModelAppearance.playerGameObjects.Add(GameObject.Find("Global/Local VRRig/Local Gorilla Player/rig/body/gorillachest"));
5960
PlayerModelAppearance.playerGameObjects.Add(GameObject.Find("Global/Local VRRig/Local Gorilla Player/rig/body/head/gorillaface"));
@@ -214,7 +215,7 @@ public void OnGameInitialized(object sender, EventArgs e)
214215

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

220221

@@ -288,7 +289,7 @@ static public float AudioClipLoudness(int clipPosition, AudioClip clip)
288289
float[] waveData = new float[sampleWindow];
289290
clip.GetData(waveData, startPosition);
290291

291-
//compute loudness
292+
292293

293294
float totalLoudness = 0;
294295

@@ -477,38 +478,9 @@ public void voiceSmoothing()
477478
public bool InRoom = false;
478479

479480

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-
}*/
491481
bool flagcode = false;
492482
private void Update()
493483
{
494-
/*if (Keyboard.current.cKey.wasPressedThisFrame)
495-
{
496-
if (flagcode)
497-
{
498-
var embedcode = new EmbeddedEncoding();
499-
embedcode.Update();
500-
flagcode = false;
501-
}
502-
}
503-
else
504-
{
505-
flagcode = true;
506-
}*/
507-
508-
/*var embedcode = new EmbeddedEncoding();
509-
embedcode.Update();
510-
flagcode = false;
511-
*/
512484

513485
if (!STARTPLAYERMOD)
514486
{

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

Scripts/PlayerModelAppearance.cs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using UnityEngine;
2-
using System.Collections.Generic;
1+
using System.Collections.Generic;
2+
using UnityEngine;
33

44
namespace PlayerModel.Player
55
{
@@ -61,22 +61,22 @@ static public void ShowOfflineRig()
6161

6262

6363
static Color gorillacolor;
64-
64+
6565
static public bool flag1 = true;
66-
66+
6767
static public Renderer rendGorilla;
6868

69-
69+
7070
static public Material mat;
7171
public static GameObject gorillabody;
7272
public static Color GetColor()
7373
{
7474
float r = PlayerPrefs.GetFloat("redValue");
7575
float g = PlayerPrefs.GetFloat("greenValue");
7676
float b = PlayerPrefs.GetFloat("blueValue");
77-
return new Color(r,g,b);
77+
return new Color(r, g, b);
78+
7879

79-
8080
}
8181
static public void AssignColor()
8282
{
@@ -96,14 +96,14 @@ static public void AssignColor()
9696

9797
}
9898

99-
}
100-
101-
99+
}
100+
101+
102102
}
103103

104104
static public void ResetMaterial(GameObject playermodel)
105105
{
106-
106+
107107
mat_index = PlayerModelController.gamemat_index;
108108
colormat_index = PlayerModelController.colormat_index;
109109

@@ -120,7 +120,7 @@ static public void ResetMaterial(GameObject playermodel)
120120

121121
static bool IsBattleMat(GameObject tbod)
122122
{
123-
if(tbod.GetComponent<Renderer>().material.name == "bluealive (Instance)")
123+
if (tbod.GetComponent<Renderer>().material.name == "bluealive (Instance)")
124124
{
125125
return true;
126126
}
@@ -172,15 +172,15 @@ static bool IsBattleMat2(GameObject tbod)
172172
public static int colormat_index;
173173
public static Material premat;
174174
public static Material[] playermats;//used to store reference of selected playermodel to assign back
175-
175+
176176

177177
static public void AssignMaterial(GameObject playermodel)
178178
{
179179
mat_index = PlayerModelController.gamemat_index;
180180
colormat_index = PlayerModelController.colormat_index;
181181
GameObject gorillabody = GorillaTagger.Instance.offlineVRRig.mainSkin.gameObject;
182182
//GameObject clone_body = GameObject.Find("Global/GorillaParent/GorillaVRRigs/Gorilla Player Networked(Clone)/gorilla");
183-
if(gorillabody != null) //if in a lobby
183+
if (gorillabody != null) //if in a lobby
184184
{
185185
if (gorillabody.GetComponent<Renderer>().material.name == "darkfur 1(Clone) (Instance)")//if not main mat
186186
{
@@ -196,20 +196,20 @@ static public void AssignMaterial(GameObject playermodel)
196196
playermats[mat_index] = gorillabody.GetComponent<Renderer>().material; //lava ice rockstones
197197
}
198198

199-
199+
200200
}
201201
else
202202
{
203203
playermats[mat_index] = Plugin.player_main_material;
204204
}
205205
playermodel.GetComponent<SkinnedMeshRenderer>().materials = playermats;
206-
207206

208-
209-
210-
207+
208+
209+
210+
211211
}
212212

213-
213+
214214
}
215215
}

0 commit comments

Comments
 (0)