Skip to content

Commit

Permalink
Minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
EliteAsian123 committed Dec 23, 2022
1 parent 728dc1d commit 912a501
Show file tree
Hide file tree
Showing 13 changed files with 275 additions and 40 deletions.
4 changes: 2 additions & 2 deletions Assets/Art/Materials/ComboMeter.mat
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ Material:
type: 3}
m_Parent: {fileID: -876546973899608171, guid: 79e7405a02986a6488920e8d984f9a32,
type: 3}
m_ModifiedSerializedProperties: 0
m_ModifiedSerializedProperties: 16
m_ValidKeywords: []
m_InvalidKeywords:
- _SURFACE_TYPE_TRANSPARENT
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
m_CustomRenderQueue: 3000
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
Expand Down
4 changes: 2 additions & 2 deletions Assets/Art/Materials/Sustain.mat
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Material:
m_LightmapFlags: 0
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
m_CustomRenderQueue: 2999
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
Expand Down Expand Up @@ -106,7 +106,7 @@ Material:
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _QueueOffset: -1
- _ReceiveShadows: 1
- _Smoothness: 0
- _SmoothnessTextureChannel: 0
Expand Down
Binary file added Assets/Art/UI/Blank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
124 changes: 124 additions & 0 deletions Assets/Art/UI/Blank.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 78 additions & 0 deletions Assets/Scenes/PlayScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ RectTransform:
- {fileID: 274394383}
- {fileID: 2062919431}
- {fileID: 1967822877}
- {fileID: 2146974096}
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand All @@ -600,6 +601,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
trackContainer: {fileID: 2062919431}
songProgress: {fileID: 2146974097}
--- !u!1 &1967822876
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -766,6 +768,82 @@ MonoBehaviour:
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
--- !u!1 &2146974095
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2146974096}
- component: {fileID: 2146974098}
- component: {fileID: 2146974097}
m_Layer: 5
m_Name: Progress
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2146974096
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2146974095}
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1476172820}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 3}
m_Pivot: {x: 0.5, y: 0}
--- !u!114 &2146974097
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2146974095}
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: 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_Sprite: {fileID: 21300000, guid: b038556afd6775c4d8eeea78927256ca, type: 3}
m_Type: 3
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 0
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &2146974098
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2146974095}
m_CullTransparentMesh: 1
--- !u!1001 &1359546913068363746
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down
12 changes: 7 additions & 5 deletions Assets/Script/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ private IEnumerator StartSong() {
foreach (var audioSource in audioSources) {
audioSource.Play();
}
realSongTime = audioSources[0].time;
SongStarted = true;
}

Expand All @@ -98,11 +99,7 @@ private void Update() {
return;
}

// Less accurate but allows stepping in the unity editor
// realSongTime += Time.deltaTime;

// More accurate but stepping in the unity editor does not work
realSongTime = audioSources[0].time;
realSongTime += Time.deltaTime;

if (Keyboard.current.upArrowKey.wasPressedThisFrame) {
PlayerManager.globalCalibration += 0.01f;
Expand All @@ -111,6 +108,11 @@ private void Update() {
if (Keyboard.current.downArrowKey.wasPressedThisFrame) {
PlayerManager.globalCalibration -= 0.01f;
}

// End song
if (realSongTime > song.songLength.Value + 0.5f) {
Exit();
}
}

public void Exit() {
Expand Down
2 changes: 1 addition & 1 deletion Assets/Script/PlayerManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ public static bool LowQualityMode {
}
}

public static float globalCalibration = -0.4f;
public static float globalCalibration = -0.15f;
}
}
15 changes: 15 additions & 0 deletions Assets/Script/Track.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ private void Awake() {
Screen.width, Screen.height,
RenderTextureFormat.DefaultHDR
);
descriptor.mipCount = 0;
var renderTexture = new RenderTexture(descriptor);
trackCamera.targetTexture = renderTexture;

Expand All @@ -70,6 +71,7 @@ private void Awake() {
info.antialiasing = AntialiasingMode.None;
} else {
info.antialiasing = AntialiasingMode.SubpixelMorphologicalAntiAliasing;
info.antialiasingQuality = AntialiasingQuality.Low;
}
}

Expand Down Expand Up @@ -234,6 +236,19 @@ private void UpdateInput() {
}

if (expectedHits.Count <= 0) {
// Handle ghost inputs
if (strummed) {
Combo = 0;

// Let go of held notes
for (int i = heldNotes.Count - 1; i >= 0; i--) {
var heldNote = heldNotes[i];
notePool.MissNote(heldNote);
heldNotes.RemoveAt(i);
frets[heldNote.fret].StopSustainParticles();
}
}

return;
}

Expand Down
8 changes: 7 additions & 1 deletion Assets/Script/UI/GameUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
namespace YARG.UI {
public class GameUI : MonoBehaviour {
[SerializeField]
private Transform trackContainer = null;
private Transform trackContainer;
[SerializeField]
private Image songProgress;

public static GameUI Instance {
get;
Expand All @@ -15,6 +17,10 @@ private void Awake() {
Instance = this;
}

private void Update() {
songProgress.fillAmount = Game.Instance.SongTime / Game.song.songLength.Value;
}

public void AddTrackImage(RenderTexture rt) {
var trackImage = new GameObject();
trackImage.transform.parent = trackContainer;
Expand Down
4 changes: 4 additions & 0 deletions Assets/Script/UI/SongInfoComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ public void UpdateText() {
}

public void PlaySong() {
if (songInfo.songLength == null) {
return;
}

MainMenu.Instance.chosenSong = songInfo;
MainMenu.Instance.ShowPreSong();
}
Expand Down
15 changes: 0 additions & 15 deletions Assets/Script/Utils/SourceDelays.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Assets/Script/Utils/SourceDelays.cs.meta

This file was deleted.

Loading

0 comments on commit 912a501

Please sign in to comment.