void Start() { m_GameLogic = FindObjectOfType <GameLogicBase>(); m_CharactersDropdown = this.GetComponent <Dropdown>(); PopulateCharactersDropdown(); }
public static bool StartGameSession(int GameSessionPhotonViewId, int[] otherPhotonViewIds, PhotonPlayer[] players, GameModeModel gameMode, Dictionary <int, int> characterSet) { if (m_GameSession) { Debug.LogWarning("当前游戏进程不为空,请先结束当前进程。"); return(false); } m_GameSession = UnityEngine.Object.Instantiate(gameMode.GameSessionPrefab); PhotonView photonView = m_GameSession.GetComponent <PhotonView>(); photonView.viewID = GameSessionPhotonViewId; GameLogicBase gameLogic = m_GameSession.GetComponent <GameLogicBase>(); if (!gameLogic) { Debug.LogError("无法生成有效的游戏逻辑,游戏未能成功创建!"); EndGameSession(); return(false); } gameLogic.InitGameLogic(otherPhotonViewIds, players, gameMode, characterSet); return(true); }
void Start() { m_GameLogic = FindObjectOfType <GameLogicBase>(); InitOperationsDropdown(); }
void Awake() { m_GameLogic = FindObjectOfType <GameLogicBase>(); }