quantum-space-buddies/QSB/Utility/DebugActions.cs

61 lines
1.5 KiB
C#
Raw Normal View History

2020-12-20 10:56:15 +00:00
using OWML.Utils;
using QSB.ShipSync;
2020-12-08 09:31:29 +00:00
using UnityEngine;
namespace QSB.Utility
{
2020-12-02 21:23:01 +00:00
public class DebugActions : MonoBehaviour
{
private void GoToVessel()
{
var spawnPoint = GameObject.Find("Spawn_Vessel").GetComponent<SpawnPoint>();
2020-12-02 21:23:01 +00:00
var playerBody = Locator.GetPlayerBody();
playerBody.WarpToPositionRotation(spawnPoint.transform.position, spawnPoint.transform.rotation);
playerBody.SetVelocity(spawnPoint.GetPointVelocity());
}
2020-12-02 21:23:01 +00:00
private void InsertWarpCore()
{
var warpCore = GameObject.Find("Prefab_NOM_WarpCoreVessel").GetComponent<WarpCoreItem>();
var socket = GameObject.Find("Interactibles_VesselBridge").GetComponentInChildren<WarpCoreSocket>();
socket.PlaceIntoSocket(warpCore);
2020-12-08 09:31:29 +00:00
var bridgeVolume = FindObjectOfType<VesselWarpController>().GetValue<OWTriggerVolume>("_bridgeVolume");
bridgeVolume.AddObjectToVolume(Locator.GetPlayerDetector());
bridgeVolume.AddObjectToVolume(Locator.GetPlayerCameraDetector());
2020-12-02 21:23:01 +00:00
}
private void DamageShipElectricalSystem()
{
ShipManager.Instance.ShipElectricalComponent.SetDamaged(true);
}
2020-12-14 20:41:56 +00:00
public void Update()
2020-12-02 21:23:01 +00:00
{
2020-12-14 16:24:52 +00:00
if (!QSBCore.DebugMode)
2020-12-02 21:23:01 +00:00
{
return;
}
2021-06-18 21:38:32 +00:00
if (Input.GetKeyDown(KeyCode.Keypad4))
{
DamageShipElectricalSystem();
}
2021-03-28 13:19:26 +00:00
if (Input.GetKeyDown(KeyCode.Keypad7))
2020-12-02 21:23:01 +00:00
{
GoToVessel();
}
2021-06-18 21:38:32 +00:00
2021-03-28 13:19:26 +00:00
if (Input.GetKeyDown(KeyCode.Keypad8))
2020-12-02 21:23:01 +00:00
{
InsertWarpCore();
}
2021-06-18 21:38:32 +00:00
2021-03-28 13:19:26 +00:00
if (Input.GetKeyDown(KeyCode.Keypad9))
2020-12-02 21:23:01 +00:00
{
2020-12-14 20:41:56 +00:00
LoadManager.LoadSceneAsync(OWScene.EyeOfTheUniverse, true, LoadManager.FadeType.ToWhite);
2020-12-02 21:23:01 +00:00
}
}
}
2020-11-28 09:55:25 +00:00
}