internal void Awake() { Instance = this; CustomKeybindings.AddAction(MenuKey, KeybindingsCategory.CustomKeybindings); Show_Menu_On_Startup = Config.Bind("PvP", "Show Menu On startup", true, "Show the PvP menu on game startup."); Enable_Menu_Scaling = Config.Bind("PvP", "Enable Menu Scaling", true, "Attempts to scale the menu to your screen resolution"); SceneManager.activeSceneChanged += SceneManager_activeSceneChanged; var harmony = new Harmony(GUID); harmony.PatchAll(); var obj = new GameObject("PvP"); DontDestroyOnLoad(obj); obj.AddComponent <RPCManager>(); var view = obj.AddComponent <PhotonView>(); view.viewID = 998; Debug.Log("Registered PvP with ViewID " + view.viewID); obj.AddComponent <PvPGUI>(); obj.AddComponent <PlayerManager>(); obj.AddComponent <BattleRoyale>(); obj.AddComponent <DeathMatch>(); }
internal void Awake() { Instance = this; CustomKeybindings.AddAction(MenuKey, CustomKeybindings.KeybindingsCategory.Menus, CustomKeybindings.ControlType.Both, 5); LoadSettings(); var harmony = new Harmony(GUID); harmony.PatchAll(); var obj = new GameObject("PvP"); DontDestroyOnLoad(obj); obj.AddComponent <RPCManager>(); var view = obj.AddComponent <PhotonView>(); view.viewID = 998; Debug.Log("Registered PvP with ViewID " + view.viewID); obj.AddComponent <PvPGUI>(); obj.AddComponent <PlayerManager>(); //obj.AddComponent<BattleRoyale>(); obj.AddComponent <DeathMatch>(); }
// On Update internal void Update() { if ((MenuManager.Instance.IsReturningToMainMenu || Global.IsApplicationClosing) && CurrentGame != GameModes.NONE) { CurrentGame = GameModes.NONE; if (!PhotonNetwork.isNonMasterClientInRoom) { StopGameplay("The host has left the game!"); } } if (CustomKeybindings.GetKeyDown(MenuKey)) { PvPGUI.Instance.ShowGUI = !PvPGUI.Instance.ShowGUI; } // make sure game is running if (Global.Lobby.PlayersInLobbyCount < 1 || NetworkLevelLoader.Instance.IsGameplayPaused) { return; } // update custom gameplay if (CurrentGame != GameModes.NONE) { UpdateGameplay(); } }