Re: Portrait animator skipping first frame
Posted: Fri Nov 05, 2021 12:45 pm
Here's what I ended up reverting:
After I reverted, the single frame issue went away again. LateUpdate happens after animation so I think it makes sense that this would be an issue.
Code: Select all
diff --git a/Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Sequencer/Sequencer.cs b/Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Sequencer/Sequencer.cs
index 945ea8510..9a53a64dd 100644
--- a/Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Sequencer/Sequencer.cs
+++ b/Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Sequencer/Sequencer.cs
@@ -569,18 +569,18 @@ namespace PixelCrushers.DialogueSystem
break;
}
}
- }
- }
-
- public void LateUpdate()
- {
- if (m_isPlaying)
- {
- foreach (string message in queuedMessages)
- {
- Sequencer.Message(message);
- }
- queuedMessages.Clear();
+ // }
+ // }
+
+ // public void LateUpdate()
+ // {
+ // if (m_isPlaying)
+ // {
+ // foreach (string message in queuedMessages)
+ // {
+ // Sequencer.Message(message);
+ // }
+ // queuedMessages.Clear();
if ((m_queuedCommands.Count == 0) && (m_activeCommands.Count == 0) && m_delayTimeLeft <= 0)
{
FinishSequence();
@@ -972,14 +972,14 @@ namespace PixelCrushers.DialogueSystem
bool ignore = (e is InvalidOperationException || e is ArgumentOutOfRangeException);
if (!ignore) throw;
}
- finally
- {
- if (receivedMessage != null) receivedMessage(message);
- }
+ // finally
+ // {
+ // if (receivedMessage != null) receivedMessage(message);
+ // }
}
- // Processed in LateUpdate():
- private List<string> queuedMessages = new List<string>();
+ // // Processed in LateUpdate():
+ // private List<string> queuedMessages = new List<string>();
private void CheckActiveCommands()
{
@@ -992,11 +992,12 @@ namespace PixelCrushers.DialogueSystem
var command = m_activeCommands[i];
if (command != null && !command.isPlaying)
{
- if (!string.IsNullOrEmpty(command.endMessage))
- {
- //--- Now queued for LateUpdate: Sequencer.Message(command.endMessage);
- queuedMessages.Add(command.endMessage);
- }
+ if (!string.IsNullOrEmpty(command.endMessage)) Sequencer.Message(command.endMessage);
+ // if (!string.IsNullOrEmpty(command.endMessage))
+ // {
+ // //--- Now queued for LateUpdate: Sequencer.Message(command.endMessage);
+ // queuedMessages.Add(command.endMessage);
+ // }
m_commandsToDelete.Add(command);
}
}
After I reverted, the single frame issue went away again. LateUpdate happens after animation so I think it makes sense that this would be an issue.