Skip to content

Commit

Permalink
CORE-2425 character will not reset after too far away.
Browse files Browse the repository at this point in the history
  • Loading branch information
Juniverse committed Mar 31, 2023
1 parent e26f3a2 commit ce3fe15
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ void OnEnable()
InworldController.Instance.OnCharacterChanged += OnCharacterChanged;
InworldController.Instance.OnStateChanged += OnStatusChanged;
InworldController.Instance.OnPacketReceived += OnPacketEvents;
Animator.enabled = false;
if (!Character)
return;
Character.OnBeginSpeaking.AddListener(OnAudioStarted);
Expand All @@ -170,6 +171,7 @@ void OnDisable()
InworldController.Instance.OnStateChanged -= OnStatusChanged;
InworldController.Instance.OnPacketReceived -= OnPacketEvents;
}
Animator.enabled = false;
if (!Character)
return;
Character.OnBeginSpeaking.RemoveListener(OnAudioStarted);
Expand All @@ -183,9 +185,11 @@ void OnCharacterChanged(InworldCharacter oldCharacter, InworldCharacter newChara
if (oldCharacter == Character)
{
HandleMainStatus(AnimMainStatus.Goodbye);
Animator.enabled = false;
}
else if (newCharacter == Character)
{
Animator.enabled = false;
HandleMainStatus(AnimMainStatus.Hello);
}
}
Expand Down

0 comments on commit ce3fe15

Please sign in to comment.