“Debug.log Unity” Réponses codées

Impression d'unité à la console

// To print in the console use "Debug.Log()"
Debug.Log("Text");
SkelliBoi

Debug.log Unity

Debug.Log("Hello, World");
Comfortable Caterpillar

Journal d'imprimé Unity vs Debug

In Unity C#, Debug.Log() and print() are functionally identical
print() is just a bit easier to remember than Debug.Log()

print() is inherited from the MonoBehavior class, so any project without
public class ExampleClass : MonoBehavior {}
will not be able to use print()
MandMs05

Debug.log Unity

using UnityEngine;
using System.Collections;

public class MyGameClass : MonoBehaviour
{
    void Start()
    {
       	Debug.Log("Logging Message to Console");
    	Debug.LogWarning("Logging Warning to Console");
        Debug.LogError("Logging Error to Console");
    }
}
ALeonidou

Désactiver Debug.log Unity

#if UNITY_EDITOR
 Debug.logger.logEnabled = true;
 #else
 Debug.logger.logEnabled = false;
 #endif
Pleasant Puma

Réponses similaires à “Debug.log Unity”

Questions similaires à “Debug.log Unity”

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code