Bla*_*ack 1 c# unity-game-engine
在 JavaScript 中,您可以覆盖一个函数,例如console.log():
console.log("test1");
console.log = function() { return; };
console.log("test2");Run Code Online (Sandbox Code Playgroud)
我经常用它来隐藏所有调试控制台消息。我尝试在 Unity 的 C# 中应用它,Debug.Log()如下所示:
Debug.Log = () => { return; };
Run Code Online (Sandbox Code Playgroud)
但我得到Cannot assign to Log, because it is a message group和The left-hand side of an assignment must be a variable, a property or an indexer。
是否有可能以某种方式覆盖它?我只是好奇。
| 归档时间: |
|
| 查看次数: |
1126 次 |
| 最近记录: |