How to import a object into a script?

Hi. Quick question. I have an object in my scene called “Enemy” and I want to test it for null every frame, so when it is destroyed, the scene will reset. This is the script I’ve got:

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

public class Example : MonoBehaviour {

    public GameObject Enemy;

	// Use this for initialization
	void Start () {

        if(Enemy == null)
        {

            Reset();
        }
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}

    void Reset()
    {
        //	The reset function will Reset the game by reloading the same level
        SceneManager.LoadScene(1);
    }
}

I know I’m doing something wrong with “importing” the object in the script, but I’m new to Unity and don’t know how.

Thank you!

Start is called once. Update is called every frame.

Move the condition into the Update loop.

In the Editor, put the script onto a blank GameObject. Drag and drop the Enemy GameObject into the Enemy field for this script.