Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,634 changes: 1,486 additions & 2,148 deletions Assets/Hebrew Fonts/OpenSans-VariableFont_wdth,wght SDF.asset

Large diffs are not rendered by default.

253 changes: 244 additions & 9 deletions Assets/Hebrew Fonts/RubikDoodleShadow-Regular SDF.asset

Large diffs are not rendered by default.

8,257 changes: 6,580 additions & 1,677 deletions Assets/Hebrew Fonts/SecularOne-Regular SDF.asset

Large diffs are not rendered by default.

211 changes: 117 additions & 94 deletions Assets/Hebrew Fonts/TitanOne-Regular SDF.asset

Large diffs are not rendered by default.

365 changes: 358 additions & 7 deletions Assets/Scenes/SortingAsteroid.unity

Large diffs are not rendered by default.

1,182 changes: 1,116 additions & 66 deletions Assets/Scenes/SpaceEquipmentRecoveryMission.unity

Large diffs are not rendered by default.

514 changes: 501 additions & 13 deletions Assets/Scenes/TubesGame.unity

Large diffs are not rendered by default.

514 changes: 472 additions & 42 deletions Assets/Scenes/WelcomeScene-vivi.unity

Large diffs are not rendered by default.

790 changes: 639 additions & 151 deletions Assets/Scenes/WiresConnection.unity

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions Assets/Scripts/CabelGame/CableConnectionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public class CableConnectionStage
[SerializeField] private Button timer20sButton;
[SerializeField] private Button timer25sButton;

[SerializeField] private TextMeshProUGUI stageNumberText;


private int gameIndex = 1; // Set the correct game index
Expand Down Expand Up @@ -160,8 +161,26 @@ public void LoadStage(int stageIndex)
}

currentStage = stageIndex;
if (stageNumberText != null)
{
stageNumberText.text = $"{currentStage + 1}/{stages.Length}";
}

mistakesCount = 0;
CableConnectionStage stage = stages[currentStage];
// Show intro only for first stage
if (currentStage == 0 && stage.dialoguePanel != null)
{
if (dialogueCanvas != null) dialogueCanvas.gameObject.SetActive(true);
stage.dialoguePanel.gameObject.SetActive(true);


stage.dialoguePanel.StartDialogue(OnDialogueFinished);

if (dialogueNextButton != null)
dialogueNextButton.gameObject.SetActive(true);
return;
}

// Turn off all panels
foreach (var s in stages)
Expand Down
4 changes: 3 additions & 1 deletion Assets/Scripts/SortingAsteroid/AsteroidGameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ private void InitializeChallenge()
AssignDropZoneTypes();
SetupDropZones(currentChallenge.dropZones);

// **Fix:** Generate the correct instructions AFTER setting the challenge
// Update stage number text (e.g., 1/3)
int totalStages = asteroidChallengeManager.GetChallengeCount();
uiManager.UpdateStageNumber(currentChallengeIndex, totalStages);
string instructions = GenerateInstructions();
Debug.Log($"Updating instructions: {instructions}");
uiManager.ShowInstructions(instructions, StartGame);
Expand Down
11 changes: 11 additions & 0 deletions Assets/Scripts/SortingAsteroid/AsteroidGameUIManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public class AsteroidGameUIManager : MonoBehaviour
[SerializeField] private StrategyManager strategyManager;
[SerializeField] private Button startChallengeButton;

[SerializeField] private TextMeshProUGUI stageNumberText;

public float SelectedDuration { get; private set; } = 0f;
public void ShowInstructions(string instructions, System.Action onStartGame)
{
Expand Down Expand Up @@ -275,6 +277,15 @@ public void SelectDuration(float duration)
startChallengeButton.interactable = true;
}

public void UpdateStageNumber(int currentIndex, int totalCount)
{
if (stageNumberText != null)
{
stageNumberText.text = $"{currentIndex + 1}/{totalCount}";
}
}




}
1 change: 1 addition & 0 deletions Assets/Scripts/TubesGame/GameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ private void ShowStageIntroduction(int stageIndex)

Stage currentStage = stages[stageIndex];
Debug.Log($"Stage {stageIndex + 1}: {currentStage.instructionText}");
uiManager.UpdateStageNumber(stageIndex, stages.Count);
uiManager.ShowInstructionPanel(currentStage.instructionText);
}

