using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class ViewWnd : MonoBehaviour { public Button openViewBtn; public Button closeViewBtn; public Animator animator; private void Start() { Init(); } public void Init() { openViewBtn.onClick.AddListener(OpenViewWnd); closeViewBtn.onClick.AddListener(CloseViewWnd); } public void OpenViewWnd() { animator.CrossFade("ViewWindowOpen", 0.1f); } public void CloseViewWnd() { animator.CrossFade("ViewWindowClose", 0.1f); } }