Ejemplo n.º 1
0
 public void EditConstraintValue(ValueConstraint constraint)
 {
     valueConstraint = constraint;
     input.gameObject.SetActive(true);
     input.text = Math.Abs(valueConstraint.GetValue()).ToStr();
     input.Select();
     UpdateInputPosition();
 }
Ejemplo n.º 2
0
 public void EditConstraintValue(ValueConstraint constraint, bool pushUndo = true)
 {
     valueConstraint     = constraint;
     this.shouldPushUndo = pushUndo;
     input.gameObject.SetActive(true);
     input.text = Math.Abs(valueConstraint.GetValue()).ToStr();
     input.Select();
     UpdateInputPosition();
 }
Ejemplo n.º 3
0
    void OnEndEdit(string value)
    {
        if (valueConstraint == null)
        {
            return;
        }
        var sign = Math.Sign(valueConstraint.GetValue());

        valueConstraint.SetValue(sign * value.ToDouble());
        valueConstraint = null;
        input.gameObject.SetActive(false);
    }
Ejemplo n.º 4
0
    void OnEndEdit(string value)
    {
        if (valueConstraint == null)
        {
            return;
        }
        var sign = Math.Sign(valueConstraint.GetValue());

        if (sign == 0)
        {
            sign = 1;
        }
        if (shouldPushUndo)
        {
            editor.PushUndo();
        }
        valueConstraint.SetValue(sign * value.ToDouble());
        valueConstraint = null;
        input.gameObject.SetActive(false);
    }