18 lines
676 B
C#
18 lines
676 B
C#
using UnityEngine;
|
|||
|
|
|
||
|
|
namespace HexapodSim
|
||
|
|
{
|
||
|
|
// Adds the firmware simulation to whatever scene is playing, so Main.unity
|
||
|
|
// works without editing the scene. To configure it in the Inspector
|
||
|
|
// instead, add a HexapodSimulation component to any GameObject yourself;
|
||
|
|
// the bootstrap then does nothing.
|
||
|
|
static class HexapodSimBootstrap
|
||
|
|
{
|
||
|
|
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)]
|
||
|
|
static void AddSimulationIfMissing()
|
||
|
|
{
|
||
|
|
if (Object.FindAnyObjectByType<HexapodSimulation>() != null) return;
|
||
|
|
new GameObject("HexapodSimulation").AddComponent<HexapodSimulation>();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|