Expand Down
8 changes: 8 additions & 0 deletions Assets/Scripts/TubesGame/TubesUIManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class TubesUIManager : MonoBehaviour
[Header("Strategy Panel")]
[SerializeField] private StrategyManager strategyManager;

[SerializeField] private TextMeshProUGUI stageNumberText;


private int gameIndex = 0; // Tubes Game index (should match DoorManager setup)
Expand Down Expand Up @@ -269,6 +270,13 @@ public void ShowTimerBackground()
timerBackground.enabled = true;
}
}
public void UpdateStageNumber(int current, int total)
{
if (stageNumberText != null)
{
stageNumberText.text = $"{current + 1}/{total}";
}
}


}
Expand Down
63 changes: 31 additions & 32 deletions Assets/Scripts/UI/WelcomeUIManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,55 +52,48 @@ public async void OnRegisterClicked()
return;
}

// Password must have at least 6 characters, including lowercase, uppercase, digit, special char
if (!System.Text.RegularExpressions.Regex.IsMatch(password, @"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z0-9]).{6,}$"))
if (password.Length < 4)
{
feedbackText.text = "������ ����� ����� ����� 6 �����, ���� ��� ����, ��� �����, ���� ��� �����.";
feedbackText.text = "������ ����� ����� ����� 4 �����.";
return;
}

string finalPassword = MakePasswordCompliant(password);


try
{
await AuthenticationService.Instance.SignUpWithUsernamePasswordAsync(username, password);
await AuthenticationService.Instance.SignUpWithUsernamePasswordAsync(username, finalPassword);
feedbackText.text = "����� ������ ������.";

// New user - create and save fresh progress
GameProgressManager.Instance.playerProgress = new PlayerProgress(username, "");
var pp = GameProgressManager.Instance.playerProgress;

//// Convert and snapshot Cycle 1
//pp.ConvertDictionaryToList();
//var initialSnapshot = new List<SerializableGameProgress>();
//foreach (var game in pp.gamesProgressList)
//{
// var copiedGame = new SerializableGameProgress
// {
// gameIndex = game.gameIndex,
// progress = JsonConvert.DeserializeObject<GameProgress>(
// JsonConvert.SerializeObject(game.progress,
// new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.Auto })
// )
// };
// initialSnapshot.Add(copiedGame);
//}

//pp.cycleHistory.Add(new CycleSummary
//{
// cycleNumber = pp.currentCycle,
// totalScore = pp.totalScore,
// startDate = pp.currentCycleStartDate,
// endDate = pp.currentCycleStartDate,
// gamesSnapshot = initialSnapshot
//});

GameProgressManager.Instance.SaveProgress();

SceneManager.LoadScene("LioAndMayaScene");
}
catch (AuthenticationException e)
{
feedbackText.text = $"����� �����: {e.Message}";
//Debug.LogError($"Request failed: {e.Message}");

if (e.Message.ToLower().Contains("username already exists") || e.Message.Contains("409"))
{
feedbackText.text = "�� ������ ��� ����. ��� ������ �� �� ���.";
}
else
{
feedbackText.text = "����� �����";
}
}

}

private string MakePasswordCompliant(string rawPassword)
{
return rawPassword + "Aa1!";
}


Expand All @@ -116,9 +109,11 @@ public async void OnLoginClicked()
return;
}

string finalPassword = MakePasswordCompliant(password);

try
{
await AuthenticationService.Instance.SignInWithUsernamePasswordAsync(username, password);
await AuthenticationService.Instance.SignInWithUsernamePasswordAsync(username, finalPassword);
feedbackText.text = "������� ������.";

await GameProgressManager.Instance.LoadProgress();
Expand All @@ -133,18 +128,22 @@ public async void OnLoginClicked()
}
catch (AuthenticationException e)
{
Debug.LogWarning($"Login failed: {e.Message}");

if (e.Message.ToLower().Contains("wrong_username_password") || e.Message.ToLower().Contains("invalid_parameters"))
{
feedbackText.text = "�� ����� �� ����� ������. �� �� ���� ������� ���, ��� �� '�����'.";
}
else
{
feedbackText.text = $"������� �����: {e.Message}";
feedbackText.text = $"������� �����";
}
}
catch (RequestFailedException e)
{
feedbackText.text = $"����� ����� ��������: {e.Message}";
Debug.LogWarning($"Request failed: {e.Message}");
feedbackText.text = $"��� ����� ��� ������ ������� ������";
}
}

}
Loading