Skip to content

Commit b4ff0d2

Browse files
committed
Sync changes to TC
1 parent 7e8d1b8 commit b4ff0d2

File tree

7 files changed

+25
-15
lines changed

7 files changed

+25
-15
lines changed

Assets/emotitron/TransformCrusher/FloatCrushDrawer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public override void OnGUI(Rect r, SerializedProperty property, GUIContent label
150150
DrawCompressionMethod();
151151

152152
EditorGUI.BeginDisabledGroup(disableRange);
153-
if (!noSettings)
153+
if (!noSettings && !(fc.TRSType == TRSType.Normal))
154154
DrawCodecSettings(property);
155155
EditorGUI.EndDisabledGroup();
156156

@@ -411,7 +411,6 @@ private void DrawBasicRanges()
411411
float label1Left = input1Left - labelW;
412412
float label2Left = input2Left - labelW;
413413

414-
415414
EditorGUI.LabelField(new Rect(label1Left, line - 2, labelW, LINEHEIGHT), new GUIContent("min: "), miniLabelRight);
416415

417416
float min = EditorGUI.DelayedFloatField(new Rect(input1Left, line, inputW, LINEHEIGHT), GUIContent.none, fc.Min, (GUIStyle)"MiniTextField");
@@ -618,10 +617,11 @@ private void DrawBCLField(BitCullingLevel bcl, float fieldL, float fldWdth4th, f
618617
private float CalculateHeight(FloatCrusher fc)
619618
{
620619
bool noSettings = (fc.BitsDeterminedBy == BitsDeterminedBy.HalfFloat || fc.BitsDeterminedBy == BitsDeterminedBy.Uncompressed || fc.BitsDeterminedBy == BitsDeterminedBy.Disabled);
620+
bool noRange = fc.TRSType == TRSType.Normal;
621621

622622
float bclLine = (fc.expandBCL) ? BCL_HEIGHT : (fc.showBCL) ? LINEHEIGHT : 0;
623623

624-
float settingsLen = (noSettings) ? 0 : SETTINGS_HGHT + ACCCNTR_HGHT + ACTUAL_HGHT + bclLine;
624+
float settingsLen = (noSettings) ? 0 : (noRange ? 0 : SETTINGS_HGHT) + ACCCNTR_HGHT + ACTUAL_HGHT + bclLine;
625625

626626
return PADDING + HEADR_HGHT + PADDING +
627627
(fc.Enabled ?

Assets/emotitron/TransformCrusher/QuatCrusher.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ public override void OnGUI(Rect r, SerializedProperty property, GUIContent label
354354

355355
target = (QuatCrusher)DrawerUtils.GetParent(property.FindPropertyRelative("bits"));
356356

357+
357358
line = r.yMin;
358359

359360
//float standalonesheight = target.isStandalone ? (SPACING + LINEHEIGHT) * 2 : 0;

Assets/emotitron/TransformCrusher/TransformCrusherDrawer.cs

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ public class TransformCrusherDrawer : CrusherDrawer
1919
protected float currentline;
2020

2121
//bool haschanged;
22-
private static GUIContent gc = new GUIContent();
23-
22+
private static readonly GUIContent gc = new GUIContent();
23+
private static readonly GUIContent reusableGC = new GUIContent();
24+
private static readonly System.Text.StringBuilder sb = new System.Text.StringBuilder();
25+
2426
public override void OnGUI(Rect r, SerializedProperty property, GUIContent label)
2527
{
2628
gc.text = label.text;
@@ -57,24 +59,29 @@ public override void OnGUI(Rect r, SerializedProperty property, GUIContent label
5759
property.serializedObject.ApplyModifiedProperties();
5860
}
5961

60-
EditorGUI.LabelField(new Rect(r.xMin, currentline, r.width, TITL_HGHT), gc);// property.displayName /*new GUIContent("Transform Crusher " + label)*//*, (GUIStyle)"BoldLabel"*/);
62+
EditorGUI.LabelField(new Rect(r.xMin, currentline, r.width - 64, TITL_HGHT), gc);// property.displayName /*new GUIContent("Transform Crusher " + label)*//*, (GUIStyle)"BoldLabel"*/);
6163

6264
int totalbits = target.TallyBits();
6365
int frag0bits = Mathf.Clamp(totalbits, 0, 64);
6466
int frag1bits = Mathf.Clamp(totalbits - 64, 0, 64);
6567
int frag2bits = Mathf.Clamp(totalbits - 128, 0, 64);
6668
int frag3bits = Mathf.Clamp(totalbits - 192, 0, 64);
6769

68-
string bitstr = frag0bits.ToString();
70+
reusableGC.tooltip = "Total Bits : " + totalbits;
71+
72+
sb.Length = 0;
73+
sb.Append(frag0bits.ToString());
6974
if (frag1bits > 0)
70-
bitstr += "|" + frag1bits;
75+
sb.Append("|").Append(frag1bits);
7176
if (frag2bits > 0)
72-
bitstr += "|" + frag2bits;
77+
sb.Append("|").Append(frag2bits);
7378
if (frag3bits > 0)
74-
bitstr += "|" + frag3bits;
79+
sb.Append("|").Append(frag3bits);
80+
81+
sb.Append(" bits");
82+
reusableGC.text = sb.ToString();
7583

76-
bitstr = bitstr + " bits";
77-
EditorGUI.LabelField(new Rect(paddedleft, currentline, paddedwidth, 16), bitstr, miniLabelRight);
84+
EditorGUI.LabelField(new Rect(paddedleft, currentline, paddedwidth, 16), reusableGC, miniLabelRight);
7885

7986
if (isExpanded.boolValue)
8087
{
0 Bytes
Binary file not shown.

Assets/emotitron/TransformCrusher/plugins/FloatCrusher.dll.mdb.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/emotitron/TransformCrusher/plugins/QuatCompress.dll.mdb.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/emotitron/Utilities/Example/PUNSampleLauncher.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ private void SpawnLocalPlayer()
201201
{
202202
//Transform tr = spawnPoints.Count > 0 ? spawnPoints[Random.Range(0, spawnPoints.Count)] : null;
203203
Transform tr = emotitron.Utilities.Networking.GenericSpawnPoint.GetSpawnPointFromValue(PhotonNetwork.LocalPlayer.ActorNumber);
204-
Vector3 pos = (tr) ? tr.position : Vector3.zero;
204+
Vector3 pos = (tr) ? tr.position : new Vector3(PhotonNetwork.LocalPlayer.ActorNumber, 0f, 0f);
205205
Quaternion rot = (tr) ? tr.rotation : Quaternion.identity;
206206

207207
localPlayer = PhotonNetwork.Instantiate(playerPrefab.name, pos, rot, 0);
@@ -230,6 +230,8 @@ public class PUNSampleLauncherEditor : Editor
230230
public override void OnInspectorGUI()
231231
{
232232
base.OnInspectorGUI();
233+
EditorGUILayout.HelpBox("Convenience handler for launching a very basic Photon PUN2 room. Self-Destroys at runtime if PUN2 is not present.", MessageType.None);
234+
233235
#if PUN_2_OR_NEWER
234236
EditorGUILayout.HelpBox("Sample PUN launcher code that creates a PUN room and spawns players.", MessageType.None);
235237
#else

0 commit comments

Comments
 (0)