using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class Scene_TooltipMenu_ShowMenu : MonoBehaviour { private GameObject _tooltipMenu; private GameObject tooltipMenu; private void Start() { _tooltipMenu = Resources.Load("Prefabs/TooltipMenu"); } public void ShowTooltipMenu() { try { if (tooltipMenu != null) { Destroy(tooltipMenu); } else { Vector3 locate = transform.position; locate.y -= 0.05f; Quaternion rotation = transform.rotation; tooltipMenu = Instantiate(_tooltipMenu, locate, rotation); } } catch (Exception e) { Debug.Log(e.Message); } } }