1234567891011121314151617181920212223242526272829303132333435363738 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class QuanJuBackManager : MonoBehaviour
- {
- public static QuanJuBackManager Instance ;
- public GameObject nowWindow;
- public Stack<GameObject> stackList=new Stack<GameObject>();
- public void setStack(GameObject go)
- {
- stackList.Push(go);
- }
- public void back()
- {
- if(stackList.Count<=0)
- {
- WindowMainManager.instance.m.isOn=true;
- }
- else
- {
- nowWindow.SetActive(false);
- stackList.Pop().SetActive(true);
- }
- }
- public void clearstack()
- {
- stackList.Clear();
- }
- void Awake()
- {
- Instance=this;
- }
- }
|