private static Transform GetTooltipTransform(VRDevice device, Location location) { Transform controller = GlobalState.GetControllerTransform(device); if (null == controller) { return(null); } Transform tooltip = null; switch (location) { case Location.Grip: tooltip = controller.Find("GripButtonAnchor/Tooltip"); break; case Location.Trigger: tooltip = controller.Find("TriggerButtonAnchor/Tooltip"); break; case Location.Primary: tooltip = controller.Find("PrimaryButtonAnchor/Tooltip"); break; case Location.Secondary: tooltip = controller.Find("SecondaryButtonAnchor/Tooltip"); break; case Location.Joystick: tooltip = controller.Find("JoystickBaseAnchor/Tooltip"); break; } return(tooltip); }
private static void SetOpacity(VRDevice device, float angle) { Transform controller = GlobalState.GetControllerTransform(device); if (null == controller) { return; } Transform tooltip = controller.Find("GripButtonAnchor/Tooltip"); SetOpacity(tooltip, angle); tooltip = controller.Find("TriggerButtonAnchor/Tooltip"); SetOpacity(tooltip, angle); tooltip = controller.Find("PrimaryButtonAnchor/Tooltip"); SetOpacity(tooltip, angle); tooltip = controller.Find("SecondaryButtonAnchor/Tooltip"); SetOpacity(tooltip, angle); tooltip = controller.Find("JoystickBaseAnchor/Tooltip"); SetOpacity(tooltip, angle); }