void OnApplicationQuit() { if (survive != null) { survive.Close(); survive.Dispose(); survive = null; } }
static void Main() { string[] args = System.Environment.GetCommandLineArgs(); var api = new SurviveAPI(args); while (api.WaitForUpdate()) { SurviveAPIOObject obj; while ((obj = api.GetNextUpdated()) != null) { Console.WriteLine(obj.Name + "(" + obj.SerialNumber + ") : " + obj.LatestPose); } } api.Close(); }
// Start is called before the first frame update void Start() { survive_objects = new Dictionary <string, GameObject>(); string[] args = System.Environment.GetCommandLineArgs(); var argList = new List <string>(args); var idx = argList.LastIndexOf("--"); if (idx < 0) { argList.RemoveRange(1, argList.Count - 1); } else { argList.RemoveRange(1, idx); } argList.Add("--v"); argList.Add("10"); survive = new SurviveAPI(argList.ToArray(), logFunc: InfoFn); prototypeObject = gameObject.transform.Find("PrototypeObject")?.gameObject; prototypeObject.SetActive(false); }