unity check if gui is active and if player activated code example
Example 1: unity check if gameobject is active
// To check if a GameObject is active:
gameObject.activeSelf;
Example 2: how to check if an object is active in unity
if (myGameObject.activeSelf)