mirror of
https://github.com/BotChain-Robots/ui.git
synced 2026-07-08 15:07:22 +02:00
30 lines
678 B
C#
30 lines
678 B
C#
using UnityEngine;
|
|
|
|
public class DiscoveryButton : MonoBehaviour
|
|
{
|
|
public TopologyBuilder topologyBuilder;
|
|
|
|
void Start()
|
|
{
|
|
ControlLibrary.init(); // todo: where should this be? needs to be somewhere on startup of the game.
|
|
}
|
|
|
|
public void OnDiscoveryPressed()
|
|
{
|
|
if (topologyBuilder != null)
|
|
{
|
|
Debug.Log("Discovery button pressed.");
|
|
topologyBuilder.BuildTopologyFromJson();
|
|
}
|
|
else
|
|
{
|
|
Debug.LogError("TopologyBuilder is not assigned!");
|
|
}
|
|
}
|
|
|
|
void OnDestroy()
|
|
{
|
|
Debug.Log("Cleaning up native resources");
|
|
ControlLibrary.cleanup();
|
|
}
|
|
} |