コード例 #1
0
        // Start is called before the first frame update
        void Start()
        {
            Servos.Clear();

            //PreMaidServo.AllServoPositionDump();
            //foreach (PreMaidServo.ServoPosition item in Enum.GetValues(typeof(PreMaidServo.ServoPosition)))
            foreach (PreMaidServo.ServoPosition item in PreMaidServo.servoPositions)
            {
                PreMaidServo servo = new PreMaidServo(item);

                Servos.Add(servo);
            }

            /*
             * //一覧を出して確認するときはここのコメントアウトを外す
             * foreach (var VARIABLE in Servos)
             * {
             *  Debug.Log(VARIABLE.GetServoIdString() + "   " + VARIABLE.GetServoId() + "  サーボ数値変換" +
             *            VARIABLE.GetServoIdAndValueString());
             * }
             */

            OnInitializeServoDefines?.Invoke();
#if UNITY_EDITOR
            EditorApplication.playModeStateChanged += OnChangedPlayMode;
#endif
        }
コード例 #2
0
        // Start is called before the first frame update
        void Start()
        {
            _servos.Clear();
            PreMaidServo.AllServoPositionDump();
            foreach (PreMaidServo.ServoPosition item in Enum.GetValues(typeof(PreMaidServo.ServoPosition)))
            {
                PreMaidServo servo = new PreMaidServo(item);

                _servos.Add(servo);
            }

            //一覧を出す
            foreach (var VARIABLE in _servos)
            {
                Debug.Log(VARIABLE.GetServoIdString() + "   " + VARIABLE.GetServoId() + "  サーボ数値変換" +
                          VARIABLE.GetServoIdAndValueString());
            }

            _uguiController.Initialize(_servos);
            _uguiController.OnChangeValue += OnChangeValue;

            Debug.Log(BuildPoseString());
            var portNames = SerialPort.GetPortNames();

            if (_dropdown == null)
            {
                Debug.LogError("シリアルポートを選択するDropDownが指定されていません");
                return;
            }

            List <TMP_Dropdown.OptionData> serialPortNamesList = new List <TMP_Dropdown.OptionData>();

            foreach (var VARIABLE in portNames)
            {
                TMP_Dropdown.OptionData optionData = new TMP_Dropdown.OptionData(VARIABLE);
                serialPortNamesList.Add(optionData);

                Debug.Log(VARIABLE);
            }

            _dropdown.ClearOptions();
            _dropdown.AddOptions(serialPortNamesList);
        }
コード例 #3
0
        // Start is called before the first frame update
        void Start()
        {
            Servos.Clear();
            //PreMaidServo.AllServoPositionDump();
            foreach (PreMaidServo.ServoPosition item in Enum.GetValues(typeof(PreMaidServo.ServoPosition)))
            {
                PreMaidServo servo = new PreMaidServo(item);

                Servos.Add(servo);
            }

            //一覧を出す
            foreach (var VARIABLE in Servos)
            {
                Debug.Log(VARIABLE.GetServoIdString() + "   " + VARIABLE.GetServoId() + "  サーボ数値変換" +
                          VARIABLE.GetServoIdAndValueString());
            }


            Debug.Log(BuildPoseString());
            OnInitializeServoDefines?.Invoke();
        }