public void SetActorPortraitTexture(string actorName, Texture2D portraitTexture)
 {
     if (portraitImage == null)
     {
         return;
     }
     portraitImage.sprite = UITools.CreateSprite(AbstractDialogueUI.GetValidPortraitTexture(actorName, portraitTexture));
 }
 /// <summary>
 /// Sets the portrait sprite to use in the subtitle if the named actor is the speaker.
 /// This is used to immediately update the GUI control if the SetPortrait() sequencer
 /// command changes the portrait sprite.
 /// </summary>
 /// <param name="actorName">Actor name in database.</param>
 /// <param name="portraitSprite">Portrait sprite.</param>
 public override void SetActorPortraitSprite(string actorName, Sprite portraitSprite)
 {
     if ((currentSubtitle != null) && string.Equals(currentSubtitle.speakerInfo.nameInDatabase, actorName))
     {
         if (portraitImage != null)
         {
             portraitImage.sprite = AbstractDialogueUI.GetValidPortraitSprite(actorName, portraitSprite);
         }
     }
 }
 /// <summary>
 /// Sets the portrait texture to use in the subtitle if the named actor is the speaker.
 /// This is used to immediately update the GUI control if the SetPortrait() sequencer
 /// command changes the portrait texture.
 /// </summary>
 /// <param name="actorName">Actor name in database.</param>
 /// <param name="portraitTexture">Portrait texture.</param>
 public override void SetActorPortraitTexture(string actorName, Texture2D portraitTexture)
 {
     if ((currentSubtitle != null) && string.Equals(currentSubtitle.speakerInfo.nameInDatabase, actorName))
     {
         if (portraitImage != null)
         {
             portraitImage.sprite = UITools.CreateSprite(AbstractDialogueUI.GetValidPortraitTexture(actorName, portraitTexture));                                         //---Was: .texture = AbstractDialogueUI.GetValidPortraitTexture(actorName, portraitTexture);
         }
     }
 }
        /// <summary>
        /// Sets the portrait texture to use in the UI for an actor.
        /// This is used when the SetPortrait() sequencer command changes an actor's image.
        /// </summary>
        /// <param name="actorName">Actor name.</param>
        /// <param name="portraitTexture">Portrait texture.</param>
        public void SetActorPortraitTexture(string actorName, Texture2D portraitTexture)
        {
            AbstractDialogueUI ui = DialogueManager.DialogueUI as AbstractDialogueUI;

            if (ui == null)
            {
                return;
            }
            ui.SetActorPortraitTexture(actorName, portraitTexture);
        }
        /// <summary>
        /// Sets the PC portrait to use for the response menu.
        /// </summary>
        /// <param name="pcTexture">PC texture.</param>
        /// <param name="pcName">PC name.</param>
        public void SetPCPortrait(Texture2D pcTexture, string pcName)
        {
            AbstractDialogueUI ui = DialogueManager.DialogueUI as AbstractDialogueUI;

            if (ui == null)
            {
                return;
            }
            ui.SetPCPortrait(pcTexture, pcName);
        }
        public virtual void SetActorPortraitSprite(string actorName, Sprite portraitSprite)
        {
            if (portraitImage == null)
            {
                return;
            }
            var sprite = AbstractDialogueUI.GetValidPortraitSprite(actorName, portraitSprite);

            portraitImage.sprite = sprite;
            Tools.SetGameObjectActive(portraitImage, sprite != null);
        }
