private void OnEnable()
 {
     if (_preMaidController == null)
     {
         _preMaidController     = GetComponent <PreMaidController>();
         _preMaidPoseController = GetComponent <PreMaidPoseController>();
     }
 }
 // Start is called before the first frame update
 void Awake()
 {
     if (_preMaidController == null)
     {
         _preMaidController     = GetComponent <PreMaidController>();
         _preMaidPoseController = GetComponent <PreMaidPoseController>();
     }
     //コントローラの初期化の後に、こちらのGUIを初期化する、という初期化順制御です
     _preMaidController.OnInitializeServoDefines += OnInitializeServoDefines;
 }
        // Start is called before the first frame update
        void Start()
        {
            if (!premaidRoot)
            {
                // 未指定ならモデルのルートにこのスクリプトがアタッチされているものとする
                premaidRoot = transform;
            }

            if (premaidRoot != null)
            {
                _joints = premaidRoot.GetComponentsInChildren <ModelJoint>();
            }

            // PreMaidControllerが未指定ならシーンに存在するものを検索
            if (!controller)
            {
                controller = GameObject.FindObjectOfType <PreMaidController>();
            }
        }
Exemple #4
0
        // Start is called before the first frame update
        void Start()
        {
            _controller = GetComponent <PreMaid.RemoteController.PreMaidController>();
            List <TMP_Dropdown.OptionData> serialPortNamesList = new List <TMP_Dropdown.OptionData>();

            var portNames = SerialPort.GetPortNames();


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

                Debug.Log(VARIABLE);
            }

            _serialPortsDropdown.ClearOptions();
            _serialPortsDropdown.AddOptions(serialPortNamesList);


            //対象のAnimatorにBoneにHumanoidModelJoint.csのアタッチ漏れがあるかもしれない
            //なので、一旦全部検索して、見つからなかったサーボ情報はspineに全部動的にアタッチする
            Transform spineBone = target.GetBoneTransform(HumanBodyBones.Spine);

            //仮でspineにでも付けておこう
            if (target != null)
            {
                var joints = target.GetComponentsInChildren <HumanoidModelJoint>();

                foreach (PreMaidServo.ServoPosition item in Enum.GetValues(typeof(PreMaidServo.ServoPosition)))
                {
                    if (Array.FindIndex(joints, joint => joint.TargetServo == item) == -1)
                    {
                        var jointScript = spineBone.gameObject.AddComponent <HumanoidModelJoint>();
                        jointScript.TargetServo = item;
                    }
                }
            }

            _joints = target.GetComponentsInChildren <HumanoidModelJoint>();
        }
Exemple #5
0
        // Start is called before the first frame update
        void Start()
        {
            _controller = GetComponent <PreMaid.RemoteController.PreMaidController>();
            List <TMP_Dropdown.OptionData> serialPortNamesList = new List <TMP_Dropdown.OptionData>();

            var portNames = SerialPort.GetPortNames();


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

                Debug.Log(VARIABLE);
            }

            _serialPortsDropdown.ClearOptions();
            _serialPortsDropdown.AddOptions(serialPortNamesList);

            _joints = target.GetComponentsInChildren <ModelJoint>();
        }
Exemple #6
0
 // Start is called before the first frame update
 void Start()
 {
     _controller = GetComponent <PreMaidController>();
 }
Exemple #7
0
 // Start is called before the first frame update
 void Start()
 {
     _preMaidPoseController = GetComponent <PreMaidController>();
     _preMaidPoseController.OnReceivedFromPreMaidAI += OnReceivedFromPreMaidAi;
 }