Hide current object and show the one in string

Hello.
I pretty new to this and I want to create script where I hide current gameobject and show the one which name I write in string.
Using OnMouseDown on game object, it’s much easier to do with new scene :confused:

using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;

public class ExampleClass : MonoBehaviour
{
    public GameObject objectToHide;
    public string gameObjectName;
    void OnMouseDown()
    {
        objectToHide.SetActive(false);
        GameObject.Find(gameObjectName).SetActive(true);
    }
}