DebugUI cleanup

This commit is contained in:
Starpelly 2022-01-02 09:57:15 -05:00
parent b12658a7a7
commit d008bbf5df
4 changed files with 314 additions and 126 deletions

View file

@ -185,7 +185,7 @@ Camera:
m_Depth: 1
m_CullingMask:
serializedVersion: 2
m_Bits: 8
m_Bits: 40
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
@ -226,13 +226,13 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 848278998}
m_Father: {fileID: 1675851266}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -1.38, y: 3.34}
m_SizeDelta: {x: 276.36, y: 38.25}
m_AnchoredPosition: {x: 0.00097656, y: 0.000030517578}
m_SizeDelta: {x: 634.61, y: 38.25}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &96506774
MonoBehaviour:
@ -391,7 +391,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 667da2762ac6e314c91fe7636f4ff3cf, type: 3}
m_Name:
m_EditorClassIdentifier:
Template: {fileID: 848278997}
Template: {fileID: 1675851265}
--- !u!1 &389255201
GameObject:
m_ObjectHideFlags: 0
@ -476,7 +476,7 @@ AudioSource:
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: 5fc457d2d31969c44a6734ce4e684ff8, type: 3}
m_audioClip: {fileID: 8300000, guid: 92cf585c80f8fb843964e525aef1406c, type: 3}
m_PlayOnAwake: 0
m_Volume: 1
m_Pitch: 1
@ -651,7 +651,7 @@ Camera:
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 55
m_Bits: 23
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
@ -710,82 +710,6 @@ Transform:
m_Father: {fileID: 1604625201}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &848278997
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 848278998}
- component: {fileID: 848279000}
- component: {fileID: 848278999}
m_Layer: 5
m_Name: Image
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &848278998
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 848278997}
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:
- {fileID: 96506773}
m_Father: {fileID: 967430035}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -495.03998, y: 337.52997}
m_SizeDelta: {x: 289.91, y: 44.93}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &848278999
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 848278997}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 0.45490196}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &848279000
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 848278997}
m_CullTransparentMesh: 1
--- !u!1 &882508661
GameObject:
m_ObjectHideFlags: 0
@ -899,7 +823,7 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 848278998}
- {fileID: 1675851266}
m_Father: {fileID: 366093812}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -958,7 +882,7 @@ Canvas:
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 1
m_Camera: {fileID: 519420031}
m_Camera: {fileID: 79134728}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
@ -1479,6 +1403,141 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: f613584f5ba8a27439601850428fea72, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1675851265
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1675851266}
- component: {fileID: 1675851268}
- component: {fileID: 1675851267}
m_Layer: 5
m_Name: BG
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &1675851266
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1675851265}
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:
- {fileID: 96506773}
m_Father: {fileID: 967430035}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -317.3, y: 343}
m_SizeDelta: {x: 634.61, y: 38.25}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1675851267
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1675851265}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: <mark=#000000AA>SongPosBeats
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 795a65f16e097f44eb799cb2ec026fc1, type: 2}
m_sharedMaterial: {fileID: -1662932664650235619, guid: 795a65f16e097f44eb799cb2ec026fc1, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 16.3
m_fontSizeBase: 19.89
m_fontWeight: 400
m_enableAutoSizing: 1
m_fontSizeMin: 5.3
m_fontSizeMax: 16.3
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!222 &1675851268
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1675851265}
m_CullTransparentMesh: 1
--- !u!1 &1765874088
GameObject:
m_ObjectHideFlags: 0
@ -1776,7 +1835,7 @@ MonoBehaviour:
playerEntities: []
currentEvent: 0
currentPlayerEvent: 0
txt: {fileID: 4900000, guid: df453afcce54d5c4e9105c6829ed8f30, type: 3}
txt: {fileID: 4900000, guid: 4b7512c586e16a847a5b8490bf35e852, type: 3}
startOffset: 0.5
GameCamera: {fileID: 519420031}
CursorCam: {fileID: 79134728}

View file

