Browse Source

script subtitle fix

audio
Cailean Finn 5 months ago
parent
commit
494bbb501c
  1. 82
      Assets/5_Scenes/DreconDemo.unity
  2. 2
      Assets/8_Scripts/1_Managers/NarrationManager.cs
  3. 12
      Assets/8_Scripts/1_Managers/SubtitleManager.cs
  4. 2
      Assets/ML-Agents/Timers/DreconDemo_timers.json

82
Assets/5_Scenes/DreconDemo.unity

@ -919,22 +919,22 @@ LineRenderer:
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_Positions: m_Positions:
- {x: -366.93365, y: -21.965973, z: -275.76828} - {x: -406.39203, y: -21.907104, z: -298.97668}
- {x: -125.7357, y: -21.965973, z: -275.76828} - {x: -116.43707, y: -21.907104, z: -298.97668}
- {x: -125.7357, y: -21.965973, z: -81.86978} - {x: -116.43707, y: -21.907104, z: -76.17833}
- {x: -366.93365, y: -21.965973, z: -81.86978} - {x: -406.39203, y: -21.907104, z: -76.17833}
- {x: -366.93365, y: -21.965973, z: -275.76828} - {x: -406.39203, y: -21.907104, z: -298.97668}
- {x: -366.93365, y: 457.00143, z: -275.76828} - {x: -406.39203, y: 446.45215, z: -298.97668}
- {x: -125.7357, y: 457.00143, z: -275.76828} - {x: -116.43707, y: 446.45215, z: -298.97668}
- {x: -125.7357, y: -21.965973, z: -275.76828} - {x: -116.43707, y: -21.907104, z: -298.97668}
- {x: -125.7357, y: 457.00143, z: -275.76828} - {x: -116.43707, y: 446.45215, z: -298.97668}
- {x: -125.7357, y: 457.00143, z: -81.86978} - {x: -116.43707, y: 446.45215, z: -76.17833}
- {x: -125.7357, y: -21.965973, z: -81.86978} - {x: -116.43707, y: -21.907104, z: -76.17833}
- {x: -125.7357, y: 457.00143, z: -81.86978} - {x: -116.43707, y: 446.45215, z: -76.17833}
- {x: -366.93365, y: 457.00143, z: -81.86978} - {x: -406.39203, y: 446.45215, z: -76.17833}
- {x: -366.93365, y: -21.965973, z: -81.86978} - {x: -406.39203, y: -21.907104, z: -76.17833}
- {x: -366.93365, y: 457.00143, z: -81.86978} - {x: -406.39203, y: 446.45215, z: -76.17833}
- {x: -366.93365, y: 457.00143, z: -275.76828} - {x: -406.39203, y: 446.45215, z: -298.97668}
m_Parameters: m_Parameters:
serializedVersion: 3 serializedVersion: 3
widthMultiplier: 1 widthMultiplier: 1
@ -1268,7 +1268,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 62178361} m_GameObject: {fileID: 62178361}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0.12400305, y: -0.09265332, z: 0.011630273, w: 0.9878782} m_LocalRotation: {x: 0.12400308, y: -0.092653364, z: 0.011630281, w: 0.9878782}
m_LocalPosition: {x: 24.371735, y: 51, z: -83.27547} m_LocalPosition: {x: 24.371735, y: 51, z: -83.27547}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
@ -1980,7 +1980,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 153031623} m_GameObject: {fileID: 153031623}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: -0.000010761081, y: 0.9982297, z: 0.059476666, w: -0.000077618104} m_LocalRotation: {x: -0.00001076108, y: 0.9982297, z: 0.059476666, w: -0.000077618104}
m_LocalPosition: {x: 18.101631, y: 8.540332, z: 4.4995093} m_LocalPosition: {x: 18.101631, y: 8.540332, z: 4.4995093}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
@ -3797,7 +3797,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 320225263} m_GameObject: {fileID: 320225263}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0.42968017, y: 0.5493336, z: -0.39451066, w: 0.5983051} m_LocalRotation: {x: 0.42968023, y: 0.5493335, z: -0.39451057, w: 0.59830517}
m_LocalPosition: {x: 69.4, y: 315, z: -332.1} m_LocalPosition: {x: 69.4, y: 315, z: -332.1}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
@ -3893,7 +3893,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 326736459} m_GameObject: {fileID: 326736459}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: -0.073961094, y: 0.9066138, z: 0.17882526, w: 0.3749702} m_LocalRotation: {x: -0.07396109, y: 0.9066138, z: 0.17882524, w: 0.37497023}
m_LocalPosition: {x: 17.7008, y: 8.655965, z: -0.081218004} m_LocalPosition: {x: 17.7008, y: 8.655965, z: -0.081218004}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
@ -4128,7 +4128,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 330585543} m_GameObject: {fileID: 330585543}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0.42968017, y: 0.5493336, z: -0.39451066, w: 0.5983051} m_LocalRotation: {x: 0.42968023, y: 0.5493335, z: -0.39451057, w: 0.59830517}
m_LocalPosition: {x: 69.4, y: 315, z: -332.1} m_LocalPosition: {x: 69.4, y: 315, z: -332.1}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
@ -7605,7 +7605,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 605393721} m_GameObject: {fileID: 605393721}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: -0.00006630494, y: 0.99952006, z: 0.030905241, w: 0.0021443975} m_LocalRotation: {x: -0.000066303845, y: 0.99952006, z: 0.03090522, w: 0.002144363}
m_LocalPosition: {x: 18.109627, y: 8.274419, z: 9.536423} m_LocalPosition: {x: 18.109627, y: 8.274419, z: 9.536423}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
@ -11063,7 +11063,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 882491594} m_GameObject: {fileID: 882491594}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0.49182287, y: 0.0021121174, z: -0.00119306, w: 0.8706919} m_LocalRotation: {x: 0.49182287, y: 0.0021121474, z: -0.0011930768, w: 0.8706919}
m_LocalPosition: {x: 18.100853, y: 10.155965, z: -0.48116565} m_LocalPosition: {x: 18.100853, y: 10.155965, z: -0.48116565}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
@ -17596,7 +17596,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1440085503} m_GameObject: {fileID: 1440085503}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0.02228007, y: 0.97466654, z: 0.11340367, w: -0.19148976} m_LocalRotation: {x: 0.022280075, y: 0.97466654, z: 0.11340367, w: -0.19148977}
m_LocalPosition: {x: 93.69663, y: 54.427773, z: 12.745178} m_LocalPosition: {x: 93.69663, y: 54.427773, z: 12.745178}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
@ -23004,22 +23004,22 @@ LineRenderer:
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_Positions: m_Positions:
- {x: -84.96269, y: -19.88411, z: -252.13945} - {x: -92.18242, y: -20.551285, z: -260.25806}
- {x: 176.40376, y: -19.88411, z: -252.13945} - {x: 198.6393, y: -20.551285, z: -260.25806}
- {x: 176.40376, y: -19.88411, z: 10.1922455} - {x: 198.6393, y: -20.551285, z: 15.784485}
- {x: -84.96269, y: -19.88411, z: 10.1922455} - {x: -92.18242, y: -20.551285, z: 15.784485}
- {x: -84.96269, y: -19.88411, z: -252.13945} - {x: -92.18242, y: -20.551285, z: -260.25806}
- {x: -84.96269, y: 461.3249, z: -252.13945} - {x: -92.18242, y: 447.10724, z: -260.25806}
- {x: 176.40376, y: 461.3249, z: -252.13945} - {x: 198.6393, y: 447.10724, z: -260.25806}
- {x: 176.40376, y: -19.88411, z: -252.13945} - {x: 198.6393, y: -20.551285, z: -260.25806}
- {x: 176.40376, y: 461.3249, z: -252.13945} - {x: 198.6393, y: 447.10724, z: -260.25806}
- {x: 176.40376, y: 461.3249, z: 10.1922455} - {x: 198.6393, y: 447.10724, z: 15.784485}
- {x: 176.40376, y: -19.88411, z: 10.1922455} - {x: 198.6393, y: -20.551285, z: 15.784485}
- {x: 176.40376, y: 461.3249, z: 10.1922455} - {x: 198.6393, y: 447.10724, z: 15.784485}
- {x: -84.96269, y: 461.3249, z: 10.1922455} - {x: -92.18242, y: 447.10724, z: 15.784485}
- {x: -84.96269, y: -19.88411, z: 10.1922455} - {x: -92.18242, y: -20.551285, z: 15.784485}
- {x: -84.96269, y: 461.3249, z: 10.1922455} - {x: -92.18242, y: 447.10724, z: 15.784485}
- {x: -84.96269, y: 461.3249, z: -252.13945} - {x: -92.18242, y: 447.10724, z: -260.25806}
m_Parameters: m_Parameters:
serializedVersion: 3 serializedVersion: 3
widthMultiplier: 1 widthMultiplier: 1
@ -23941,7 +23941,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1955078056} m_GameObject: {fileID: 1955078056}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0.7004391, y: -0.026122233, z: 0.025691757, w: 0.7127712} m_LocalRotation: {x: 0.70043856, y: -0.02613758, z: 0.025706843, w: 0.7127705}
m_LocalPosition: {x: 18.102207, y: 11.040333, z: -0.5004903} m_LocalPosition: {x: 18.102207, y: 11.040333, z: -0.5004903}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0

