Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private void Update()

public void UpdateObjectiveLanguage(int idx, string s)
{
if (idx >= 0 && idx < objectives.Count)
if (objectives != null && idx >= 0 && idx < objectives.Count)
{
objectives[idx] = s;
ReloadObjectives();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public GameManager.Language SubtitlesLanguage
set
{
subtitlesLanguage = value;
DisplaySubtitles();
if (isSubtitlePlaying) DisplaySubtitles();
}
}

Expand Down
5 changes: 4 additions & 1 deletion POINT-VR-Chapter-1/Assets/POINT/Credits/EndCreditsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using UnityEngine.UI;
using TMPro;


public class EndCreditsManager : MonoBehaviour
{
// Rich text tags for different classes of text
Expand Down Expand Up @@ -38,6 +37,9 @@ private class CreditsPosition
}
#endregion

[Tooltip("Default localized string that appears under current objective in the UI menu")]
[SerializeField] private UnityEngine.Localization.LocalizedString defaultObjective;

[Header("Credits Segments")]
[Tooltip("The GameObject containing all components for the funding acknowledgements section")]
[SerializeField] private GameObject fundingAcknowledgements = null;
Expand Down Expand Up @@ -95,6 +97,7 @@ private IEnumerator Start()
{
yield return WaitForPlayerSpawn();

player.transform.parent.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(defaultObjective);
player.GetComponent<NarrationManager>().PlayClipWithSubtitles("temporary_ending_2");

if (fundingAcknowledgements != null)
Expand Down
11 changes: 7 additions & 4 deletions POINT-VR-Chapter-1/Assets/POINT/InputAssets/StartMenuManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ public int Language
}
}
}

uiManager.Language = value;
}

language = value;
Expand All @@ -93,16 +95,15 @@ public int SubtitleLanguage
}
}

if (value > 0) value = 1;

int toggleIdx = (value == 0) ? 0 : 1;
if (uiManager != null && subtitlesParent != null)
{
for (int i = 0; i < subtitlesParent.childCount; i++)
{
Image imageComponent = subtitlesParent.GetChild(i).GetComponentInChildren<Image>();
if (imageComponent != null)
{
if (i == value) // selected toggle
if (i == toggleIdx) // selected toggle
{
imageComponent.sprite = uiManager.toggleSelected;
}
Expand All @@ -112,6 +113,8 @@ public int SubtitleLanguage
}
}
}

uiManager.SubtitleLanguage = value;
}

subtitleLanguage = value;
Expand Down Expand Up @@ -171,7 +174,7 @@ private IEnumerator DisablePause()
yield return new WaitUntil(() => Camera.current != null);

player = Camera.current.transform.parent.gameObject;
player.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(defaultObjective);
player.transform.parent.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(defaultObjective);
player.GetComponent<PauseController>().ToggleReference.action.Disable();
}

Expand Down
32 changes: 18 additions & 14 deletions POINT-VR-Chapter-1/Assets/POINT/InputAssets/TutorialManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public class TutorialManager : MonoBehaviour
private string menuString;
private string openMenuString;


// Cache
private TMP_Text instructions = null;
private Camera currentCamera = null;
Expand Down Expand Up @@ -166,9 +165,10 @@ private void StartTutorial()
// Turn tutorial
controlsImage.sprite = turnSprite;
turnText.RefreshString();
UpdateTurnString(turnText.GetLocalizedString());
instructions.text = turnString;

player.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(instructions.text);
player.transform.parent.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(turnText);
player.GetComponent<NarrationManager>().PlayClipWithSubtitles("Tutorial\\Tutorial_Intro");

StartCoroutine(WaitForTurn());
Expand All @@ -181,13 +181,13 @@ IEnumerator WaitForTurn()
yield return new WaitUntil(() => player.transform.rotation.y != initialRotation);

// Teleportation tutorial

