Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
904c1414b3 | ||
![]() |
c6be968792 | ||
![]() |
14f5992faf |
@ -72736,6 +72736,7 @@ MonoBehaviour:
|
||||
progressbarCanvasGroup: {fileID: 406583814}
|
||||
slides_Arabic: {fileID: 1974174197}
|
||||
slides_English: {fileID: 641758312}
|
||||
phishingEmailClicked: 0
|
||||
--- !u!4 &903207697
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -96037,6 +96038,10 @@ MonoBehaviour:
|
||||
- {fileID: 2053632136}
|
||||
- {fileID: 1240692695}
|
||||
- {fileID: 2043462171}
|
||||
- {fileID: 1517723657}
|
||||
- {fileID: 600925544}
|
||||
- {fileID: 81321691}
|
||||
- {fileID: 1477731470}
|
||||
answerLabels:
|
||||
- {fileID: 659337612}
|
||||
- {fileID: 2068036434}
|
||||
@ -96044,6 +96049,7 @@ MonoBehaviour:
|
||||
- {fileID: 488671637}
|
||||
feedbackText: {fileID: 737073900}
|
||||
restartButton: {fileID: 18539499}
|
||||
restartButtonArabic: {fileID: 1131745271}
|
||||
--- !u!4 &1210835902
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -102213,6 +102219,7 @@ MonoBehaviour:
|
||||
subtitleText: {fileID: 1874077070}
|
||||
charDelay: 0.075
|
||||
lineGroupDelay: 4.5
|
||||
audioSource: {fileID: 0}
|
||||
--- !u!1001 &1303496878
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -151117,7 +151124,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1974174198
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -9,6 +9,7 @@ public class MiniQuizManager : MonoBehaviour
|
||||
public TextMeshProUGUI[] answerLabels;
|
||||
public TextMeshProUGUI feedbackText;
|
||||
public GameObject restartButton;
|
||||
public GameObject restartButtonArabic;
|
||||
|
||||
private string[] answerTexts = new string[]
|
||||
{
|
||||
@ -31,9 +32,11 @@ public class MiniQuizManager : MonoBehaviour
|
||||
public void SubmitAnswer(int selectedIndex)
|
||||
{
|
||||
NarrationPlayer.Instance.PlayNarration(NarrationID.GameEnd);
|
||||
restartButton.SetActive(true);
|
||||
|
||||
bool isArabic = LanguageManager.Instance != null &&
|
||||
LanguageManager.Instance.currentLanguage == "Arabic";
|
||||
(isArabic ? restartButtonArabic : restartButton).SetActive(true);
|
||||
|
||||
|
||||
string selectedAnswer = answerTexts[selectedIndex];
|
||||
string selectedAnswerAr = answerTextsAr[selectedIndex];
|
||||
|
@ -28,7 +28,7 @@ public class NarrationPlayer : MonoBehaviour
|
||||
public float charDelay = 0.03f;
|
||||
public float lineGroupDelay = 2.5f; // Fallback if no custom delay provided
|
||||
|
||||
private AudioSource audioSource;
|
||||
public AudioSource audioSource;
|
||||
private Tween typewriterTween;
|
||||
private Dictionary<NarrationID, NarrationData> narrationMap;
|
||||
|
||||
@ -100,9 +100,24 @@ public class NarrationPlayer : MonoBehaviour
|
||||
}
|
||||
void scoreBarActivator()
|
||||
{
|
||||
Debug.Log("ScoreBarActivator");
|
||||
CancelInvoke(nameof(scoreBarActivator));
|
||||
SceneOutcomeManager.Instance.progressbarCanvasGroup.alpha = 1;
|
||||
InstructionManager.Instance.instructionBG.SetActive(false);
|
||||
if (SceneOutcomeManager.Instance.phishingEmailClicked == false)
|
||||
{
|
||||
|
||||
Debug.Log("phishingEmailClicked == false");
|
||||
SceneOutcomeManager.Instance.progressbarCanvasGroup.alpha = 1;
|
||||
InstructionManager.Instance.instructionBG.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("phishingEmailClicked == true");
|
||||
InstructionManager.Instance.instructionBG.SetActive(false);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
private void AppendSubtitle(string fullText, bool isArabic, NarrationData narrationData)
|
||||
{
|
||||
@ -165,6 +180,7 @@ public class NarrationPlayer : MonoBehaviour
|
||||
if (audioSource.isPlaying)
|
||||
audioSource.Stop();
|
||||
|
||||
|
||||
typewriterTween?.Kill();
|
||||
StopAllCoroutines();
|
||||
}
|
||||
@ -177,163 +193,4 @@ public class NarrationPlayer : MonoBehaviour
|
||||
}
|
||||
|
||||
public bool IsPlaying => audioSource.isPlaying;
|
||||
}
|
||||
|
||||
//using UnityEngine;
|
||||
//using TMPro;
|
||||
//using DG.Tweening;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Collections;
|
||||
|
||||
//public enum NarrationID
|
||||
//{
|
||||
// Intro,
|
||||
// NewEmail,
|
||||
// ScanEmail,
|
||||
// CorrectReportChoice,
|
||||
// CorrectIgnoreChoice,
|
||||
// WrongIgnoreChoice,
|
||||
// Feedback,
|
||||
// GameEnd
|
||||
//}
|
||||
|
||||
//public class NarrationPlayer : MonoBehaviour
|
||||
//{
|
||||
// public static NarrationPlayer Instance { get; private set; }
|
||||
|
||||
// [Header("Narration Assets")]
|
||||
// public List<NarrationData> narrationDatabase;
|
||||
|
||||
// [Header("Subtitle Settings")]
|
||||
// public TextMeshProUGUI subtitleText;
|
||||
// public float charDelay = 0.03f;
|
||||
|
||||
// private AudioSource audioSource;
|
||||
// private Tween typewriterTween;
|
||||
// private Dictionary<NarrationID, NarrationData> narrationMap;
|
||||
|
||||
// private void Awake()
|
||||
// {
|
||||
// if (Instance != null && Instance != this)
|
||||
// {
|
||||
// Destroy(gameObject);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// Instance = this;
|
||||
//// DontDestroyOnLoad(gameObject);
|
||||
|
||||
// audioSource = gameObject.AddComponent<AudioSource>();
|
||||
// audioSource.playOnAwake = false;
|
||||
|
||||
// narrationMap = new Dictionary<NarrationID, NarrationData>();
|
||||
// foreach (var data in narrationDatabase)
|
||||
// {
|
||||
// if (data != null && !narrationMap.ContainsKey(data.narrationID))
|
||||
// narrationMap[data.narrationID] = data;
|
||||
// }
|
||||
// }
|
||||
|
||||
// public void PlayNarration(NarrationID id, System.Action onComplete = null)
|
||||
// {
|
||||
// if (!narrationMap.TryGetValue(id, out var narrationData))
|
||||
// {
|
||||
// Debug.LogWarning($"Narration not found for: {id}");
|
||||
// return;
|
||||
// }
|
||||
|
||||
// bool isArabic = LanguageManager.Instance.IsArabic;
|
||||
// AudioClip clip = isArabic ? narrationData.arabicClip : narrationData.englishClip;
|
||||
|
||||
// if (clip == null)
|
||||
// {
|
||||
// Debug.LogWarning($"Missing audio clip for {id} in language: {(isArabic ? "Arabic" : "English")}");
|
||||
// return;
|
||||
// }
|
||||
|
||||
// if (audioSource.isPlaying)
|
||||
// audioSource.Stop();
|
||||
|
||||
// audioSource.clip = clip;
|
||||
// audioSource.Play();
|
||||
|
||||
// if (!string.IsNullOrEmpty(narrationData.localizationKey))
|
||||
// {
|
||||
// string rawSubtitle = LanguageManager.Instance.GetLocalizedText(narrationData.localizationKey);
|
||||
// string subtitle = isArabic
|
||||
// ? ArabicFixerHelper.FixPreservingTags(rawSubtitle)
|
||||
// : rawSubtitle;
|
||||
|
||||
// // TMP settings per language
|
||||
// subtitleText.font = LanguageManager.Instance.GetCurrentFont();
|
||||
// subtitleText.fontSize = isArabic ? 39 : 50;
|
||||
// // subtitleText.alignment = isArabic ? TextAlignmentOptions.Right : TextAlignmentOptions.Left;
|
||||
// subtitleText.overflowMode = TextOverflowModes.Page;
|
||||
// subtitleText.isRightToLeftText = false; // MUST be false with ArabicFixer
|
||||
|
||||
// AppendSubtitle(subtitle, isArabic);
|
||||
// }
|
||||
|
||||
// if (onComplete != null)
|
||||
// StartCoroutine(InvokeAfterNarration(clip.length, onComplete));
|
||||
// }
|
||||
|
||||
// private void AppendSubtitle(string fullText, bool isArabic)
|
||||
// {
|
||||
// typewriterTween?.Kill();
|
||||
// subtitleText.text = "";
|
||||
|
||||
// if (isArabic)
|
||||
// {
|
||||
// StartCoroutine(ShowArabicByPages(fullText));
|
||||
// return;
|
||||
// }
|
||||
|
||||
// int totalLength = fullText.Length;
|
||||
// int currentIndex = 0;
|
||||
|
||||
// typewriterTween = DOTween.To(() => currentIndex, x =>
|
||||
// {
|
||||
// currentIndex = x;
|
||||
// subtitleText.text = fullText.Substring(0, currentIndex);
|
||||
// subtitleText.ForceMeshUpdate();
|
||||
// subtitleText.pageToDisplay = subtitleText.textInfo.pageCount;
|
||||
// }, totalLength, totalLength * charDelay).SetEase(Ease.Linear);
|
||||
// }
|
||||
|
||||
// private IEnumerator ShowArabicByPages(string fullText)
|
||||
// {
|
||||
// subtitleText.text = fullText;
|
||||
// subtitleText.ForceMeshUpdate();
|
||||
|
||||
// int totalPages = subtitleText.textInfo.pageCount;
|
||||
|
||||
// for (int i = 1; i <= totalPages; i++)
|
||||
// {
|
||||
// subtitleText.pageToDisplay = i;
|
||||
// yield return new WaitForSeconds(5f); // Adjust delay per page
|
||||
// }
|
||||
// }
|
||||
|
||||
// private IEnumerator InvokeAfterNarration(float delay, System.Action callback)
|
||||
// {
|
||||
// yield return new WaitForSeconds(delay);
|
||||
// callback?.Invoke();
|
||||
// }
|
||||
|
||||
// public void StopNarration()
|
||||
// {
|
||||
// if (audioSource.isPlaying)
|
||||
// audioSource.Stop();
|
||||
|
||||
// typewriterTween?.Kill();
|
||||
// }
|
||||
|
||||
// public void ClearSubtitles()
|
||||
// {
|
||||
// typewriterTween?.Kill();
|
||||
// subtitleText.text = "";
|
||||
// }
|
||||
|
||||
// public bool IsPlaying => audioSource.isPlaying;
|
||||
//}
|
||||
}
|
@ -104,14 +104,19 @@ public class SceneOutcomeManager : MonoBehaviour
|
||||
WorldTimelineManager.Instance.SnapshotCurrentSequence();
|
||||
}
|
||||
}
|
||||
|
||||
public bool phishingEmailClicked = false;
|
||||
public void Clicked(EmailData data)
|
||||
{
|
||||
if (data.isPhishing)
|
||||
{
|
||||
Debug.Log("❌ SIMULATION FAILED – CREDENTIALS STOLEN");
|
||||
understandPhishingImage.SetActive(true);
|
||||
StartCoroutine(MoveCameraToDebrief());
|
||||
//StartCoroutine(MoveCameraToDebrief());
|
||||
phishingEmailClicked = true;
|
||||
NarrationPlayer.Instance.StopNarration();
|
||||
//NarrationPlayer.Instance.audioSource.Stop();
|
||||
//progressbarCanvasGroup.alpha = 0;
|
||||
ProceedToDebrief();
|
||||
WorldTimelineManager.Instance.SnapshotCurrentSequence();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user