private void OnTriggerEnter(Collider other) { Colored colScript = other.gameObject.GetComponent <Colored>(); ChangeColor changeColorScript = GetComponentInParent <ChangeColor>(); if (colScript != null) { if (colScript.ganhaCor) { changeColorScript.AddColor(colScript.cores); // colScript.gameObject.SetActive(false); } else { changeColorScript.OnCollisionEnterCor(colScript); } } }