1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class CurvedUIInfo : MonoBehaviour
- {
- public Transform _centerPoint;
- public float _redio;
- public float _widthValue;
- public CurvedUIBaseController.ShowInfoType _showInfoType;
- public string _distanceText;
- public string _descriptsText;
- [HideInInspector]
- public bool opening;
- [HideInInspector]
- public CurvedUIBaseController uiBase;
- public void ReloadInfo()
- {
- Transform chackTool = this.transform.GetChild(0);
- _redio = chackTool.localScale.x / 2;
- _widthValue = chackTool.localScale.y * 2;
- UpdateUIInfo();
- }
- public void OpenUIInfo()
- {
- if (uiBase == null)
- {
- uiBase = CurvedUIPool.Instance.GetCUIBaseController();
- }
- uiBase.ReSetCurvedUIInfo(this);
- if (Application.isPlaying)
- {
- uiBase.OpenCurvedUI();
- }
- else
- {
- uiBase.InitCurvedOpenState(true);
- }
- opening = true;
- }
- public void UpdateUIInfo()
- {
- if (uiBase != null)
- {
- uiBase.ReSetCurvedUIInfo(this);
- }
- }
- public void CloseUIInfo()
- {
- if (uiBase != null)
- {
- if (Application.isPlaying)
- {
- uiBase.CloseCurvedUI(() =>
- {
- CurvedUIPool.Instance.PutCUIBaseController(uiBase);
- uiBase = null;
- });
- }
- else
- {
- uiBase.InitCurvedOpenState(false);
- CurvedUIPool.Instance.PutCUIBaseController(uiBase);
- uiBase = null;
- }
- }
- opening = false;
- }
- }
|