using System;
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
namespace TapTap.UI
{
///
/// base panel of TapSDK UI module
///
[RequireComponent(typeof(CanvasGroup))]
[RequireComponent(typeof(GraphicRaycaster))]
public abstract class BasePanelController : MonoBehaviour
{
protected virtual float GetToastSlideInOffset() => 300;
///
/// the canvas related to this panel
///
[HideInInspector]
public Canvas canvas;
///
/// the canvas group related to this panel
///
[HideInInspector]
public CanvasGroup canvasGroup;
///
/// fade in/out time
///
protected float fadeAnimationTime = 0.15f;
///
/// animation elapse time
///
private float _animationElapse;
private Vector2 _screenSize;
private Vector2 _cachedAnchorPos;
private RectTransform _rectTransform;
private Coroutine _animationCoroutine;
///
/// open parameter
///
protected internal AbstractOpenPanelParameter openParam;
///
/// settings about this panel
///
public BasePanelConfig panelConfig;
///
/// 特殊面板需要一直保持置顶的,需要填写 toppedOrder, toppedOrder 越大越置顶
///
public int toppedOrder;
///
/// the transform parent when created it would be attached to
///
///
public virtual Transform AttachedParent => UIManager.Instance.GetUIRootTransform(this);
#region Load
protected virtual void Awake()
{
canvas = GetComponent