public void ShowHelp(string name, bool swapLeftAndRight = false) { if (!enabled) { return; } HelpTips toShow = null; foreach (var tip in tips) { if (tip.helpName == name) { toShow = tip; break; } } if (toShow) { ShowHelp(toShow, swapLeftAndRight); } else { Debug.LogError("Help text not found!"); } }
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); } }