示例#1
0
        public void Update()
        {
            if (!activated)
            {
                return;
            }

            if (Config.charges >= Config.maxCharges)
            {
                if (multiGMPDisplay.chargeText.text.Contains("Charging"))
                {
                    currentPowerUp = MultiPowers.GeneratePowerUp();
                    multiGMPDisplay.chargeText.text = currentPowerUp;
                }


                if ((GamePlayModifiersPlus.Plugin.leftController.triggerValue >= 0.8 || GamePlayModifiersPlus.Plugin.rightController.triggerValue >= 0.8))
                {
                    MultiClientInterface.SendCommand("!gmm " + currentPowerUp.ToLower());
                    Config.charges = 0;
                    currentPowerUp = "Charging...";
                    multiGMPDisplay.chargeText.text = currentPowerUp;
                }
            }
        }
示例#2
0
        private void SceneManager_activeSceneChanged(Scene oldScene, Scene newScene)
        {
            if (multiGMPDisplay != null)
            {
                multiGMPDisplay.DestroyDis();
                GameObject.Destroy(multiGMPDisplay);
            }


            Config.charges = 0;
            activated      = false;
            MultiClientInterface.initialized = false;
            multiActive = BeatSaberMultiplayer.Client.Instance?.Connected;

            if (multiActive.Value)
            {
                MultiClientInterface.ResetName();
                if (newScene.name == "EmptyTransition")
                {
                    Log("Resetting Multi Powers Object");
                    if (multiObject != null)
                    {
                        GameObject.Destroy(multiObject);
                    }
                }
            }

            if (multiObject == null)
            {
                Log("Null Creation of Multi Powers Object");
                multiObject = new GameObject("Multi Powers");
                Powers      = multiObject.AddComponent <MultiPowers>();
            }

            //        }
            //        catch(Exception ex)
            //        {
            //           Log(ex.ToString());
            //        }


            if (newScene.name == "GameCore")
            {
                Log("GameCore");
                if (!GMPUI.allowMulti)
                {
                    Log("Multi Not Allowed, Returning");
                    return;
                }
                if (multiActive.Value)
                {
                    GamePlayModifiersPlus.TwitchStuff.GMPDisplay ChatDisplay = GameObject.Find("Chat Powers").GetComponent <GamePlayModifiersPlus.TwitchStuff.GMPDisplay>();
                    if (ChatDisplay != null)
                    {
                        ChatDisplay.Destroy();
                        GameObject.Destroy(ChatDisplay);
                    }
                    //    Log("MultiMain - Multi Level Started");
                    MultiClientInterface.Client_ClientLevelStarted();
                }
                else
                {
                    Log("Multi Not Active, Returning");
                }
            }
        }