Esempio n. 1
0
    void SetupBoneRig(Transform jawBone, Transform head)
    {
        LipsyncTemplate   template   = Resources.Load <LipsyncTemplate>(JawTemplate);
        LipsyncController controller = SetupController(template, MainObject.AddComponent <LipsyncController>());
        AudioSource       source     = head.GetComponent <AudioSource>();

        if (source == null)
        {
            source = head.gameObject.AddComponent <AudioSource>();
            source.spatialBlend = 1.0f;
        }
        controller.mouthSource = source;
        controller.mouth       = jawBone.gameObject;
    }
Esempio n. 2
0
    void SetupBlendshapeRig(SkinnedMeshRenderer smr, string shapeID, Transform head)
    {
        LipsyncTemplate   template   = Resources.Load <LipsyncTemplate>(ShapeTemplate);
        LipsyncController controller = SetupController(template, MainObject.AddComponent <LipsyncController>());
        AudioSource       source     = head.GetComponent <AudioSource>();

        if (source == null)
        {
            source = head.gameObject.AddComponent <AudioSource>();
            source.spatialBlend = 1.0f;
        }
        controller.mouthSource         = source;
        controller.skinnedMeshRenderer = smr;
        controller.shapeName           = shapeID;
    }
Esempio n. 3
0
 LipsyncController SetupController(LipsyncTemplate template, LipsyncController controller)
 {
     controller.analysisType   = template.analysisType;
     controller.syncType       = template.syncType;
     controller.mouthAxis      = template.mouthAxis;
     controller.mouthRotAxis   = template.mouthRotAxis;
     controller.volByDistance  = template.volByDistance;
     controller.volume         = template.volume;
     controller.rotVolume      = template.rotVolume;
     controller.minVol         = template.minVol;
     controller.maxVol         = template.maxVol;
     controller.frqHigh        = template.frqHigh;
     controller.frqLow         = template.frqLow;
     controller.ignoreDistance = template.ignoreDistance;
     return(controller);
 }
Esempio n. 4
0
 LipsyncController SetupController(LipsyncTemplate template, LipsyncController controller)
 {
     if (template == null)
     {
         template          = CreateInstance <LipsyncTemplate>();
         template.syncType = syncType;
     }
     controller.mode           = syncMode;
     controller.analysisType   = template.analysisType;
     controller.syncType       = template.syncType;
     controller.mouthAxis      = template.mouthAxis;
     controller.mouthRotAxis   = template.mouthRotAxis;
     controller.volByDistance  = template.volByDistance;
     controller.volume         = template.volume;
     controller.rotVolume      = template.rotVolume;
     controller.minVol         = template.minVol;
     controller.maxVol         = template.maxVol;
     controller.frqHigh        = template.frqHigh;
     controller.frqLow         = template.frqLow;
     controller.ignoreDistance = template.ignoreDistance;
     return(controller);
 }
Esempio n. 5
0
 void Awake()
 {
     lipsycController = GetComponent <LipsyncController>();
     originalForward  = transform.forward;
 }