2024-12-09 18:01:59 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
2024-12-11 17:08:26 +08:00
|
|
|
|
|
2024-12-09 18:01:59 +08:00
|
|
|
|
public class gameGlobal : Base
|
|
|
|
|
{
|
|
|
|
|
public delegate void GameItem();
|
|
|
|
|
public event GameItem OnGameInit;
|
|
|
|
|
public event GameItem OnGameStart;
|
|
|
|
|
public event GameItem OnGamePlay;
|
2024-12-10 06:57:53 +08:00
|
|
|
|
public event GameItem OnGameVictory;
|
|
|
|
|
public event GameItem OnGameOver;
|
2024-12-09 18:01:59 +08:00
|
|
|
|
|
|
|
|
|
|
2024-12-13 05:40:51 +08:00
|
|
|
|
public List<string> CarryCardId = new List<string>();
|
|
|
|
|
|
2024-12-24 12:02:32 +08:00
|
|
|
|
|
2024-12-09 18:01:59 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// <20><>Ϸ<EFBFBD><CFB7>ʼ<EFBFBD><CABC>
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static void GameInit()
|
|
|
|
|
{
|
|
|
|
|
Base.GlobalObj.GetComponent<gameGlobal>().OnGameInit?.Invoke();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <20><>Ϸ<EFBFBD><CFB7><EFBFBD>Կ<EFBFBD>ʼ,<><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static void GameStart()
|
|
|
|
|
{
|
|
|
|
|
Base.GlobalObj.GetComponent<gameGlobal>().OnGameStart?.Invoke();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <20><>Ϸ<EFBFBD><CFB7><EFBFBD><EFBFBD>
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static void GamePlay()
|
|
|
|
|
{
|
2024-12-25 21:49:36 +08:00
|
|
|
|
Debug.Log("<22><>Ϸ<EFBFBD><CFB7>ʼ");
|
2024-12-09 18:01:59 +08:00
|
|
|
|
Base.GlobalObj.GetComponent<gameGlobal>().OnGamePlay?.Invoke();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <20><>Ϸ<EFBFBD><CFB7>ͣ
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static void GameStop()
|
|
|
|
|
{
|
|
|
|
|
Time.timeScale = 0f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <20><>Ϸ<EFBFBD>ָ<EFBFBD>
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static void GameRecovery()
|
|
|
|
|
{
|
|
|
|
|
Time.timeScale = 1f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <20><>Ϸ<EFBFBD>˳<EFBFBD>
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static void GameExit()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
Application.Quit();
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ڱ༭<DAB1><E0BCAD><EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>ϷЧ<CFB7><D0A7>
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
|
UnityEditor.EditorApplication.isPlaying = false; // <20>ڱ༭<DAB1><E0BCAD><EFBFBD><EFBFBD>ֹͣ<CDA3><D6B9>Ϸ
|
|
|
|
|
#endif
|
|
|
|
|
}
|
2024-12-10 06:57:53 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// GameVictory
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static void GameVictory()
|
|
|
|
|
{
|
|
|
|
|
Base.GlobalObj.GetComponent<gameGlobal>().OnGameVictory?.Invoke();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// GameVictory
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static void GameOver()
|
|
|
|
|
{
|
|
|
|
|
Base.GlobalObj.GetComponent<gameGlobal>().OnGameOver?.Invoke();
|
|
|
|
|
}
|
2024-12-09 18:01:59 +08:00
|
|
|
|
}
|