mirror of
https://github.com/BotChain-Robots/ui.git
synced 2026-07-08 15:07:22 +02:00
switch from Unity version control to git
This commit is contained in:
30
Assets/Module/DiscoveryButton.cs
Normal file
30
Assets/Module/DiscoveryButton.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user