Files
ui/Assets/Module/DiscoveryButton.cs
2026-03-10 19:37:00 -04:00

39 lines
1.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using UnityEngine;
public class DiscoveryButton : MonoBehaviour
{
public TopologyBuilder topologyBuilder;
[Tooltip("If set, camera focuses on GeneratedTopology after Discover. If null, will FindObjectOfType.")]
public UserCameraControl cameraController;
void Start()
{
// todo: where should this be? needs to be somewhere on startup of the game.
// Sentry is used for crash logging
ControlLibrary.control_sentry_init("https://945ddf43f243019f176a8b6171cf534a@o4505559031545856.ingest.us.sentry.io/4510490606567424", "env", "rel");
ControlLibrary.control_sentry_set_app_info("unity", "1", "1");
ControlLibrary.init();
}
public void OnDiscoveryPressed()
{
Debug.Log("Discovery button pressed topology building deferred to overlay selection.");
}
void FocusCameraOnTopology()
{
UserCameraControl cam = cameraController != null ? cameraController : FindObjectOfType<UserCameraControl>();
if (cam != null)
cam.FindModuleStructure();
}
void OnDestroy()
{
Debug.Log("Cleaning up native resources");
ControlLibrary.cleanup();
ControlLibrary.control_sentry_shutdown();
}
}