ict.shenzhi/Assets/Scripts/UI/MainScenesUI/helpPanel.cs

33 lines
809 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
public class helpPanel : UIController
{
[SerializeField] Button StartBtn;
[SerializeField] Button EndBtn;
[SerializeField] Image BG;
[SerializeField] Image Im;
// Start is called before the first frame update
void Start()
{
StartBtn.onClick.AddListener(() =>
{
BG.gameObject.SetActive(true);
base.show(Im,BG);
});
EndBtn.onClick.AddListener(() =>
{
hide(Im,BG);
});
}
public override void hide(Image mainBody, Image BG, Action ac = null)
{
mainBody.transform.DOScale(new Vector3(0,0,0),0.01f);
BG.gameObject.SetActive(false);
}
}