1234567891011121314151617181920212223242526272829303132333435 |
- 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<GameObject>("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);
- }
- }
- }
|