void Awake() { m_AgentGenes.RandomizeGenes(genes_ranges); var sprite = GetComponent <SpriteRenderer>(); var mat = sprite.material; if (m_AgentGenes.m_IsMale) { float g = (1.0f - m_AgentGenes.m_Desirabilty); float r = 0.23f * g; var color = new Color(0.7f - r, 0.43f * g, 0.0f, 1.0f); mat.color = color; } else { mat.color = Color.gray; } }