player.GetComponent<NarrationManager>().PlayClipWithSubtitles("Tutorial\\Tutorial_Teleport");
controlsImage.sprite = teleportationSprite;
teleportationText.RefreshString();
UpdateTeleportationString(teleportationText.GetLocalizedString());
instructions.text = teleportationString;

player.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(instructions.text);
player.transform.parent.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(teleportationText);

StartCoroutine(WaitForTeleport());

Expand Down Expand Up @@ -215,9 +215,10 @@ IEnumerator WaitForTeleport()
// Grab tutorial
controlsImage.sprite = grabSprite;
grabText.RefreshString();
UpdateGrabString(grabText.GetLocalizedString());
instructions.text = grabString;

player.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(instructions.text);
player.transform.parent.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(grabText);
player.GetComponent<NarrationManager>().PlayClipWithSubtitles("Tutorial\\Tutorial_Grab");

StartCoroutine(WaitForGrab());
Expand All @@ -232,9 +233,10 @@ IEnumerator WaitForGrab()
// Push and pull tutorial
controlsImage.sprite = pushPullSprite;
pushPullText.RefreshString();
UpdatePushPullString(pushPullText.GetLocalizedString());
instructions.text = pushPullString;

player.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(instructions.text);
player.transform.parent.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(pushPullText);
player.GetComponent<NarrationManager>().PlayClipWithSubtitles("Tutorial\\Tutorial_Push&Pull");

StartCoroutine(WaitForPushPull());
Expand All @@ -257,9 +259,10 @@ IEnumerator WaitForPushPull()
// Activate Menu
controlsImage.sprite = menuSprite;
openMenuText.RefreshString();
UpdateOpenMenuString(openMenuText.GetLocalizedString());
instructions.text = openMenuString;

player.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(instructions.text);
player.transform.parent.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(openMenuText);
player.GetComponent<NarrationManager>().PlayClipWithSubtitles("Tutorial\\Tutorial_Menu_Open");

StartCoroutine(WaitForMenuPopup());
Expand Down Expand Up @@ -325,6 +328,7 @@ IEnumerator WaitForSceneSelection()
yield return new WaitForSecondsRealtime(11); // Set to the audio file above's duration in seconds

overText.RefreshString();
UpdateOverString(overText.GetLocalizedString());
instructions.text = overString;
SceneUIContainer.SetActive(true);

