public void OnRenderObject() // Nakresli lines of sight { if (isAlive && sightRay != null) { DrawBrain.preDrawLine(Color.yellow); for (int i = 0; i < sightRay.Length; i++) { if (sightRayDistance[i] != range) { Color col = new Color(1, Mathf.Clamp01((processedInputsForBrain[i] + 1) / 2), 0); //Color col = new Color(1, Mathf.Clamp01((entityBrain.neuronLayers[0][i].output() + 1) / 2), 0); DrawBrain.drawLine(sightRay[i].origin, sightRay[i].origin + sightRay[i].direction.normalized * sightRayDistance[i], col); } } DrawBrain.postDrawLine(); } }
void Awake() { _instance = this; }