C# Conditional Attribute

#undef TEST_CONDITIONAL

public class TestMonoBehaviour : MonoBehaviour
{
    void Start()
    {
        ConditionalTest(TestFunction());
    }

    [System.Diagnostics.Conditional("TEST_CONDITIONAL")]
    public void ConditionalTest(string testData)
    {
        Debug.Log("ConditionalTest " + testData);
    }

    public string TestFunction()
    {
        Debug.Log("TestFunction");
        return "TestFunction";
    }
}

if use #undef TEST_CONDITIONAL
No log will be write.

if use #define TEST_CONDITIONAL
TestFunction
ConditionalTest

will write to console.