Posts

Showing posts with the label output message

output message to Unity Console - Debug.Log() v.s. Debug.LogWarning() v.s. Debug.LogError() v.s. print()

Image
 output message to Unity Console - Debug.Log() v.s. Debug.LogWarning() v.s. Debug.LogError() v.s. print() usage and description: 1.Debug.Log(string message) The message will be printed in Unity Console. You can see it in Unity Console with General mode. 2.Debug.LogWarning(string message) The message was considered as a warning. Then the message will be printed in Unity Console. You can see it in Unity Console with Warning mode. When you see it you will see a warning figure(similar to a yellow triangle). 3.Debug.LogError(string message) The message was considered as a Error. Then the message will be printed in Unity Console. You can see it in Unity Console with Error mode. When you see it you will see a Error figure(similar to a red octagon). 4.print(string message) have same result with using  Debug.Log(string message). my blogger can explain that little difference  between Debug.Log() and print() Debug.Log() v.s. print() (programmingunitycsharp.blogspot.com) screenshot: ...

Debug.Log() v.s. print()

Image
 Debug.Log() v.s. print()  difference bewtween Debug.Log() and print(): In fact, they are identical. print() is a simple encapsulation of Debug.Log() According to the following screenshot. We can know Debug.Log() is in the class UnityEngine. And print() is in the class UnityEngine.Monobehaviour. screenshot:     code: using System.Collections; using System.Collections.Generic; using UnityEngine; public class PrintScript : MonoBehaviour {     [Header("Counter")]     public int Counter = 0;     [Header("Message")]     public string Message = "not initialized!";     // Start is called before the first frame update     void Start()     {              }     // Update is called once per frame     void FixedUpdate()     {         ChangeMessage();     }     private void ChangeMessage()     { ...