Added RC_DEBUG consition for Unity

This commit is contained in:
Pascal Serrarens 2025-06-05 11:44:58 +02:00
parent f3b863692b
commit 1fb2ad6f7a
2 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,4 @@
#if UNITY_5_3_OR_NEWER #if UNITY_5_3_OR_NEWER && RC_DEBUG
using System.IO; using System.IO;
using System.Text; using System.Text;
using UnityEngine; using UnityEngine;

View File

@ -13,14 +13,16 @@ namespace RoboidControl.Unity {
//public Queue<RoboidControl.Thing> thingQueue = new(); //public Queue<RoboidControl.Thing> thingQueue = new();
protected virtual void Awake() { protected virtual void Awake() {
#if RC_DEBUG
Console.SetOut(new UnityLogWriter()); Console.SetOut(new UnityLogWriter());
#endif
this.coreParticipant = new RoboidControl.SiteServer(port); this.coreParticipant = new RoboidControl.SiteServer(port);
} }
void OnApplicationQuit() { void OnApplicationQuit() {
if (site != null) if (site != null)
site.Close(); site.Close();
} }
protected override void Update() { protected override void Update() {