private void FindObj() { setGesturePanel = GetComponentInParent <SetGesturePanel>(); GestureInput = FindTool.FindChildComponent <ButtonBase>(transform, "GestureInput"); EventInput = FindTool.FindChildComponent <ButtonBase>(transform, "EventInput"); Remove = FindTool.FindChildComponent <ButtonBase>(transform, "Remove"); }
/// <summary> /// 初始化按钮 /// </summary> /// <param name="_playerGestureData"></param> /// <param name="_setGesturePanel"></param> public void Init(PlayerGestureData _playerGestureData, SetGesturePanel _setGesturePanel) { playerGestureData = _playerGestureData; GestureName.text = _playerGestureData.playerGestureInfo.GestureName; if (_setGesturePanel) { setGesturePanel = _setGesturePanel; } gestureButton.OnClick.AddListener(() => { setGesturePanel.ReturnGestureButton(this); }); if (_playerGestureData.playerGestureInfo.isFindGesture) { PlayerGestureManager.Instance.ReturnFindGesture(_playerGestureData); } }
/// <summary> /// 设置面板信息 /// </summary> /// <param name="_gesture"></param> /// <param name="_setGesturePanel"></param> public void SetPanel(Gesture _gesture, SetGesturePanel _setGesturePanel) { transform.localScale = Vector3.one; setGesturePanel = _setGesturePanel; gesture = _gesture; gestureName.text = gesture.playerGestureData.playerGestureInfo.GestureName; gestureOffset.text = gesture.playerGestureData.playerGestureInfo.offset.ToString(); gestureTime.text = gesture.playerGestureData.playerGestureInfo.timeGesture.ToString(); toggle.isOn = gesture.playerGestureData.playerGestureInfo.isFindGesture; dropdown.options.Clear(); foreach (GestureActionType gat in Enum.GetValues(typeof(GestureActionType))) { Dropdown.OptionData optionData = new Dropdown.OptionData(); optionData.text = gat.ToString(); dropdown.options.Add(optionData); } dropdown.captionText.text = gesture.playerGestureData.playerGestureInfo.gestureActionType.ToString(); dropdown.value = (int)gesture.playerGestureData.playerGestureInfo.gestureActionType; if (gesture.playerGestureData.playerGestureInfo.intoPhotoBase64 != null) { intoPhoto.texture = gesture.playerGestureData.playerGestureInfo.intoPhotoBase64.Get(); } else { intoPhoto.texture = texture; } if (gesture.playerGestureData.playerGestureInfo.leavePhotoBase64 != null) { leavePhoto.texture = gesture.playerGestureData.playerGestureInfo.leavePhotoBase64.Get(); } else { leavePhoto.texture = texture; } if (gesture.playerGestureData.playerGestureInfo.isOnLeftFoot) { leftFoot.Init(true); } else { leftFoot.Init(false); } if (gesture.playerGestureData.playerGestureInfo.isOnRightFoot) { rightFoot.Init(true); } else { rightFoot.Init(false); } if (gesture.playerGestureData.playerGestureInfo.isOnLeftHand) { leftHand.Init(true); } else { leftHand.Init(false); } if (gesture.playerGestureData.playerGestureInfo.isOnRightHand) { rightHand.Init(true); } else { rightHand.Init(false); } if (gesture.playerGestureData.playerGestureInfo.isLeftFootMain) { leftFootToggle.isOn = true; } else { leftFootToggle.isOn = false; } if (gesture.playerGestureData.playerGestureInfo.isRightFootMain) { rightFootToggle.isOn = true; } else { rightFootToggle.isOn = false; } if (gesture.playerGestureData.playerGestureInfo.isLeftHandMain) { leftHandToggle.isOn = true; } else { leftHandToggle.isOn = false; } if (gesture.playerGestureData.playerGestureInfo.isRightHandMain) { rightHandToggle.isOn = true; } else { rightHandToggle.isOn = false; } gesture.playerGestureData.playerGestureInfo.isLeftFootMain = leftFootToggle.isOn; gesture.playerGestureData.playerGestureInfo.isRightFootMain = rightFootToggle.isOn; gesture.playerGestureData.playerGestureInfo.isLeftHandMain = leftHandToggle.isOn; gesture.playerGestureData.playerGestureInfo.isRightHandMain = rightHandToggle.isOn; }