Expand Down Expand Up @@ -356,7 +360,7 @@ private void UpdateTeleportationString(string s)
if (instructions.text == teleportationString)
{
instructions.text = s;
player.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(instructions.text);
player.transform.parent.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(instructions.text);
}
else
{
Expand All @@ -372,7 +376,7 @@ private void UpdateTurnString(string s)
if (instructions.text == turnString)
{
instructions.text = s;
player.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(instructions.text);
player.transform.parent.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(instructions.text);
}
else
{
Expand All @@ -388,7 +392,7 @@ private void UpdateGrabString(string s)
if (instructions.text == grabString)
{
instructions.text = s;
player.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(instructions.text);
player.transform.parent.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(instructions.text);
}
else
{
Expand All @@ -404,7 +408,7 @@ private void UpdatePushPullString(string s)
if (instructions.text == pushPullString)
{
instructions.text = s;
player.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(instructions.text);
player.transform.parent.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(instructions.text);
}
else
{
Expand All @@ -420,7 +424,7 @@ private void UpdateOverString(string s)
if (instructions.text == overString)
{
instructions.text = s;
player.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(instructions.text);
player.transform.parent.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(instructions.text);
}
else
{
Expand All @@ -436,7 +440,7 @@ private void UpdateMenuString(string s)
if (instructions.text == menuString)
{
instructions.text = s;
player.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(instructions.text);
player.transform.parent.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(instructions.text);
}
else
{
Expand All @@ -452,7 +456,7 @@ private void UpdateOpenMenuString(string s)
if (instructions.text == openMenuString)
{
instructions.text = s;
player.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(instructions.text);
player.transform.parent.GetComponentInChildren<UIManager>(true).UpdateCurrentObjective(instructions.text);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@ MonoBehaviour:
m_Identifier:
m_Code: en
m_Metadata:
m_Items: []
m_Items:
- id: 0
m_LocaleName: English (en)
m_CustomFormatCultureCode:
m_UseCustomFormatter: 0
m_SortOrder: 10000
references:
version: 1
00000000:
type: {class: FallbackLocale, ns: UnityEngine.Localization.Metadata, asm: Unity.Localization}
data:
m_Locale: {fileID: 11400000}
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ MonoBehaviour:
asm: Unity.Localization}
data:
m_DefaultTableReference:
m_TableCollectionName:
m_UseFallback: 0
m_TableCollectionName: UILocalization
m_UseFallback: 1
m_MissingTranslationState: 1
m_NoTranslationFoundMessage: No translation found for '{key}' in {table.TableCollectionName}
m_SmartFormat:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@ MonoBehaviour:
m_Identifier:
m_Code: es
m_Metadata:
m_Items: []
m_Items:
- id: 0
m_LocaleName: Spanish (es)
m_CustomFormatCultureCode:
m_UseCustomFormatter: 0
m_SortOrder: 10000
references:
version: 1
00000000:
type: {class: FallbackLocale, ns: UnityEngine.Localization.Metadata, asm: Unity.Localization}
data:
m_Locale: {fileID: 11400000, guid: 27f713b6a8d9f414db8697ee04ee224b, type: 2}
11 changes: 11 additions & 0 deletions POINT-VR-Chapter-1/Assets/POINT/Scenes/Chapter1/EndCredits.unity
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,15 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8730d809b4759534fa8731325c636774, type: 3}
m_Name:
m_EditorClassIdentifier:
defaultObjective:
m_TableReference:
m_TableCollectionName: GUID:ea97502b36f6cd149b6a571be6e2583f
m_TableEntryReference:
m_KeyId: 13430563209777159
m_Key:
m_FallbackState: 0
m_WaitForCompletion: 0
m_LocalVariables: []
fundingAcknowledgements: {fileID: 1180836758}
projectLinks: {fileID: 831191579}
fadeDuration: 2
Expand All @@ -309,6 +318,8 @@ MonoBehaviour:
endY: 5
fadeDistance: 1
scrollSpeed: 0.3
references:
version: 1
--- !u!1 &635651177
GameObject:
m_ObjectHideFlags: 0
Expand Down
3 changes: 2 additions & 1 deletion POINT-VR-Chapter-1/Assets/POINT/UIAssets/UIManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,13 @@ public int SubtitleLanguage
}


int toggleIdx = (value == 0) ? 0 : 1;
for (int i = 0; i < subtitleParent.childCount; i++)
{
Image imageComponent = subtitleParent.GetChild(i).GetComponentInChildren<Image>();
if (imageComponent != null)
{
if (i == value) // selected toggle
if (i == toggleIdx) // selected toggle; note: should change to i == value if subtitles has language options instead of on/off
{
imageComponent.sprite = toggleSelected;
}
Expand Down
Binary file added POINT-VR-Chapter-1/Builds/localization-stress.apk
Binary file not shown.
1 change: 1 addition & 0 deletions POINT-VR-Chapter-1/ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ PlayerSettings:
- {fileID: 0}
- {fileID: 0}
- {fileID: 11400000, guid: 2eb42e1390af4ba4ab51a9b482e68338, type: 2}
- {fileID: 11400000, guid: 4dd5ea5325ca26a4cbf5b83149f74bec, type: 2}
- {fileID: 4814008871340846074, guid: 7c600385b2e0246499112b5f537d1007, type: 2}
- {fileID: 11400000, guid: 2eac5b88f02ba704abc6cff84097461a, type: 2}
metroInputSource: 0
Expand Down