예제 #1
0
 /**
  * <summary>Stops the FaceFX animation on a character.</summary>
  * <param name = "speaker">The speaking character</param>
  */
 public static void Stop(AC.Char speaker)
 {
                 #if FaceFXIsPresent
     FaceFXControllerScript_Base fcs = speaker.GetComponent <FaceFXControllerScript_Base>();
     if (fcs == null)
     {
         fcs = speaker.GetComponentInChildren <FaceFXControllerScript_Base>();
     }
     if (fcs != null)
     {
         fcs.StopAnim();
     }
     else
     {
         ACDebug.LogWarning("No FaceFXControllerScript_Base script found on " + speaker.gameObject.name);
     }
                 #else
     ACDebug.LogWarning("The 'FaceFXIsPresent' preprocessor define must be declared in the Player Settings.");
                 #endif
 }
예제 #2
0
 public static void Play(AC.Char speaker, string name, AudioClip audioClip)
 {
                 #if FaceFXIsPresent
     FaceFXControllerScript_Base fcs = speaker.GetComponent <FaceFXControllerScript_Base>();
     if (fcs == null)
     {
         fcs = speaker.GetComponentInChildren <FaceFXControllerScript_Base>();
     }
     if (fcs != null)
     {
         speaker.isLipSyncing = true;
         fcs.PlayAnim("Default_" + name, audioClip);
     }
     else
     {
         Debug.LogError("No FaceFXControllerScript_Base script found on " + speaker.gameObject.name);
     }
                 #else
     Debug.LogError("The 'FaceFXIsPresent' preprocessor define must be declared in the Player Settings.");
                 #endif
 }