Commit bdba0ba4 authored by Yousef Sameh's avatar Yousef Sameh

sound fix and pause menu

parent e94cf53a
...@@ -33,6 +33,7 @@ public struct Rank ...@@ -33,6 +33,7 @@ public struct Rank
"normal" => "مبتدأ", "normal" => "مبتدأ",
"geek" => "هاوي", "geek" => "هاوي",
"master" => "محترف", "master" => "محترف",
"challenger" => "متحدي",
"olympian" => "اسطوري", "olympian" => "اسطوري",
_ => Name _ => Name
}; };
...@@ -83,7 +84,8 @@ public struct Rank ...@@ -83,7 +84,8 @@ public struct Rank
public static readonly Rank Normal = new("Normal", 0, 999); public static readonly Rank Normal = new("Normal", 0, 999);
public static readonly Rank Geek = new("Geek", 1000, 2499); public static readonly Rank Geek = new("Geek", 1000, 2499);
public static readonly Rank Master = new("Master", 2500, 3999); public static readonly Rank Master = new("Master", 2500, 3999);
public static readonly Rank Olympian = new("Olympian", 4000, int.MaxValue); public static readonly Rank Challenger = new("Challenger", 4000, 5999);
public static readonly Rank Olympian = new("Olympian", 6000, int.MaxValue);
public static readonly Rank[] All = { Normal, Geek, Master, Olympian }; public static readonly Rank[] All = { Normal, Geek, Master, Olympian };
......
...@@ -54,7 +54,12 @@ public class HomeController : MonoBehaviour ...@@ -54,7 +54,12 @@ public class HomeController : MonoBehaviour
private void OnUserChange(User user) private void OnUserChange(User user)
{ {
if (user == null) return;
if (user == null)
{
Debug.LogWarning("[HomeController] No user logged in");
return;
}
username.text = user.Username; username.text = user.Username;
xp.text = user.Points.ToString(); xp.text = user.Points.ToString();
...@@ -70,6 +75,7 @@ public class HomeController : MonoBehaviour ...@@ -70,6 +75,7 @@ public class HomeController : MonoBehaviour
private void CheckQuestionAvailability(User user) private void CheckQuestionAvailability(User user)
{ {
Debug.Log("Checking question availability for user: " + user.Username + " (Grade: " + user.Grade + ", Term: " + user.Term + ")");
StartCoroutine(SSApiManager.EnsureInstance().GetChapters( StartCoroutine(SSApiManager.EnsureInstance().GetChapters(
chapters => chapters =>
{ {
......
...@@ -12,6 +12,7 @@ public class LoginController : MonoBehaviour ...@@ -12,6 +12,7 @@ public class LoginController : MonoBehaviour
private DropdownField curriculum; private DropdownField curriculum;
private Button register; private Button register;
private Label registerLabel;
private void OnEnable() private void OnEnable()
{ {
...@@ -23,6 +24,7 @@ public class LoginController : MonoBehaviour ...@@ -23,6 +24,7 @@ public class LoginController : MonoBehaviour
term = root.Q<DropdownField>("Term"); term = root.Q<DropdownField>("Term");
curriculum = root.Q<DropdownField>("Curriculum"); curriculum = root.Q<DropdownField>("Curriculum");
register = root.Q<Button>("Register"); register = root.Q<Button>("Register");
registerLabel = root.Q<Label>("RegisterLabel");
register.clicked += RegisterAnon; register.clicked += RegisterAnon;
} }
...@@ -53,14 +55,14 @@ public class LoginController : MonoBehaviour ...@@ -53,14 +55,14 @@ public class LoginController : MonoBehaviour
return; return;
} }
register.text = "جاري التسجيل..."; registerLabel.text = "جاري التسجيل...";
register.SetEnabled(false); register.SetEnabled(false);
var auth = await SupabaseAuthentication.Instance.LoginAnon(); var auth = await SupabaseAuthentication.Instance.LoginAnon();
if (auth.IsT1) if (auth.IsT1)
{ {
Debug.LogError("[Login] Authentication failed"); Debug.LogError("[Login] Authentication failed");
register.text = "تسجيل"; registerLabel.text = "تسجيل";
register.SetEnabled(true); register.SetEnabled(true);
return; return;
} }
...@@ -79,7 +81,7 @@ public class LoginController : MonoBehaviour ...@@ -79,7 +81,7 @@ public class LoginController : MonoBehaviour
}, error => }, error =>
{ {
Debug.LogError($"[Login] Failed to create user: {error.Message}"); Debug.LogError($"[Login] Failed to create user: {error.Message}");
register.text = "تسجيل"; registerLabel.text = "تسجيل";
register.SetEnabled(true); register.SetEnabled(true);
}); });
} }
......
...@@ -28,7 +28,7 @@ public class ProfileController : MonoBehaviour ...@@ -28,7 +28,7 @@ public class ProfileController : MonoBehaviour
UsernameLabel = root.Q<TextField>("Name"); UsernameLabel = root.Q<TextField>("Name");
Grade = root.Q<DropdownField>("Grade"); Grade = root.Q<DropdownField>("Grade");
Term = root.Q<DropdownField>("Term"); Term = root.Q<DropdownField>("TermDrop");
musicSwitch = root.Q<CustomSwitch>("MusicSwitch"); musicSwitch = root.Q<CustomSwitch>("MusicSwitch");
sfxSwitch = root.Q<CustomSwitch>("SFXSwitch"); sfxSwitch = root.Q<CustomSwitch>("SFXSwitch");
...@@ -53,18 +53,21 @@ public class ProfileController : MonoBehaviour ...@@ -53,18 +53,21 @@ public class ProfileController : MonoBehaviour
Term.value = EducationManager.GetTermName(user.Term); Term.value = EducationManager.GetTermName(user.Term);
} }
private void UpdateProfile() private async void UpdateProfile()
{ {
int gradeId = EducationManager.GetGradeId(Grade.value); int gradeId = EducationManager.GetGradeId(Grade.value);
int termId = EducationManager.GetTermId(Term.value); int termId = EducationManager.GetTermId(Term.value);
print("Updating profile with: " + UsernameLabel.value + ", Grade: " + gradeId + ", Term: " + termId);
if (gradeId < 0 || termId < 0) if (gradeId < 0 || termId < 0)
{ {
Debug.LogWarning("[Profile] Invalid grade or term selection"); Debug.LogWarning("[Profile] Invalid grade or term selection");
return; return;
} }
UserService.Instance.UpdateProfile( await UserService.Instance.UpdateProfile(
username: UsernameLabel.value, username: UsernameLabel.value,
grade: gradeId, grade: gradeId,
term: termId term: termId
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
</ui:VisualElement> </ui:VisualElement>
</ui:VisualElement> </ui:VisualElement>
<ui:Button text="" name="Register" class="action-btn"> <ui:Button text="" name="Register" class="action-btn">
<ui:Label text="تسجيل " language-direction="RTL" class="text-bold-black" style="color: rgb(255, 255, 255); font-size: 55px;"/> <ui:Label text="تسجيل " language-direction="RTL" name="RegisterLabel" class="text-bold-black" style="color: rgb(255, 255, 255); font-size: 55px;"/>
</ui:Button> </ui:Button>
</ui:VisualElement> </ui:VisualElement>
</ui:VisualElement> </ui:VisualElement>
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<ui:Label text="🏫" name="icon" class="emoji" style="padding-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; font-size: 50px;"/> <ui:Label text="🏫" name="icon" class="emoji" style="padding-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; font-size: 50px;"/>
</ui:VisualElement> </ui:VisualElement>
<ui:Label text="الفصل الدراسي" name="" class="text-bold-black" style="color: rgb(66, 66, 66);"/> <ui:Label text="الفصل الدراسي" name="" class="text-bold-black" style="color: rgb(66, 66, 66);"/>
<ui:DropdownField label="" choices="الفصل الدراسي الأول,الفصل الدراسي الثاني" name="Term" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; position: absolute; flex-grow: 0; height: 100%; width: 100%; font-size: 26px; -unity-font-definition: url(&quot;project://database/Assets/ALArcade/Hakwaty%20Font/TSHakwaty-DemiBold.otf?fileID=12800000&amp;guid=566b773a07b3d064aa1f4c6ef7b6f6fa&amp;type=3#TSHakwaty-DemiBold&quot;); -unity-text-generator: advanced; color: rgb(48, 48, 208); display: flex; opacity: 1;"/> <ui:DropdownField label="" choices="الفصل الدراسي الاول,الفصل الدراسي الثاني" name="TermDrop" index="0" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; position: absolute; flex-grow: 0; height: 100%; width: 100%; font-size: 26px; -unity-font-definition: url(&quot;project://database/Assets/ALArcade/Hakwaty%20Font/TSHakwaty-DemiBold.otf?fileID=12800000&amp;guid=566b773a07b3d064aa1f4c6ef7b6f6fa&amp;type=3#TSHakwaty-DemiBold&quot;); -unity-text-generator: advanced; color: rgb(48, 48, 208); display: flex; opacity: 1;"/>
</ui:Button> </ui:Button>
<ui:VisualElement name="Line" style="flex-grow: 0; width: 100%; background-color: rgba(0, 0, 0, 0.1); height: 2px; margin-top: 25px; margin-bottom: 25px;"/> <ui:VisualElement name="Line" style="flex-grow: 0; width: 100%; background-color: rgba(0, 0, 0, 0.1); height: 2px; margin-top: 25px; margin-bottom: 25px;"/>
<ui:Button text="" name="UpdateProfile" class="action-btn" style="display: flex;"> <ui:Button text="" name="UpdateProfile" class="action-btn" style="display: flex;">
......
...@@ -26,7 +26,7 @@ public class MachineVFXController : MonoBehaviour ...@@ -26,7 +26,7 @@ public class MachineVFXController : MonoBehaviour
private void Start() private void Start()
{ {
if (loopNoiseAudioSource != null) if (loopNoiseAudioSource != null && SettingsCache.SfxEnabled)
{ {
loopNoiseAudioSource.loop = true; loopNoiseAudioSource.loop = true;
loopNoiseAudioSource.volume = minNoiseVolume; loopNoiseAudioSource.volume = minNoiseVolume;
...@@ -74,7 +74,7 @@ public class MachineVFXController : MonoBehaviour ...@@ -74,7 +74,7 @@ public class MachineVFXController : MonoBehaviour
private void UpdateLoopNoise(float ratio) private void UpdateLoopNoise(float ratio)
{ {
if (loopNoiseAudioSource == null) return; if (loopNoiseAudioSource == null || !SettingsCache.SfxEnabled) return;
loopNoiseAudioSource.volume = Mathf.Lerp(minNoiseVolume, maxNoiseVolume, ratio); loopNoiseAudioSource.volume = Mathf.Lerp(minNoiseVolume, maxNoiseVolume, ratio);
} }
...@@ -87,7 +87,7 @@ public class MachineVFXController : MonoBehaviour ...@@ -87,7 +87,7 @@ public class MachineVFXController : MonoBehaviour
explosionVFX?.Play(); explosionVFX?.Play();
// Play explosion sound (one-shot) // Play explosion sound (one-shot)
if (explosionAudioSource != null) if (explosionAudioSource != null && SettingsCache.SfxEnabled)
explosionAudioSource.Play(); explosionAudioSource.Play();
// Reset scary machine intensity // Reset scary machine intensity
......
This diff is collapsed.
...@@ -2001,6 +2001,7 @@ RectTransform: ...@@ -2001,6 +2001,7 @@ RectTransform:
- {fileID: 2126029859342928170} - {fileID: 2126029859342928170}
- {fileID: 1785834089828270944} - {fileID: 1785834089828270944}
- {fileID: 6016074398655104315} - {fileID: 6016074398655104315}
- {fileID: 4785471760491232656}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
...@@ -4447,3 +4448,105 @@ MonoBehaviour: ...@@ -4447,3 +4448,105 @@ MonoBehaviour:
m_StringArgument: m_StringArgument:
m_BoolArgument: 0 m_BoolArgument: 0
m_CallState: 2 m_CallState: 2
--- !u!1001 &4572564501986566803
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 6025958000610179652}
m_Modifications:
- target: {fileID: 1679493875718695717, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_Name
value: PauseUI
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
--- !u!224 &4785471760491232656 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
m_PrefabInstance: {fileID: 4572564501986566803}
m_PrefabAsset: {fileID: 0}
...@@ -24,7 +24,7 @@ Transform: ...@@ -24,7 +24,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 92133367119283456} m_GameObject: {fileID: 92133367119283456}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0.40987} m_LocalPosition: {x: 0, y: 0, z: 0.40987}
m_LocalScale: {x: 1, y: 1, z: 1.5679} m_LocalScale: {x: 1, y: 1, z: 1.5679}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
...@@ -101,7 +101,8 @@ PrefabInstance: ...@@ -101,7 +101,8 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents:
- {fileID: 65297215155271052, guid: 534497d369ca4de4aaeb048a9211449c, type: 3}
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
...@@ -171,7 +172,8 @@ PrefabInstance: ...@@ -171,7 +172,8 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents:
- {fileID: 65076337919622882, guid: 8a4f2276ebfcdc541ac877445abef006, type: 3}
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
...@@ -241,7 +243,8 @@ PrefabInstance: ...@@ -241,7 +243,8 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents:
- {fileID: 65297215155271052, guid: 534497d369ca4de4aaeb048a9211449c, type: 3}
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
...@@ -311,7 +314,8 @@ PrefabInstance: ...@@ -311,7 +314,8 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents:
- {fileID: 65297215155271052, guid: 534497d369ca4de4aaeb048a9211449c, type: 3}
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
...@@ -381,7 +385,8 @@ PrefabInstance: ...@@ -381,7 +385,8 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents:
- {fileID: 65297215155271052, guid: 534497d369ca4de4aaeb048a9211449c, type: 3}
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
...@@ -451,7 +456,8 @@ PrefabInstance: ...@@ -451,7 +456,8 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents:
- {fileID: 65297215155271052, guid: 534497d369ca4de4aaeb048a9211449c, type: 3}
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
...@@ -521,7 +527,8 @@ PrefabInstance: ...@@ -521,7 +527,8 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents:
- {fileID: 65076337919622882, guid: 8a4f2276ebfcdc541ac877445abef006, type: 3}
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
...@@ -591,7 +598,8 @@ PrefabInstance: ...@@ -591,7 +598,8 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents:
- {fileID: 65297215155271052, guid: 534497d369ca4de4aaeb048a9211449c, type: 3}
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
...@@ -661,7 +669,8 @@ PrefabInstance: ...@@ -661,7 +669,8 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents:
- {fileID: 65297215155271052, guid: 534497d369ca4de4aaeb048a9211449c, type: 3}
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
...@@ -731,7 +740,8 @@ PrefabInstance: ...@@ -731,7 +740,8 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents:
- {fileID: 65297215155271052, guid: 534497d369ca4de4aaeb048a9211449c, type: 3}
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
......
fileFormatVersion: 2
guid: f63787b4f3ce00644a9100d6a721f49b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 1bdc7459a605e1541a02fb4bf82db808
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
...@@ -2293,6 +2293,7 @@ RectTransform: ...@@ -2293,6 +2293,7 @@ RectTransform:
- {fileID: 6731220212880752973} - {fileID: 6731220212880752973}
- {fileID: 1045805939275725998} - {fileID: 1045805939275725998}
- {fileID: 6504035909957192940} - {fileID: 6504035909957192940}
- {fileID: 2803452719219600951}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
...@@ -3878,3 +3879,109 @@ MonoBehaviour: ...@@ -3878,3 +3879,109 @@ MonoBehaviour:
clickColor: {r: 0.2, g: 0.5, b: 1, a: 0.6} clickColor: {r: 0.2, g: 0.5, b: 1, a: 0.6}
fadeDuration: 0.25 fadeDuration: 0.25
hoverColor: {r: 0.2, g: 0.5, b: 1, a: 0.1} hoverColor: {r: 0.2, g: 0.5, b: 1, a: 0.1}
--- !u!1001 &6628092912878596404
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 6341582480915548861}
m_Modifications:
- target: {fileID: 1679493875718695717, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_Name
value: PauseUI
objectReference: {fileID: 0}
- target: {fileID: 1679493875718695717, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
--- !u!224 &2803452719219600951 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 9015197128288788227, guid: 1bdc7459a605e1541a02fb4bf82db808, type: 3}
m_PrefabInstance: {fileID: 6628092912878596404}
m_PrefabAsset: {fileID: 0}
...@@ -102,7 +102,6 @@ public class ChallengeCanvas : MonoBehaviour ...@@ -102,7 +102,6 @@ public class ChallengeCanvas : MonoBehaviour
private void OnBackClicked() private void OnBackClicked()
{ {
SceneManager.LoadScene("MainMenu");
AnimateOut(); AnimateOut();
challengeManager.EndChallenge(); challengeManager.EndChallenge();
} }
......
...@@ -6,6 +6,7 @@ using Cysharp.Threading.Tasks; ...@@ -6,6 +6,7 @@ using Cysharp.Threading.Tasks;
using EasyTransition; using EasyTransition;
using Unity.VisualScripting; using Unity.VisualScripting;
using UnityEngine; using UnityEngine;
using UnityEngine.SceneManagement;
public class ChallengeManager : MonoBehaviour public class ChallengeManager : MonoBehaviour
{ {
...@@ -162,6 +163,7 @@ public class ChallengeManager : MonoBehaviour ...@@ -162,6 +163,7 @@ public class ChallengeManager : MonoBehaviour
public void EndChallenge() public void EndChallenge()
{ {
Destroy(gameObject, 5); SceneManager.LoadScene("MainMenu");
Destroy(gameObject, 2);
} }
} }
\ No newline at end of file
...@@ -140,6 +140,17 @@ namespace com.al_arcade.shared ...@@ -140,6 +140,17 @@ namespace com.al_arcade.shared
src.PlayOneShot(clip); src.PlayOneShot(clip);
} }
public void PlayLooping(AudioClip cliop, float volumeScale = 1f, float pitch = 1f)
{
if (!SettingsCache.SfxEnabled) return;
if (cliop == null) return;
var src = GetSource();
src.clip = cliop;
src.pitch = pitch;
src.volume = masterVolume * volumeScale;
src.loop = true;
}
public void PlayCorrect(float vol = 1f) => Play(sfxCorrect, vol); public void PlayCorrect(float vol = 1f) => Play(sfxCorrect, vol);
public void PlayCorrectChoice(float vol = 1f) => Play(sfxCorrectChoice, vol); public void PlayCorrectChoice(float vol = 1f) => Play(sfxCorrectChoice, vol);
public void PlayCorrectDrag(float vol = 1f) => Play(sfxCorrectDrag, vol); public void PlayCorrectDrag(float vol = 1f) => Play(sfxCorrectDrag, vol);
...@@ -166,6 +177,8 @@ namespace com.al_arcade.shared ...@@ -166,6 +177,8 @@ namespace com.al_arcade.shared
public void PlayProceduralBeep(float frequency = 440f, float duration = 0.1f, public void PlayProceduralBeep(float frequency = 440f, float duration = 0.1f,
float volume = 0.3f) float volume = 0.3f)
{ {
if (!SettingsCache.SfxEnabled) return;
string key = $"{frequency}_{duration}"; string key = $"{frequency}_{duration}";
if (!_beepCache.TryGetValue(key, out var clip)) if (!_beepCache.TryGetValue(key, out var clip))
{ {
......
using com.al_arcade.shared;
using DG.Tweening;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class UIPause : MonoBehaviour
{
[SerializeField] private Button pauseButton;
[SerializeField] private Button resumeButton;
[SerializeField] private Button quitButton;
[SerializeField] private CanvasGroup pauseMenuCanvasGroup;
private void Start()
{
if (pauseButton != null)
pauseButton.onClick.AddListener(PauseGame);
if (resumeButton != null)
resumeButton.onClick.AddListener(ResumeGame);
if (quitButton != null)
quitButton.onClick.AddListener(QuitGame);
}
private void PauseGame()
{
Time.timeScale = 0f;
pauseMenuCanvasGroup.DOFade(1f, 0.25f).From(0f).SetUpdate(true);
}
private void ResumeGame()
{
Time.timeScale = 1f;
pauseMenuCanvasGroup.DOFade(0f, 0.25f).From(1f).SetUpdate(true);
}
private void QuitGame()
{
SSAudioManager.Instance.StopMusic();
Time.timeScale = 1f;
// Find ChallengeManager in the scene and call EndChallenge to ensure proper cleanup and transition
var challengeManager = FindFirstObjectByType<ChallengeManager>();
if (challengeManager != null)
challengeManager.EndChallenge();
else
SceneManager.LoadScene("MainMenu");
}
}
fileFormatVersion: 2
guid: 5bcdc414dcd5c1d4dbdadea345a24537
\ No newline at end of file
...@@ -9,7 +9,6 @@ namespace com.al_arcade.tf ...@@ -9,7 +9,6 @@ namespace com.al_arcade.tf
using LightSide; using LightSide;
using shared; using shared;
using System.Collections.Generic; using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine.SceneManagement; using UnityEngine.SceneManagement;
public class TfUIManager : MonoBehaviour public class TfUIManager : MonoBehaviour
......
<Solution> <Solution>
<Project Path="Unity.Timeline.csproj" />
<Project Path="Unity.VisualEffectGraph.Editor.csproj" />
<Project Path="Unity.RenderPipelines.GPUDriven.Runtime.csproj" />
<Project Path="Unity.PlasticSCM.Editor.csproj" />
<Project Path="Assembly-CSharp.csproj" /> <Project Path="Assembly-CSharp.csproj" />
<Project Path="Unity.ShaderGraph.Editor.csproj" />
<Project Path="Unity.RenderPipelines.Core.Runtime.csproj" />
<Project Path="Unity.Mathematics.csproj" />
<Project Path="Unity.Timeline.Editor.csproj" />
<Project Path="Unity.Cinemachine.Editor.csproj" />
<Project Path="Unity.Multiplayer.Center.Editor.csproj" />
<Project Path="Unity.RenderPipelines.Core.Editor.csproj" />
<Project Path="UnityEngine.UI.csproj" />
<Project Path="Unity.RenderPipelines.Universal.2D.Runtime.csproj" />
<Project Path="Unity.Collections.csproj" />
<Project Path="Unity.VisualScripting.Core.Editor.csproj" />
<Project Path="Unity.RenderPipelines.Universal.Editor.csproj" />
<Project Path="Unity.PerformanceTesting.Editor.csproj" />
<Project Path="Unity.Splines.csproj" />
<Project Path="UnityEngine.TestRunner.csproj" />
<Project Path="Unity.Burst.csproj" />
<Project Path="Unity.VisualScripting.Flow.Editor.csproj" />
<Project Path="Unity.Recorder.Editor.csproj" />
<Project Path="Unity.VisualStudio.Editor.csproj" />
<Project Path="Unity.InputSystem.csproj" />
<Project Path="PPv2URPConverters.csproj" />
<Project Path="LightSide.UniText.csproj" /> <Project Path="LightSide.UniText.csproj" />
<Project Path="UniTask.csproj" /> <Project Path="UniTask.csproj" />
<Project Path="Unity.Searcher.Editor.csproj" />
<Project Path="UnityEditor.TestRunner.csproj" />
<Project Path="Unity.VisualScripting.Core.csproj" />
<Project Path="Unity.RenderPipelines.Universal.Runtime.csproj" /> <Project Path="Unity.RenderPipelines.Universal.Runtime.csproj" />
<Project Path="Unity.UnifiedRayTracing.Runtime.csproj" />
<Project Path="Unity.AI.Navigation.Editor.ConversionSystem.csproj" />
<Project Path="Unity.VisualScripting.State.Editor.csproj" />
<Project Path="Unity.VisualEffectGraph.Runtime.csproj" />
<Project Path="Unity.Burst.CodeGen.csproj" />
<Project Path="Unity.Cinemachine.csproj" />
<Project Path="Unity.Postprocessing.Editor.csproj" />
<Project Path="FlatKit.Utils.Editor.csproj" /> <Project Path="FlatKit.Utils.Editor.csproj" />
<Project Path="Unity.VisualScripting.Flow.csproj" />
<Project Path="Unity.Splines.Editor.csproj" />
<Project Path="Unity.PerformanceTesting.csproj" />
<Project Path="Unity.TextMeshPro.csproj" />
<Project Path="UniTask.Linq.csproj" /> <Project Path="UniTask.Linq.csproj" />
<Project Path="Unity.TextMeshPro.Editor.csproj" />
<Project Path="ExternAttributes.Editor.csproj" /> <Project Path="ExternAttributes.Editor.csproj" />
<Project Path="Unity.Burst.Editor.csproj" />
<Project Path="Nobi.UiRoundedCorners.Editor.csproj" /> <Project Path="Nobi.UiRoundedCorners.Editor.csproj" />
<Project Path="Unity.Rider.Editor.csproj" />
<Project Path="Unity.VisualScripting.State.csproj" />
<Project Path="Unity.AI.Navigation.Updater.csproj" />
<Project Path="UnityEditor.UI.csproj" />
<Project Path="Unity.RenderPipelines.Universal.2D.Editor.Overrides.csproj" />
<Project Path="Unity.Postprocessing.Runtime.csproj" />
<Project Path="CFXRRuntime.csproj" /> <Project Path="CFXRRuntime.csproj" />
<Project Path="LightSide.UniText.Editor.csproj" /> <Project Path="LightSide.UniText.Editor.csproj" />
<Project Path="Unity.2D.Sprite.Editor.csproj" />
<Project Path="NuGetForUnity.csproj" /> <Project Path="NuGetForUnity.csproj" />
<Project Path="Unity.AI.Navigation.Editor.csproj" />
<Project Path="CFXRDemo.csproj" /> <Project Path="CFXRDemo.csproj" />
<Project Path="Unity.Recorder.csproj" />
<Project Path="CFXREditor.csproj" /> <Project Path="CFXREditor.csproj" />
<Project Path="Unity.Multiplayer.Center.Common.csproj" />
<Project Path="Assembly-CSharp-firstpass.csproj" /> <Project Path="Assembly-CSharp-firstpass.csproj" />
<Project Path="Unity.InputSystem.ForUI.csproj" />
<Project Path="Unity.AI.Navigation.csproj" />
<Project Path="Unity.Collections.CodeGen.csproj" />
<Project Path="Assembly-CSharp-Editor.csproj" /> <Project Path="Assembly-CSharp-Editor.csproj" />
<Project Path="Unity.Mathematics.Editor.csproj" />
<Project Path="Unity.VisualScripting.SettingsProvider.Editor.csproj" />
<Project Path="UnityEditor.UI.Analytics.csproj" />
<Project Path="UniTask.TextMeshPro.csproj" /> <Project Path="UniTask.TextMeshPro.csproj" />
<Project Path="Unity.Settings.Editor.csproj" />
<Project Path="Unity.InputSystem.TestFramework.csproj" />
<Project Path="Unity.ShaderGraph.Utilities.csproj" />
<Project Path="Unity.VisualScripting.Shared.Editor.csproj" />
<Project Path="Unity.Recorder.Base.csproj" />
<Project Path="KinoBloom.Runtime.csproj" /> <Project Path="KinoBloom.Runtime.csproj" />
<Project Path="Nobi.UiRoundedCorners.csproj" /> <Project Path="Nobi.UiRoundedCorners.csproj" />
<Project Path="Unity.CollabProxy.Editor.csproj" />
<Project Path="CFXR.WelcomeScreen.csproj" /> <Project Path="CFXR.WelcomeScreen.csproj" />
<Project Path="Unity.RenderPipeline.Universal.ShaderLibrary.csproj" />
<Project Path="UniTask.Editor.csproj" /> <Project Path="UniTask.Editor.csproj" />
<Project Path="ToonyColorsPro.Demo.Editor.csproj" /> <Project Path="ToonyColorsPro.Demo.Editor.csproj" />
<Project Path="Unity.Bindings.OpenImageIO.Editor.csproj" />
<Project Path="Unity.InputSystem.DocCodeSamples.csproj" />
<Project Path="Unity.RenderPipelines.Universal.Shaders.csproj" />
<Project Path="Unity.RenderPipelines.Core.Runtime.Shared.csproj" />
<Project Path="Unity.InternalAPIEngineBridge.004.csproj" />
<Project Path="Unity.RenderPipelines.Core.Editor.Shared.csproj" />
<Project Path="Unity.VisualScripting.DocCodeExamples.csproj" />
<Project Path="Unity.PlasticSCM.Editor.Entities.csproj" />
<Project Path="UniTask.Addressables.csproj" /> <Project Path="UniTask.Addressables.csproj" />
<Project Path="Unity.Rendering.LightTransport.Editor.csproj" />
<Project Path="Unity.Collections.Editor.csproj" />
<Project Path="UniTask.DOTween.csproj" /> <Project Path="UniTask.DOTween.csproj" />
<Project Path="Unity.RenderPipelines.Universal.Config.Runtime.csproj" />
<Project Path="Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.csproj" />
<Project Path="Unity.RenderPipelines.Core.ShaderLibrary.csproj" />
</Solution> </Solution>
...@@ -66,14 +66,14 @@ ...@@ -66,14 +66,14 @@
"url": "https://packages.unity.com" "url": "https://packages.unity.com"
}, },
"com.unity.collections": { "com.unity.collections": {
"version": "2.6.2", "version": "2.6.5",
"depth": 1, "depth": 1,
"source": "registry", "source": "registry",
"dependencies": { "dependencies": {
"com.unity.burst": "1.8.23", "com.unity.burst": "1.8.27",
"com.unity.mathematics": "1.3.2", "com.unity.mathematics": "1.3.2",
"com.unity.test-framework": "1.4.6", "com.unity.test-framework": "1.4.6",
"com.unity.nuget.mono-cecil": "1.11.5", "com.unity.nuget.mono-cecil": "1.11.6",
"com.unity.test-framework.performance": "3.0.3" "com.unity.test-framework.performance": "3.0.3"
}, },
"url": "https://packages.unity.com" "url": "https://packages.unity.com"
...@@ -217,7 +217,7 @@ ...@@ -217,7 +217,7 @@
} }
}, },
"com.unity.splines": { "com.unity.splines": {
"version": "2.8.2", "version": "2.8.4",
"depth": 1, "depth": 1,
"source": "registry", "source": "registry",
"dependencies": { "dependencies": {
......
m_EditorVersion: 6000.3.9f1 m_EditorVersion: 6000.3.12f1
m_EditorVersionWithRevision: 6000.3.9f1 (7a9955a4f2fa) m_EditorVersionWithRevision: 6000.3.12f1 (fca03ac9b0d5)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment