I've been trying move some of my c# code into a dll reduce compile time and so I can create a custom Debug output tool (since putting the code in the dll will allow to click on the log and take you to the line of code that generated the log) . I've placed unity defines inside the code but I have noticed that any code placed inside the defines are ignored, even if I am on the correct platform. I've attached code which I've compiled into a dll which displays this issue. Does anyone have a solution to this problem or is this a limitation of using .dlls?
using System;
using UnityEngine;
namespace UnityDefineTest
{
public class DefineTest:MonoBehaviour
{
private string outputText = string.Empty;
private void Start()
{
#if UNITY_EDITOR
outputText += "Unity editor ";
#endif
#if UNITY_WEBPLAYER
outputText += "Unity webplayer ";
#endif
#if UNITY_STANDALONE
outputText += "Unity standalone ";
#endif
outputText += "default text";
}
private void OnGUI()
{
GUILayout.Label(outputText);
}
}
}
↧