Example #1
0
 /**
  * <summary>Gets a Sprite based on the portrait graphic of the speaking character.
  * If lipsincing is enabled, the sprite will be based on the current phoneme.</summary>
  * <returns>The speaking character's portrait sprite</returns>
  */
 public UnityEngine.Sprite GetPortraitSprite()
 {
     if (speaker != null)
     {
         CursorIconBase portraitIcon = speaker.GetPortrait();
         if (portraitIcon != null && portraitIcon.texture != null)
         {
             if (IsAnimating())
             {
                 if (speaker.isLipSyncing)
                 {
                     return(portraitIcon.GetAnimatedSprite(speaker.GetLipSyncFrame()));
                 }
                 else
                 {
                     portraitIcon.GetAnimatedRect();
                     return(portraitIcon.GetAnimatedSprite(true));
                 }
             }
             else
             {
                 return(portraitIcon.GetSprite());
             }
         }
     }
     return(null);
 }
 private void SetUIGraphic()
 {
     if (uiImageType == UIImageType.Image && uiImage != null)
     {
         if (graphicType == AC_GraphicType.Normal)
         {
             uiImage.sprite = graphic.GetAnimatedSprite(true);
         }
         else if (speech != null)
         {
             uiImage.sprite = speech.GetPortraitSprite();
         }
         UpdateUIElement(uiImage);
     }
     if (uiImageType == UIImageType.RawImage && uiRawImage != null)
     {
         if (graphicType == AC_GraphicType.Normal)
         {
             if (graphic.texture != null && graphic.texture is RenderTexture)
             {
                 uiRawImage.texture = graphic.texture;
             }
             else
             {
                 uiRawImage.texture = graphic.GetAnimatedTexture(true);
             }
         }
         else if (speech != null)
         {
             uiRawImage.texture = speech.GetPortrait();
         }
         UpdateUIElement(uiRawImage);
     }
 }
Example #3
0
        public override void PreDisplay(int _slot, int languageNumber, bool isActive)
        {
            if (graphicType == AC_GraphicType.DialoguePortrait)
            {
                UpdateSpeechLink();
                if (speech != null)
                {
                    speechTex         = speech.GetPortrait();
                    speechIsAnimating = speech.IsAnimating();
                }
            }

            if (uiImage != null)
            {
                if (graphicType == AC_GraphicType.Normal)
                {
                    uiImage.sprite = graphic.GetAnimatedSprite(true);
                }
                else if (speech != null)
                {
                    uiImage.sprite = speech.GetPortraitSprite();
                }
                UpdateUIElement(uiImage);
            }
        }
Example #4
0
        private void SetUIGraphic()
        {
            if (uiImageType == UIImageType.Image && uiImage != null)
            {
                switch (graphicType)
                {
                case AC_GraphicType.Normal:
                    uiImage.sprite = graphic.GetAnimatedSprite(true);
                    break;

                case AC_GraphicType.DialoguePortrait:
                    if (speech != null)
                    {
                        uiImage.sprite = speech.GetPortraitSprite();
                    }
                    break;

                case AC_GraphicType.DocumentTexture:
                case AC_GraphicType.ObjectiveTexture:
                    uiImage.sprite = sprite;
                    break;

                default:
                    break;
                }
                UpdateUIElement(uiImage);
            }
            if (uiImageType == UIImageType.RawImage && uiRawImage != null)
            {
                switch (graphicType)
                {
                case AC_GraphicType.Normal:
                    if (graphic.texture != null && graphic.texture is RenderTexture)
                    {
                        uiRawImage.texture = graphic.texture;
                    }
                    else
                    {
                        uiRawImage.texture = graphic.GetAnimatedTexture(true);
                    }
                    break;

                case AC_GraphicType.DocumentTexture:
                case AC_GraphicType.ObjectiveTexture:
                    uiRawImage.texture = localTexture;
                    break;

                case AC_GraphicType.DialoguePortrait:
                    if (speech != null)
                    {
                        uiRawImage.texture = speech.GetPortrait();
                    }
                    break;
                }
                UpdateUIElement(uiRawImage);
            }
        }
Example #5
0
 private void SetUIGraphic()
 {
     if (uiImage != null)
     {
         if (graphicType == AC_GraphicType.Normal)
         {
             uiImage.sprite = graphic.GetAnimatedSprite(true);
         }
         else if (speech != null)
         {
             uiImage.sprite = speech.GetPortraitSprite();
         }
         UpdateUIElement(uiImage);
     }
 }