using System.Collections; using System.Collections.Generic; using UnityEngine; using SC.XR.Unity.Module_Tooltip; public class API_Module_Tooltip { /// /// Return whether the tooltip is activie. /// /// GameObject of Tooltip. /// public static bool IsActivie(GameObject tooltip) { return tooltip.activeSelf; } /// /// Set active of the tooltip. /// /// GameObject of Tooltip. /// True to set active and false to set inactive. public static void SetActive(GameObject tooltip, bool state) { tooltip.SetActive(state); } /// /// Return the position of target. /// /// GameObject of Tooltip. /// True to return worldPosition,false to return localPosition. /// public static Vector3 GetTargetPosition(GameObject tooltip, bool isWorldPosition) { return tooltip.GetComponent().API_GetTargetPosition(isWorldPosition); } /// /// Set new position of target. /// /// GameObject of Tooltip. /// New position of targer. /// Whether new position is a world position or a local position. public static void SetTargetPosition(GameObject tooltip, Vector3 newPosition, bool isWorldPosition) { tooltip.GetComponent().API_SetTargetPosition(newPosition, isWorldPosition); } /// /// Return he position of lable. /// /// GameObject of Tooltip. /// Whether new position is a world position or a local position. /// public static Vector3 GetLablePosition(GameObject tooltip, bool isWorldPosition) { return tooltip.GetComponent().API_GetLablePosition(isWorldPosition); } /// /// Set new position of lable. /// /// GameObject of Tooltip. /// New position of lable. /// Whether new position is a world position or a local position. public static void SetLablePosition(GameObject tooltip, Vector3 newPosition, bool isWorldPosition) { tooltip.GetComponent().API_SetLablePosition(newPosition, isWorldPosition); } /// /// Return the type of TooltipStartPointLocation. /// /// GameObject of Tooltip. /// public static Modules_TooltipLineRenderer.TooltipStartPointLocation GetStartPoint(GameObject tooltip) { return tooltip.GetComponent().API_GetStartPoint(); } /// /// Set the type of TooltipStartPointLocation. /// /// GameObject of Tooltip. /// Type of TooltipStartPointLocation. public static void SetStartPoint(GameObject tooltip, Modules_TooltipLineRenderer.TooltipStartPointLocation tooltipStartPoint) { tooltip.GetComponent().API_SetStartPoint(tooltipStartPoint); } /// /// Return the position of startpoint. /// /// GameObject of Tooltip. /// Whether new position is a world position or a local position. /// public static Vector3 GetStartPointPosition(GameObject tooltip, bool isWorldPosition) { return tooltip.GetComponent().API_GetStartPointPosition(isWorldPosition); } /// /// Set the width of line.(Range(0, 0.01)) /// /// GameObject of Tooltip. /// Width of line. public static void SetLineWidth(GameObject tooltip, float width) { tooltip.GetComponent().API_SetLineWidth(width); } /// /// Return the text of lable. /// /// GameObject of Tooltip. /// public static string GetLableText(GameObject tooltip) { return tooltip.GetComponent().API_GetLableText(); } /// /// Set text of lable. /// /// GameObject of Tooltip. /// Text to set. public static void SetLableText(GameObject tooltip, string newText) { tooltip.GetComponent().API_SetLableText(newText); } /// /// Set color of text. /// /// GameObject of Tooltip. /// Color to set. public static void SetLableTextColor(GameObject tooltip, Color color) { tooltip.GetComponent().API_SetLableTextColor(color); } /// /// Set size of text. /// /// GameObject of Tooltip. /// Size to set. public static void SetLableTextSize(GameObject tooltip, float size) { tooltip.GetComponent().API_SetLableTextSize(size); } /// /// Set size of lable(background and text). /// /// GameObject of Tooltip. /// Width of lable. /// Height of lable. public static void SetLableSize(GameObject tooltip, float width, float height) { tooltip.GetComponent().API_SetLableSize(width, height); } /// /// Set scale of lable.(Range(0, 0.01)) /// /// GameObject of Tooltip. /// Scale size. public static void SetLableScale(GameObject tooltip, float scale) { tooltip.GetComponent().API_SetLableScale(scale); } /// /// Set whether the startpoint is visible. /// /// GameObject of Tooltip. /// Whether the startpoint is visible. public static void SetStartPointVisible(GameObject tooltip, bool state) { tooltip.GetComponent().API_SetStartPointVisible(state); } /// /// Set whether the line is visible. /// /// GameObject of Tooltip. /// Whether the line is visible. public static void SetLineVisible(GameObject tooltip, bool state) { tooltip.GetComponent().API_SetLineVisible(state); } /// /// Return the type of TooltipRotationAxis whitch lable rotates. /// /// GameObject of Tooltip. /// public static Modules_Tooltip.TooltipRotationAxis GetTooltipRotationAxis(GameObject tooltip) { return tooltip.GetComponent().API_GetTooltipRotationAxis(); } /// /// Set the type of TooltipRotationAxis whitch lable rotates. /// /// GameObject of Tooltip. /// public static void SetTooltipRotationAxis(GameObject tooltip, Modules_Tooltip.TooltipRotationAxis tooltipRotationAxis) { tooltip.GetComponent().API_SetTooltipRotationAxis(tooltipRotationAxis); } /// /// Change the target of TooltipRotationAxis whitch lable rotates. /// /// GameObject of Tooltip. /// New target of TooltipRotationAxis whitch lable rotates. public static void SetTooltipRotationAxisTarget(GameObject tooltip, Transform target) { tooltip.GetComponent().API_SetTooltipRotationAxisTarget(target); } public static Modules_TooltipCtrl.TooltipShowTrigger GetTooltipShowTrigger(Modules_TooltipCtrl aimObject, GameObject tooltip) { return aimObject.API_GetTooltipShowTrigger(tooltip); } /// /// Set TooltipShowTrigger of the tooltip.(The tooltip should be created by Modules_TooltipCtrl.) /// /// The parent gameobject of tooltip with Modules_TooltipCtrl. /// GameObject of Tooltip. /// When will the tooltip show. public static void SetTooltipShowTrigger(Modules_TooltipCtrl aimObject, GameObject tooltip, Modules_TooltipCtrl.TooltipShowTrigger showTrigger) { aimObject.API_SetTooltipShowTrigger(tooltip, showTrigger); } /// /// Add a new tooltip as chlid of aimObject. /// /// The parent gameobject of new tooltip. /// When will the tooltip show. /// Text of lable. /// public static GameObject AddNewTooltip(GameObject parentObject, Modules_TooltipCtrl.TooltipShowTrigger showTrigger, string text) { if (parentObject.GetComponent()) { return parentObject.GetComponent().API_AddNewTooltip(showTrigger, text); } else { if (!parentObject.GetComponent()) { parentObject.AddComponent(); } parentObject.AddComponent(); return parentObject.GetComponent().API_AddNewTooltip(showTrigger, text); } } /// /// Delete the tooltip whitch as a child gameobject.(The tooltip should be created by Modules_TooltipCtrl.) /// /// The parent gameobject of tooltip with Modules_TooltipCtrl. /// GameObject of Tooltip. public static void DelTooltip(Modules_TooltipCtrl parentObject, GameObject tooltip) { parentObject.API_DelTooltip(tooltip); } }