private void ShowHelp(HelpTips tips, bool swapLeftAndRight = false) { if (!enabled) { return; } var leftController = swapLeftAndRight ? tips.rightController : tips.leftController; var rightController = swapLeftAndRight ? tips.leftController : tips.rightController; tooltipsLeft.triggerText = leftController.triggerText; tooltipsLeft.gripText = leftController.gripText; tooltipsLeft.touchpadText = leftController.touchpadText; tooltipsLeft.buttonTwoText = leftController.buttonText; tooltipsLeft.ResetTooltip(); tooltipsRight.triggerText = rightController.triggerText; tooltipsRight.gripText = rightController.gripText; tooltipsRight.touchpadText = rightController.touchpadText; tooltipsRight.buttonTwoText = rightController.buttonText; tooltipsRight.ResetTooltip(); tooltipsLeft.transform.localPosition = new Vector3(tips.leftPosition, 0, 0); tooltipsRight.transform.localPosition = new Vector3(tips.rightPosition, 0, 0); if (tips.helpName != currentHelp) { currentHelp = tips.helpName; //ShowHelp(true); } }
// Use this for initialization void Start() { time = 0; highlighter = gameObject.GetComponent <VRTK_ControllerHighlighter>(); tooltip.ResetTooltip();//初始化文字提示 }