Exemple #1
0
        public void AddPlayerMods(VRC_PlayerMods mods)
        {
            CyanEmuPlayerController player = CyanEmuPlayerController.instance;

            if (player == null)
            {
                return;
            }

            foreach (VRCPlayerMod mod in mods.playerMods)
            {
                if (mod.name == "jump")
                {
                    player.SetJump(mod.properties[0].floatValue);

                    if (mods.isRoomPlayerMods)
                    {
                        defaultJumpSpeed_ = mod.properties[0].floatValue;
                    }
                }
                else if (mod.name == "speed")
                {
                    player.SetRunSpeed(mod.properties[0].floatValue);
                    player.SetWalkSpeed(mod.properties[1].floatValue);
                    player.SetStrafeSpeed(mod.properties[2].floatValue);

                    if (mods.isRoomPlayerMods)
                    {
                        defaultRunSpeed_    = mod.properties[0].floatValue;
                        defaultWalkSpeed_   = mod.properties[1].floatValue;
                        defaultStrafeSpeed_ = mod.properties[2].floatValue;
                    }
                }
            }
        }
Exemple #2
0
        public void RemoveMods()
        {
            CyanEmuPlayerController player = CyanEmuPlayerController.instance;

            if (player == null)
            {
                return;
            }

            player.SetRunSpeed(defaultRunSpeed_);
            player.SetWalkSpeed(defaultWalkSpeed_);
            player.SetStrafeSpeed(defaultStrafeSpeed_);
            player.SetJump(defaultJumpSpeed_);
        }