Beispiel #7
0
 /// <summary>
 /// Sets the portrait texture to use in the response menu if the named actor is the player.
 /// This is used to immediately update the GUI control if the SetPortrait() sequencer
 /// command changes the portrait texture.
 /// </summary>
 /// <param name="actorName">Actor name in database.</param>
 /// <param name="portraitTexture">Portrait texture.</param>
 public override void SetActorPortraitTexture(string actorName, Texture2D portraitTexture)
 {
     if (string.Equals(actorName, pcPortraitName))
     {
         Texture2D actorPortraitTexture = AbstractDialogueUI.GetValidPortraitTexture(actorName, portraitTexture);
         pcPortraitTexture = actorPortraitTexture;
         if ((pcImage != null) && (DialogueManager.MasterDatabase.IsPlayer(actorName)))
         {
             pcImage.sprite = UITools.CreateSprite(actorPortraitTexture);
         }
     }
 }
 /// <summary>
 /// Sets the portrait sprite to use in the response menu if the named actor is the player.
 /// This is used to immediately update the GUI control if the SetPortrait() sequencer
 /// command changes the portrait sprite.
 /// </summary>
 /// <param name="actorName">Actor name in database.</param>
 /// <param name="portraitSprite">Portrait sprite.</param>
 public override void SetActorPortraitSprite(string actorName, Sprite portraitSprite)
 {
     if (string.Equals(actorName, m_pcPortraitName))
     {
         var actorPortraitSprite = AbstractDialogueUI.GetValidPortraitSprite(actorName, portraitSprite);
         m_pcPortraitSprite = portraitSprite;
         if (m_currentPanel != null && m_currentPanel.pcImage != null && DialogueManager.masterDatabase.IsPlayer(actorName))
         {
             m_currentPanel.pcImage.sprite = actorPortraitSprite;
         }
     }
 }
Beispiel #9
0
 /// <summary>
 /// Sets the portrait texture to use in the response menu if the named actor is the player.
 /// This is used to immediately update the GUI control if the SetPortrait() sequencer
 /// command changes the portrait texture.
 /// </summary>
 /// <param name="actorName">Actor name in database.</param>
 /// <param name="portraitTexture">Portrait texture.</param>
 public override void SetActorPortraitTexture(string actorName, Texture2D portraitTexture)
 {
     if (string.Equals(actorName, m_pcPortraitName))
     {
         Texture2D actorPortraitTexture = AbstractDialogueUI.GetValidPortraitTexture(actorName, portraitTexture);
         m_pcPortraitTexture = actorPortraitTexture;
         if (m_currentPanel != null && m_currentPanel.pcImage != null && DialogueManager.masterDatabase.IsPlayer(actorName))
         {
             m_currentPanel.pcImage.sprite = UITools.CreateSprite(actorPortraitTexture);
         }
     }
 }
 /// <summary>
 /// Sets the Portrait sprite to use in the response menu if the named actor is the player.
 /// This is used to immediately update the GUI control if the SetPortrait() sequencer
 /// command changes the Portrait sprite.
 /// </summary>
 /// <param name="actorName">Actor name in database.</param>
 /// <param name="portraitSprite">Portrait sprite.</param>
 public override void SetActorPortraitSprite(string actorName, Sprite portraitSprite)
 {
     if (string.Equals(actorName, pcPortraitName))
     {
         var actorPortraitSprite = AbstractDialogueUI.GetValidPortraitSprite(actorName, portraitSprite);
         pcPortraitSprite = actorPortraitSprite;
         if ((pcImage != null) && (DialogueManager.masterDatabase.IsPlayer(actorName)))
         {
             pcImage.sprite = actorPortraitSprite;
         }
     }
 }
Beispiel #11
0
 /// <summary>
 /// Sends "OnTextChange(text)" to the dialogue UI GameObject.
 /// </summary>
 public static void SendTextChangeMessage(UnityEngine.UI.Text text)
 {
     if (text == null)
     {
         return;
     }
     if (dialogueUI == null)
     {
         dialogueUI = text.GetComponentInParent <AbstractDialogueUI>();
     }
     if (dialogueUI == null)
     {
         return;
     }
     dialogueUI.SendMessage(DialogueSystemMessages.OnTextChange, text, SendMessageOptions.DontRequireReceiver);
 }
Beispiel #12
0
 private void Awake()
 {
     dialogueUI = GetComponent <AbstractDialogueUI>() ?? FindObjectOfType <AbstractDialogueUI>();
 }