Question by
mike1233 · Jan 05, 2017 at 12:10 PM ·
profilerconsolelogconsole.log
How to disable or stop logs from generating. Sucking my perfomance BAD.
as you see in the cpu profiler read the logs to console are taking their toll and always they are circled in blue I want to fully disable or stop them from even generating, how do I 100% stop them please help. and again im not looking to mask cover them I want to fully stop them from even generating
thanks fellow unitiers !
log.png
(213.9 kB)
Comment
Answer by mikelortega · Jan 05, 2017 at 12:13 PM
where do I put that in scripts?
here?
using System.Collections.Generic; using UnityEngine;
public class BulletFireScript : $$anonymous$$onoBehaviour {
public float fireTime = .05f;
public GameObject bullet;
public int pooledAmount = 20;
List< GameObject> bullets;
Debug.logger.logEnabled = false;
void Start () {
bullets = new List <GameObject> ();
for (int i = 0; i < pooledAmount; i++) {
GameObject obj = (GameObject)Instantiate (bullet);
obj.SetActive (false);
bullets.Add (obj);
}
InvokeRepeating ("Fire", fireTime, fireTime);
}
void Fire()
{
for (int i = 0; i < bullets.Count; i++)
{
if (!bullets [i].activeInHierarchy)
{
bullets [i].transform.position = transform.position;
bullets [i].transform.rotation = transform.rotation;
bullets [i].SetActive (true);
break;
}
}
}
}
It should be better inside the Start() function.
ok I did that
it runs but im still getting many messages warnings and more
does that code stop all messages and errors and warnings or just regular NON error messages
or?