@ -4,66 +4,110 @@ using UnityEngine;
using TMPro;
// hardcoded because im lazy
namespace RhythmHeavenMania
{
public class DebugUI : MonoBehaviour
{
public GameObject Template;
private int indexL;
private int indexR;
private TMP_Text Title;
private TMP_Text SongPosBeats;
private TMP_Text SecPerBeat;
private TMP_Text SongPos;
private TMP_Text BPM;
private TMP_Text currEvent;
private TMP_Text eventLength;
private TMP_Text eventType;
private TMP_Text currentGame;
private TMP_Text graphicsDeviceName;
private TMP_Text operatingSystem;
private TMP_Text fps;
private void Start()
{
for (int i = 0; i < 5; i++)
{
GameObject debug = Instantiate(Template, Template.transform.parent);
debug.SetActive(true);
debug.transform.localPosition = new Vector3(Template.transform.localPosition.x, Template.transform.localPosition.y - 44.9301f * i);
CreateDebugUI(out Title); SetText(Title, "Rhythm Heaven Mania v1.0 BRAEDON DEBUG PLAYTEST");
CreateDebugUI(out SongPosBeats);
CreateDebugUI(out SongPos);
CreateDebugUI(out SecPerBeat);
CreateDebugUI(out BPM);
Separate();
CreateDebugUI(out currEvent);
CreateDebugUI(out eventLength);
CreateDebugUI(out eventType);
CreateDebugUI(out currentGame);
CreateDebugUI(out operatingSystem, true); SetText(operatingSystem, SystemInfo.operatingSystem);
CreateDebugUI(out graphicsDeviceName, true); SetText(graphicsDeviceName, SystemInfo.graphicsDeviceName);
CreateDebugUI(out fps, true);
switch (i)
{
case 0:
SongPosBeats = debug.transform.GetChild(0).GetComponent<TMP_Text>();
break;
case 1:
BPM = debug.transform.GetChild(0).GetComponent<TMP_Text>();
break;
case 2:
currEvent = debug.transform.GetChild(0).GetComponent<TMP_Text>();
break;
case 3:
eventLength = debug.transform.GetChild(0).GetComponent<TMP_Text>();
break;
case 4:
eventType = debug.transform.GetChild(0).GetComponent<TMP_Text>();
break;
}
}
}
private void Update()
{
SongPosBeats.text = $"SongPosBeats: {Conductor.instance.songPositionInBeats}";
BPM.text = $"BPM: {Conductor.instance.songBpm}";
SetText(SongPosBeats, $"Song Position In Beats: {Conductor.instance.songPositionInBeats}");
SetText(SongPos, $"Song Position: {Conductor.instance.songPosition}");
SetText(BPM, $"BPM: {Conductor.instance.songBpm}");
SetText(fps, $"FPS: {1.0f / Time.smoothDeltaTime}");
SetText(SecPerBeat, $"Seconds Per Beat: {Conductor.instance.secPerBeat}");
SetText(currentGame, $"Current Game: {GameManager.instance.currentGame}");
int minus = 0;
if (GameManager.instance.Beatmap.entities.Count > 0)
if (GameManager.instance.currentEvent - 1 >= 0)
{
currEvent.text = $"CurrentEvent: {GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent - 1].datamodel}";
eventLength.text = $"Event Length: {GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent - 1].length}";
eventType.text = $"Event Type: {GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent - 1].type}";
}
if (GameManager.instance.currentEvent - 1 >= 0) minus = 1;
SetText(currEvent, $"CurrentEvent: {GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent - minus].datamodel}");
SetText(eventLength, $"Event Length: {GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent - minus].length}");
SetText(eventType, $"Event Type: {GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent - minus].type}");
}
}
private void CreateDebugUI(out TMP_Text t, bool right = false)
{
GameObject debug = Instantiate(Template, Template.transform.parent);
debug.SetActive(true);
if (right)
{
debug.transform.localPosition = new Vector3(322.69f, Template.transform.localPosition.y - 34f * indexR);
debug.GetComponent<TMP_Text>().alignment = TextAlignmentOptions.Right;
debug.transform.GetChild(0).GetComponent<TMP_Text>().alignment = TextAlignmentOptions.Right;
indexR++;
}
else
{
currEvent.text = $"CurrentEvent: {GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent].datamodel}";
eventLength.text = $"Event Length: {GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent].length}";
eventType.text = $"Event Type: {GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent].type}";
debug.transform.localPosition = new Vector3(Template.transform.localPosition.x, Template.transform.localPosition.y - 34f * indexL);
indexL++;
}
t = debug.transform.GetChild(0).GetComponent<TMP_Text>();
}
private void Separate(bool right = false)
{
if (right)
indexR++;
else
indexL++;
}
private void SetText(TMP_Text t, string text)
{
t.transform.parent.GetComponent<TMP_Text>().text = $"<mark=#3d3d3d padding=\"44.9301, 44.9301, 44.9301, 44.9301\">{text}</mark>";
t.text = text;
}
}
}

