/// <summary> /// This method is only executed by the authoritative user. /// </summary> public void StartGame() { _lockJoin = true; if (PhotonNetwork.IsMasterClient) { var customProps = SceneStateManager.Instance.ParseProperties(); PhotonNetwork.CurrentRoom.SetCustomProperties(customProps); string[] selected = AmongosRandomGenerator.GenerateImpostors(PhotonNetwork.PlayerList, (int)customProps["TotalImpostors"]); #if UNITY_EDITOR if (GameConfiguration.IsDebug) { List <string> impostors = new List <string>(); foreach (var gameConfigurationDebugImpostor in GameConfiguration.DebugImpostors) { impostors.Add(PhotonNetwork.PlayerList[gameConfigurationDebugImpostor].UserId); } selected = impostors.ToArray(); } #endif RaiseEventOptions raiseEventOptions = new RaiseEventOptions { Receivers = ReceiverGroup.All }; PhotonNetwork.RaiseEvent(EventsConstants.NOTIFY_GAME_STARTING, selected, raiseEventOptions, SendOptions.SendReliable); } }
private void RandomizeTasks() { GameObject[] AssignedLongTasks = AmongosRandomGenerator.RandomizeTasks(LongTasks, _longTaskCount); GameObject[] AssignedMidTasks = AmongosRandomGenerator.RandomizeTasks(MidTasks, _midTaskCount); GameObject[] AssignedShortTasks = AmongosRandomGenerator.RandomizeTasks(ShortTasks, _shortTaskCount); BulkActive(AssignedLongTasks); BulkActive(AssignedMidTasks); BulkActive(AssignedShortTasks); }