2
Assets/8_Scripts/1_Managers/NarrationManager.cs

@ -59,7 +59,7 @@ public class NarrationManager : MonoBehaviour
// Coroutine for subtitles, when to start the next one after a delay // Coroutine for subtitles, when to start the next one after a delay
IEnumerator SubtitleWait() IEnumerator SubtitleWait()
{ {
m_SubtitileWaitTime = Random.Range(12.5f, 20f); m_SubtitileWaitTime = Random.Range(12.5f, 15f);
yield return new WaitForSeconds(m_SubtitileWaitTime); yield return new WaitForSeconds(m_SubtitileWaitTime);
updateSubtitle(); updateSubtitle();
} }

12
Assets/8_Scripts/1_Managers/SubtitleManager.cs

@ -69,15 +69,21 @@ public class SubtitleManager : MonoBehaviour
private IEnumerator ClearText(float waitTime, bool earlyStop) private IEnumerator ClearText(float waitTime, bool earlyStop)
{ {
var offset = (waitTime - m_TimeElapsed) * Random.Range(0.6f, 0.95f); var offset = (waitTime - m_TimeElapsed) * Random.Range(0.6f, 0.95f);
Debug.Log($"{offset}");
if(offset < 3) if (offset > 12.5)
{
offset = 10f;
}
if(offset < 5)
{ {
offset = Random.Range(5f, 7f); offset = Random.Range(5f, 7f);
} }
float earlyOffset = 0; float earlyOffset = 0;
if (!earlyStop) if (earlyStop)
{ {
earlyOffset = offset / Random.Range(2, 4); earlyOffset = offset / Random.Range(2, 4);
offset -= earlyOffset; offset -= earlyOffset;
@ -96,7 +102,7 @@ public class SubtitleManager : MonoBehaviour
var index = 0; var index = 0;
bool earlyStop = false; bool earlyStop = false;
if (Random.Range(0f, 10f) > 6) earlyStop = true; // if (Random.Range(0f, 10f) > 6) earlyStop = true;
yield return new WaitForSecondsRealtime(0); yield return new WaitForSecondsRealtime(0);
//m_Text.text = sentence; //m_Text.text = sentence;

2
Assets/ML-Agents/Timers/DreconDemo_timers.json

@ -1 +1 @@
{"count":1,"self":38.09832,"total":39.2375366,"children":{"InitializeActuators":{"count":1,"self":0.0020179,"total":0.0020179,"children":null},"InitializeSensors":{"count":1,"self":0.0010100999999999999,"total":0.0010100999999999999,"children":null},"AgentSendState":{"count":1678,"self":0.0180985,"total":0.3629754,"children":{"CollectObservations":{"count":839,"self":0.33179549999999997,"total":0.33179549999999997,"children":null},"WriteActionMask":{"count":839,"self":0.0025271,"total":0.0025271,"children":null},"RequestDecision":{"count":839,"self":0.010554299999999999,"total":0.010554299999999999,"children":null}}},"DecideAction":{"count":1678,"self":0.5290937,"total":0.5290937,"children":null},"AgentAct":{"count":1678,"self":0.2441185,"total":0.2441185,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1716560328","unity_version":"2022.3.5f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.5f1\\Editor\\Unity.exe -projectpath C:\\Users\\caile\\Desktop\\drecon-unity -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-cail -hubSessionId a69371f4-0960-4729-b332-479a1ce08ab9 -accessToken pKmnHonOnh58WQKETDbb5XyoRSm1WSZuAFXu3x_2IC4005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"DreconDemo","end_time_seconds":"1716560367"}} {"count":1,"self":106.9990784,"total":111.6277465,"children":{"InitializeActuators":{"count":1,"self":0.0015103999999999999,"total":0.0015103999999999999,"children":null},"InitializeSensors":{"count":1,"self":0.001504,"total":0.001504,"children":null},"AgentSendState":{"count":6260,"self":0.0705701,"total":1.4536989,"children":{"CollectObservations":{"count":3130,"self":1.3518491,"total":1.3518491,"children":null},"WriteActionMask":{"count":3130,"self":0.0090594,"total":0.0090594,"children":null},"RequestDecision":{"count":3130,"self":0.0222203,"total":0.0222203,"children":null}}},"DecideAction":{"count":6260,"self":2.0805523999999997,"total":2.0805523,"children":null},"AgentAct":{"count":6260,"self":1.0903937,"total":1.0903937,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1716563152","unity_version":"2022.3.5f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.5f1\\Editor\\Unity.exe -projectpath C:\\Users\\caile\\Desktop\\drecon-unity -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-cail -hubSessionId a69371f4-0960-4729-b332-479a1ce08ab9 -accessToken uBPxxTOwOoFohWcnNcaFeSEyb3Y6A6Ae3NiYS44vXDY005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"DreconDemo","end_time_seconds":"1716563263"}}
Loading…
Cancel
Save