public void OnEnable() { if (_Instance == null) { _Instance = this; } roomInfo = InOutGameRoomInfo.Instance; teamPosMap = new Dictionary <Team, GameObject> { { Team.Green, GreenTeam }, { Team.Red, RedTeam } }; StartGameTiming(); // 生成角色被移入Start(),防止与其他初始化冲突 }
private void Awake() { if (Instance != null) { Destroy(gameObject); return; } DontDestroyOnLoad(gameObject); inRoomPlayerInfos = new List <Player>() { }; Instance = this; }