예제 #1
0
 public void NowEditingPuppet(ComboGesturePuppet selectedPuppet)
 {
     _state.CurrentlyEditing = CurrentlyEditing.Puppet;
     _state.Activity         = null;
     _state.Puppet           = selectedPuppet;
     _state.SerializedObject = new SerializedObject(_state.Puppet);
     _state.ActivityAccessor = new CgePuppetAccessor(_state.Puppet);
 }
        public static List <AnimationClip> AllDistinctAnimations(ComboGesturePuppet cgp)
        {
            if (cgp.mainTree == null)
            {
                return(new List <AnimationClip>());
            }

            return(AllAnimationsOf((BlendTree)cgp.mainTree));
        }
예제 #3
0
        public void RetargetPuppet(ComboGesturePuppet puppet)
        {
            _editorEffector.NowEditingPuppet(puppet);
            if (!_editorEffector.IsPreviewSetupValid())
            {
                _editorEffector.SwitchTo(PuppetEditorMode.OtherOptions);
                _editorEffector.MarkFirstTimeSetup();
            }

            _window.titleContent = new GUIContent("CGE/" + puppet.name);
        }
        public static IManifest FromPuppet(ComboGesturePuppet puppet)
        {
            var animations     = AllDistinctAnimations(puppet);
            var qualifications = animations.Select(clip => new QualifiedAnimation(
                                                       clip,
                                                       new Qualification(
                                                           puppet.blinking.Contains(clip),
                                                           LimitedLipsyncHasWideOpenMouth(puppet, clip)
                            ? QualifiedLimitation.Wide
                            : QualifiedLimitation.None
                                                           )))
                                 .Distinct()
                                 .ToList();

            return(new PuppetManifest(
                       puppet.transitionDuration,
                       PuppetAnimatedBehavior.Of((BlendTree)puppet.mainTree, qualifications)
                       ));
        }
예제 #5
0
 public void ShowPuppet(ComboGesturePuppet puppet)
 {
     RetargetPuppet(puppet);
     _window.Show();
 }
 private static bool LimitedLipsyncHasWideOpenMouth(ComboGesturePuppet puppet, AnimationClip clip)
 {
     return(puppet.limitedLipsync.Contains(new ComboGestureActivity.LimitedLipsyncAnimation {
         clip = clip, limitation = ComboGestureActivity.LipsyncLimitation.WideOpenMouth
     }));
 }
예제 #7
0
 public CgePuppetAccessor(ComboGesturePuppet puppet)
 {
     _puppet = puppet;
 }