how to clear console through script unity
using System.Reflection; //make sure you add this!
using UnityEngine;
void Update()
{
if (Input.GetKey("space"))
{
ClearLog() //when you call this function it will clear the console
}
}
public void ClearLog() //you can copy/paste this code to the bottom of your script
{
var assembly = Assembly.GetAssembly(typeof(UnityEditor.Editor));
var type = assembly.GetType("UnityEditor.LogEntries");
var method = type.GetMethod("Clear");
method.Invoke(new object(), null);
}
Also in C#:
- json stringify c#
- c# empty array
- sort c#
- get what week of the month c#
- MVC creating a counter for products
- c# return two variables of different types
- hasmap c#
- unity method on scene loaded
- c# inotifypropertychanged best practices
- if get key down unity
- c# convert to nullable datetime
- c sharp substring
- disable button in android studio
- change canvas color uwp c#
- c# contextswitchdeadlock
- verifyusertokenasync password reset token
- unity rotate towards mouse
- asp.netcore: develop on win10 run on ubuntu
- application.stop unity
- unity left mouse button
- how to compare datetime in c#
- how to change player cursor c# script unity
- Unity3d GPS code
- making pong in unity