示例#1
0
    void Awake()
    {
        //Check if instance already exists
        if (instance == null)
        {
            //if not, set instance to this
            instance = this;
        }

        //If instance already exists and it's not this:
        else if (instance != this)
        {
            //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
            Destroy(gameObject);
        }

        //Sets this to not be destroyed when reloading scene
        DontDestroyOnLoad(gameObject);
    }
示例#2
0
 public void Settings()
 {
     MenuEventManager.ChangeMenuState(MenuStates.Settings);
 }
示例#3
0
 public void LevelSelect()
 {
     MenuEventManager.ChangeMenuState(MenuStates.LevelSelect);
 }
示例#4
0
 public void Credits()
 {
     MenuEventManager.ChangeMenuState(MenuStates.Credits);
 }
示例#5
0
 public void Back()
 {
     MenuEventManager.ChangeMenuState(MenuStates.MainMenu);
 }
示例#6
0
 void Awake()
 {
     instance = this;
 }
示例#7
0
    public bool isPreviewing;            //是否正在显示卡牌

    private void Awake()
    {
        Instance = this;
    }
 private void Start()
 {
     MenuEventManager.ChangeMenuState(MenuStates.MainMenu);
 }
示例#9
0
 public override void PressButton()
 {
     MenuEventManager.ButtonPress(this);
 }