You could use this class, you just need to write methods to call OnTouch() and OnBack()
public class ObjectTree : MonoBehaviour
{
public GameObject[] ObjectsOnTouch;
public GameObject[] ObjectsOnBack;
public GameObject[] ObjectsToDisable;
public void DisableObjects()
{
foreach (var objectToDisable in ObjectsToDisable)
{
objectToDisable.SetActive(false);
}
}
public void OnTouch()
{
DisableObjects();
foreach (var objectToEnable in ObjectsOnTouch)
{
objectToEnable.SetActive(true);
}
}
public void OnBack()
{
DisableObjects();
foreach (var objectToEnable in ObjectsOnBack)
{
objectToEnable.SetActive(true);
}
}
}
Add this script to the object you will be clicking on and in the inspector drag game objects that you will enable on touch in ObjectsOnTouch field, objects that appears when going back to ObjectsOnBack field and objects that you will disable to ObjectsToDisable field.