コード例 #1
0
    public void PlayMotor()
    {
        int id    = UnityEngine.Random.Range(3, 8);
        int range = UnityEngine.Random.Range(-30, 30);

        Mibo.setMotorPositionInDegree(id, range, 10);
    }
コード例 #2
0
    public void OnPlayMotorButtonClick()
    {
        Debug.LogWarning(SelectDropdown.value);
        string motor_name = SelectDropdown.options[SelectDropdown.value].text;

        Debug.LogWarning(motor_name);

        try
        {
            int motorRotateDegree = (int)MotorRotateDegreeSlider.value;
            int motorSpeed        = (int)MotorSpeedSlider.value;

            Mibo.MiboMotorType type = (Mibo.MiboMotorType)Enum.Parse(typeof(Mibo.MiboMotorType), motor_name);
            Debug.LogWarning(type + ", " + (int)type);

            Mibo.setMotorPositionInDegree((int)type, motorRotateDegree, motorSpeed);
            SetInfoText(true);
        }
        catch (Exception e)
        {
            Debug.LogWarning("inputField cound null, exception :" + e.ToString());
        }
    }