View file

@ -107,9 +107,9 @@ Material:
- _Parallax: 0.02
- _PerspectiveFilter: 0.875
- _Reflectivity: 10
- _ScaleRatioA: 0.90909094
- _ScaleRatioA: 0.9
- _ScaleRatioB: 0.73125
- _ScaleRatioC: 0.7386364
- _ScaleRatioC: 0.73125
- _ScaleX: 1
- _ScaleY: 1
- _ShaderFlags: 0
@ -148,6 +148,7 @@ Material:
- _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5}
m_BuildTextureStacks: []
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
@ -165,11 +166,11 @@ MonoBehaviour:
materialHashCode: 462855346
m_Version: 1.1.0
m_SourceFontFileGUID: e3265ab4bf004d28a9537516768c1c75
m_SourceFontFile_EditorRef: {fileID: 12800000, guid: e3265ab4bf004d28a9537516768c1c75,
type: 3}
m_SourceFontFile_EditorRef: {fileID: 12800000, guid: e3265ab4bf004d28a9537516768c1c75, type: 3}
m_SourceFontFile: {fileID: 12800000, guid: e3265ab4bf004d28a9537516768c1c75, type: 3}
m_AtlasPopulationMode: 1
m_FaceInfo:
m_FaceIndex: 0
m_FamilyName: Liberation Sans
m_StyleName: Regular
m_PointSize: 86
@ -313,15 +314,20 @@ Texture2D:
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_IsAlphaChannelOptional: 0
serializedVersion: 2
m_Width: 0
m_Height: 0
m_CompleteImageSize: 0
m_MipsStripped: 0
m_TextureFormat: 1
m_MipCount: 1
m_IsReadable: 1
m_IsPreProcessed: 0
m_IgnoreMasterTextureLimit: 0
m_StreamingMipmaps: 0
m_StreamingMipmapsPriority: 0
m_VTOnly: 0
m_AlphaIsTransparency: 0
m_ImageCount: 1
m_TextureDimension: 2
@ -335,9 +341,11 @@ Texture2D:
m_WrapW: 0
m_LightmapFormat: 0
m_ColorSpace: 0
m_PlatformBlob:
image data: 0
_typelessdata:
m_StreamData:
serializedVersion: 2
offset: 0
size: 0
path:

View file

@ -310,5 +310,82 @@
"beat": 103.5,
"datamodel": "karateman/rock"
},
{
"beat": 104.75,
"datamodel":"gameManager/switchGame/clappyTrio"
},
{
"beat": 105,
"datamodel": "clappyTrio/bop"
},
{
"beat": 106,
"datamodel": "clappyTrio/bop"
},
{
"beat": 107,
"datamodel": "clappyTrio/bop"
},
{
"beat": 108,
"datamodel": "clappyTrio/prepare_alt"
},
{
"beat": 109,
"length": 1,
"datamodel": "clappyTrio/clap"
},
{
"beat": 112,
"datamodel": "clappyTrio/bop"
},
{
"beat": 113,
"datamodel": "gameManager/switchGame/forkLifter"
},
{
"beat": 114,
"datamodel": "forkLifter/pea"
},
{
"beat": 117,
"datamodel": "forkLifter/pea"
},
{
"beat": 121,
"datamodel": "gameManager/switchGame/spaceball"
},
{
"beat": 121,
"datamodel": "spaceball/shoot"
},
{
"beat": 123,
"datamodel": "spaceball/shoot"
},
{
"beat": 125,
"datamodel": "spaceball/shootHigh"
},
{
"beat": 128,
"datamodel": "gameManager/switchGame/karateman"
},
{
"beat": 129,
"datamodel": "karateman/pot"
},
{
"beat": 131,
"datamodel": "karateman/bulb"
},
{
"beat": 133,
"datamodel": "karateman/kick"
},
{
"beat": 135,
"datamodel": "gameManager/switchGame/spaceball"
}
]
}