Exemple #1
0
        public void StartDrag(GameObject gameObject, Transform mouthpiece)
        {
            LineRenderer line   = gameObject.GetComponent <LineRenderer>();
            GameObject   target = CurveManager.GetObjectFromCurve(gameObject);
            AnimationSet anim   = GlobalState.Animation.GetObjectAnimation(target);
            int          frame  = GetFrameFromPoint(line, mouthpiece.position, anim);

            if (target.TryGetComponent <RigGoalController>(out RigGoalController controller))
            {
                //temporary solution for hips joint
                if (target.name.Contains("Hips"))
                {
                    curveManip = new CurveManipulation(target, frame, mouthpiece, CurveMode, zoneSize, (double)tanCont);
                }
                else
                {
                    curveManip = new CurveManipulation(target, controller, frame, mouthpiece, CurveMode, zoneSize, (double)tanCont);
                }
            }
            else
            {
                curveManip = new CurveManipulation(target, frame, mouthpiece, CurveMode, zoneSize, (double)tanCont);
            }
        }
Exemple #2
0
 public void ReleaseCurve()
 {
     curveManip.ReleaseCurve();
     curveManip = null;
 }