check color unity code example
Example: unity if color
Color myColor = new Color(210f, 2f, 2f, 1f); if(touchingPlatform && renderer.material.color == myColor){ transform.localPosition = startPosition; }
Color myColor = new Color(210f, 2f, 2f, 1f); if(touchingPlatform && renderer.material.color == myColor){ transform.localPosition = startPosition; }