60 lines
1.8 KiB
C#
60 lines
1.8 KiB
C#
|
// using Player.Interactions;
|
|||
|
using UnityEngine;
|
|||
|
using UnityEngine.Scripting;
|
|||
|
using Player.Information;
|
|||
|
using Player.Movement;
|
|||
|
|
|||
|
namespace IngameDebugConsole.Commands
|
|||
|
{
|
|||
|
public class PlayerCommands
|
|||
|
{
|
|||
|
[ConsoleMethod("player.jetpack", "Sets Jetpack Active State")]
|
|||
|
[Preserve]
|
|||
|
public static void PlayerJetpack(bool boolValue)
|
|||
|
{
|
|||
|
var player = GameObject.Find("Player");
|
|||
|
if (player != null)
|
|||
|
{
|
|||
|
// set jetpack component active
|
|||
|
player.GetComponent<PlayerStats>().jetpackEnabled = boolValue;
|
|||
|
Debug.Log("Jetpack set to " + boolValue);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
Debug.Log("Player not found");
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
[ConsoleMethod("player.grapple", "Sets Grapple Active State")]
|
|||
|
[Preserve]
|
|||
|
public static void PlayerGrapple(bool boolValue)
|
|||
|
{
|
|||
|
var player = GameObject.Find("Player");
|
|||
|
if (player != null)
|
|||
|
{
|
|||
|
player.GetComponent<PlayerStats>().grappleEnabled = boolValue;
|
|||
|
Debug.Log("Grapple set to " + boolValue);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
Debug.Log("Player not found");
|
|||
|
}
|
|||
|
}
|
|||
|
[ConsoleMethod("player.sensitivity", "Sets Mouse Sensitivity")]
|
|||
|
[Preserve]
|
|||
|
public static void PlayerSensitivity(float sensitivity)
|
|||
|
{
|
|||
|
var player = GameObject.Find("Player");
|
|||
|
if (player != null)
|
|||
|
{
|
|||
|
Camera.main.GetComponent<MouseLook>().mouseSensitivity = sensitivity;
|
|||
|
PlayerPrefs.SetFloat("Sensitivity", sensitivity);
|
|||
|
Debug.Log("Mouse Sensitivity set to " + sensitivity);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
Debug.Log("Player not found");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|