42 lines
		
	
	
		
			865 B
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			42 lines
		
	
	
		
			865 B
		
	
	
	
		
			C#
		
	
	
	
|  | using System.Collections; | |||
|  | using System.Collections.Generic; | |||
|  | using UnityEngine; | |||
|  | using UnityEngine.UI; | |||
|  | using DG.Tweening; | |||
|  | 
 | |||
|  | public class PanelNewCard : BasePanel | |||
|  | { | |||
|  |     [SerializeField] CardCell mCard; | |||
|  | 
 | |||
|  |     [SerializeField] CanvasGroup mCvsBg; | |||
|  |     [SerializeField] RectTransform mRctBg; | |||
|  | 
 | |||
|  |     [SerializeField] Button mBtnClose; | |||
|  | 
 | |||
|  |     private void Awake() | |||
|  |     { | |||
|  |         UIUtils.BindBtn(mBtnClose, OnClickClose); | |||
|  |     } | |||
|  | 
 | |||
|  |     public void InitCard(string pCardID) | |||
|  |     { | |||
|  |         mCard.InitCell(pCardID); | |||
|  |     } | |||
|  | 
 | |||
|  |     public override void OnOpen() | |||
|  |     { | |||
|  |         base.OnOpen(); | |||
|  | 
 | |||
|  |         mCvsBg.alpha = 0; | |||
|  |         mRctBg.anchoredPosition = new Vector2(0, -160); | |||
|  | 
 | |||
|  |         mCvsBg.DOFade(1, 0.3f); | |||
|  |         mRctBg.DOAnchorPosY(100, 0.3f); | |||
|  |     } | |||
|  | 
 | |||
|  |     private void OnClickClose() | |||
|  |     { | |||
|  |         mCvsBg.DOFade(0, 0.3f); | |||
|  |         mRctBg.DOAnchorPosY(-160, 0.3f).onComplete = Close; | |||
|  |     } | |||
|  | } |