Get current portrait animator reference?
-
- Posts: 222
- Joined: Wed Jan 22, 2020 10:48 pm
Get current portrait animator reference?
Is there an easy way to get the current portrait animator reference? Our game has portrait animators that'll be playing different facial animations based on the volume output from the voice channel.
Re: Get current portrait animator reference?
Hi,
If you know the subtitle panel, you can get the Animator component on the Portrait Image.
If you don't know the subtitle panel but you can a reference to a Subtitle object, you can use GetPanel:
If you know the subtitle panel, you can get the Animator component on the Portrait Image.
If you don't know the subtitle panel but you can a reference to a Subtitle object, you can use GetPanel:
Code: Select all
DialogueActor currentSpeakerDialogueActor;
var currentSubtitle = DialogueManager.currentConversationState.subtitle;
var ui = DialogueManager.dialogueUI as StandardDialogueUI;
var panel = ui.conversationUIElements.standardSubtitleControls.GetPanel(subtitle, out currentSpeakerDialogueActor);
var portraitAnimator = panel.portraitImage.GetComponent<Animator>();
-
- Posts: 222
- Joined: Wed Jan 22, 2020 10:48 pm
Re: Get current portrait animator reference?
Oh gosh, i'm being stupid. Thanks very much!
Re: Get current portrait animator reference?
Glad to help!