//Events
        private void OnNewAnimationClip(EditableAnimationClip clip)
        {
            if (clip == null)
            {
                return;
            }

            Debug.Log("OnNewAnimationClip! " + clip.Name);

            //set gui values
            if (textBoxValues.ContainsKey("DurationNumberSelector"))
            {
                textBoxValues ["DurationNumberSelector"] = clip.Duration.ToString("####0.0##");
            }
            else
            {
                textBoxValues.Add("DurationNumberSelector", clip.Duration.ToString("####0.0##"));
            }
            if (textBoxValues.ContainsKey("LayerNumberSelector"))
            {
                textBoxValues ["LayerNumberSelector"] = clip.Layer.ToString("####0");
            }
            else
            {
                textBoxValues.Add("LayerNumberSelector", clip.Layer.ToString("####0"));
            }
        }
        public void EnableAnimationSuite()
        {
            var vessel = FlightGlobals.ActiveVessel;

            if (vessel.evaController == null)
            {
                ScreenMessages.PostScreenMessage(new ScreenMessage("<color=" + Colors.DefaultMessageColor + ">Active vessel must be an EVA to use the Animation Suite</color>", 3f, ScreenMessageStyle.UPPER_CENTER));

                //set the button back to false
                toolbarControl.SetFalse(false);
                return;
            }

            Kerbal        = new SelectedKerbalEVA(vessel.evaController);
            AnimationClip = new EditableAnimationClip(Kerbal);

            if (!Kerbal.EnterAnimationMode())
            {
                //wipe the state
                Kerbal        = null;
                AnimationClip = null;
                CurrentBone   = null;

                //set the button back to false if it failed
                toolbarControl.SetFalse(false);
                return;
            }

            MusicIsPlaying = true;
        }
Example #3
0
        //Events
        private void OnNewAnimationClip(EditableAnimationClip clip)
        {
            if (clip != null)
            {
                //set defaults
                clip.WrapMode = WrapMode.ClampForever;

                UpdateAnimationClip();
            }
        }
        //Events
        private void OnNewAnimationClip(EditableAnimationClip clip)
        {
            if (clip != null)
            {
                //set defaults
                clip.WrapMode = WrapMode.ClampForever;

                UpdateAnimationClip ();
            }
        }
        public void EnableAnimationSuite()
        {
            var vessel = FlightGlobals.ActiveVessel;
            if (vessel.evaController == null)
            {
                ScreenMessages.PostScreenMessage (new ScreenMessage ("<color=" + Colors.DefaultMessageColor + ">Active vessel must be an EVA to use the Animation Suite</color>", 3f, ScreenMessageStyle.UPPER_CENTER));

                //set the button back to false
                Button.SetFalse (false);
                return;
            }

            Kerbal = new SelectedKerbalEVA (vessel.evaController);
            AnimationClip = new EditableAnimationClip (Kerbal);

            if (!Kerbal.EnterAnimationMode ())
            {
                //wipe the state
                Kerbal = null;
                AnimationClip = null;
                CurrentBone = null;

                //set the button back to false if it failed
                Button.SetFalse (false);
                return;
            }

            MusicIsPlaying = true;
        }
        //Events
        private void OnNewAnimationClip(EditableAnimationClip clip)
        {
            if (clip == null)
                return;

            Debug.Log ("OnNewAnimationClip! " + clip.Name);

            //set gui values
            if (textBoxValues.ContainsKey ("DurationNumberSelector"))
                textBoxValues ["DurationNumberSelector"] = clip.Duration.ToString ("####0.0##");
            else
                textBoxValues.Add ("DurationNumberSelector", clip.Duration.ToString ("####0.0##"));
            if (textBoxValues.ContainsKey ("LayerNumberSelector"))
                textBoxValues ["LayerNumberSelector"] = clip.Layer.ToString ("####0");
            else
                textBoxValues.Add ("LayerNumberSelector", clip.Layer.ToString ("####0"));
        }