示例#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);
 }
示例#2
0
文件: Speech.cs 项目: IJkeB/Ekster1
 public Sprite GetPortraitSprite()
 {
     if (speaker && speaker.portraitIcon.texture)
     {
         if (IsAnimating())
         {
             if (speaker.isLipSyncing)
             {
                 return(speaker.portraitIcon.GetAnimatedSprite(speaker.GetLipSyncFrame()));
             }
             else
             {
                 return(speaker.portraitIcon.GetAnimatedSprite(true));
             }
         }
         else
         {
             return(speaker.portraitIcon.GetSprite());
         }
     }
     return(null);
 }