Exemple #1
0
    // Use this for initialization
    void Start()
    {
        mirai         = GameObject.Find("mirai2019_dance");
        miraiAnimator = mirai.GetComponent <Animator>();
        handler       = new HumanPoseHandler(miraiAnimator.avatar, miraiAnimator.transform);
        handler.GetHumanPose(ref miraiPose);
        initZeroPose();
        initUpRightPose();
        musclesStatus();

        angleSlider        = GameObject.Find("Slider");
        angleControlScript = angleSlider.GetComponent <AngleControl>();

        anim = GetComponent <Animator>();
        //Get them_Animator, which you attach to the GameObject you intend to animate.
        m_Animator = gameObject.GetComponent <Animator>();
        //Fetch the current Animation clip information for the base layer
        m_CurrentClipInfo = this.m_Animator.GetCurrentAnimatorClipInfo(0);
        //Access the current length of the clip
        m_CurrentClipLength = m_CurrentClipInfo[0].clip.length;
        //Access the Animation clip name
        m_ClipName = m_CurrentClipInfo[0].clip.name;
        print(m_CurrentClipLength);
        timer = (1 / m_CurrentClipLength) / 60;
    }
Exemple #2
0
        /// <inheritdoc/>
        public override object EditValue(ITypeDescriptorContext context,
                                         IServiceProvider provider, object Value)
        {
            edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            AngleControl rc = new AngleControl();

            rc.ShowBorder = false;
            rc.Angle      = (int)Value;
            edSvc.DropDownControl(rc);
            return(rc.Angle);
        }
Exemple #3
0
        /// <inheritdoc/>
        protected override float EditValue(float value, IWindowsFormsEditorService editorService)
        {
            #region Sanity checks
            if (editorService == null)
            {
                throw new ArgumentNullException(nameof(editorService));
            }
            #endregion

            var angleControl = new AngleControl {
                Angle = value
            };
            editorService.DropDownControl(angleControl);
            return(angleControl.Angle);
        }
Exemple #4
0
    void Start()
    {
        AngleControlScript    = GetComponent <AngleControl>();
        ScoreMultiplierScript = GetComponent <ScoreMultiplier>();
        ExplosionsScript      = GetComponent <Explosions>();

        rbBalloon = GetComponent <Rigidbody2D>();

        balloonAnimator         = Top.GetComponent <Animator>();
        basketAnimator          = Bottom.GetComponent <Animator>();
        balloonAnimator.enabled = false;
        basketAnimator.enabled  = false;

        freezeObject(true);  // stabilize the balloon
    }
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService edSvc =
                (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            if (edSvc == null)
            {
                return(value);
            }

            using (AngleControl control = new AngleControl((float)value))
            {
                edSvc.DropDownControl(control);
                return((float)control.Angle);
            }
        }
        /// <summary>
        /// Edits the specified object's value using the editor style indicated by the <see cref="M:System.Drawing.Design.UITypeEditor.GetEditStyle"/> method.
        /// </summary>
        /// <param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext"/> that can be used to gain additional context information.</param>
        /// <param name="provider">An <see cref="T:System.IServiceProvider"/> that this editor can use to obtain services.</param>
        /// <param name="value">The object to edit.</param>
        /// <returns>
        /// The new value of the object. If the value of the object has not changed, this should return the same object it was passed.
        /// </returns>
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (value.GetType() != typeof(float))
                return value;

            var editorService = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;

            if (editorService != null)
            {
                float angleDegrees = MathHelper.ToDegrees((float)value);

                AngleControl control = new AngleControl(angleDegrees);

                editorService.DropDownControl(control);

                float angleRadians = MathHelper.ToRadians(control.Angle);

                return angleRadians;
            }

            return value;
        }
Exemple #7
0
        /// <summary>
        /// Edits the specified object's value using the editor style indicated by the <see cref="M:System.Drawing.Design.UITypeEditor.GetEditStyle"/> method.
        /// </summary>
        /// <param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext"/> that can be used to gain additional context information.</param>
        /// <param name="provider">An <see cref="T:System.IServiceProvider"/> that this editor can use to obtain services.</param>
        /// <param name="value">The object to edit.</param>
        /// <returns>
        /// The new value of the object. If the value of the object has not changed, this should return the same object it was passed.
        /// </returns>
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (value.GetType() != typeof(float))
            {
                return(value);
            }

            var editorService = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;

            if (editorService != null)
            {
                float angleDegrees = MathHelper.ToDegrees((float)value);

                AngleControl control = new AngleControl(angleDegrees);

                editorService.DropDownControl(control);

                float angleRadians = MathHelper.ToRadians(control.Angle);

                return(angleRadians);
            }

            return(value);
        }
 private void AnglesChanged(object sender, AngleControl.AngleChangedEventArgs e)
 {
     if (_populating) return;
     PropertyValueChanged(sender, "angles", Angles.GetAnglePropertyString());
     if (KeyValuesList.SelectedIndices.Count > 0
         && ((string) KeyValuesList.SelectedItems[0].Tag) == "angles"
         && SmartEditControlPanel.Controls.Count > 0
         && SmartEditControlPanel.Controls[0] is SmartEditControl)
     {
         ((SmartEditControl) SmartEditControlPanel.Controls[0]).SetProperty("angles", "angles", Angles.GetAnglePropertyString(), null);
     }
 }