help with script

i play the scene and it works ok, but when i move to another scene and came back to this scene, it said.
( MissingReferenceException: The object of type ‘TileBehaviour’ has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.)

heres the script

//
//  Tile.cs
//
//  Author:
//       Jonathan Derrough <jonathan.derrough@gmail.com>
//
//  Copyright (c) 2012 Jonathan Derrough
//
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU Lesser General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU Lesser General Public License for more details.
//
//  You should have received a copy of the GNU Lesser General Public License
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
using UnityEngine;

namespace UnitySlippyMap.Map
{
    /// <summary>
    /// The tile implementation inherits from MonoBehaviour.
    /// </summary>
    public class TileBehaviour : MonoBehaviour
    {
        #region Private members & properties

        /// <summary>
        /// The texture identifier.
        /// </summary>
        private int textureId;

        /// <summary>
        /// Gets or sets the texture identifier.
        /// </summary>
        /// <value>The texture identifier.</value>
        public int            TextureId {
            get {
                return textureId;
            }
            set {
                textureId = value;
            }
        }

        /// <summary>
        /// The showing flag.
        /// </summary>
        private bool showing = false;

        /// <summary>
        /// Gets a value indicating whether this <see cref="UnitySlippyMap.Map.Tile"/> is showing.
        /// </summary>
        /// <value><c>true</c> if showing; otherwise, <c>false</c>.</value>
        public bool Showing {
            get { return showing; }
        }

        /// <summary>
        /// The material.
        /// </summary>
        private Material material;

        /// <summary>
        /// The duration of the apparition.
        /// </summary>
        private float apparitionDuration = 0.5f;

        /// <summary>
        /// The apparition start time.
        /// </summary>
        private float apparitionStartTime = 0.0f;


        #endregion

        #region MonoBehaviour implementation

        /// <summary>
        /// Implementation of <see cref="http://docs.unity3d.com/ScriptReference/MonoBehaviour.html">MonoBehaviour</see>.Update().
        /// </summary>
        private void Update ()
        {
            if (showing) {
                float delta = Time.time - apparitionStartTime;
                float a = 1.0f;
                if (delta <= apparitionDuration) {
                    a = delta / apparitionDuration;
                } else {
                    showing = false;
                    MapBehaviour.Instance.IsDirty = true;
                }
                Color color = material.color;
                color.a = a;
                material.color = color;
            }
        }

        #endregion

        #region Public enums

        /// <summary>
        /// The anchor points enumeration.
        /// </summary>
        public enum AnchorPoint
        {
            TopLeft,
            TopCenter,
            TopRight,
            MiddleLeft,
            MiddleCenter,
            MiddleRight,
            BottomLeft,
            BottomCenter,
            BottomRight
        }

        #endregion

        #region Public methods

        /// <summary>
        /// Show this instance.
        /// </summary>
        public void Show ()
        {
            showing = true;
            Color color = material.color;
            color.a = 0.0f;
            material.color = color;
            apparitionStartTime = Time.time;
        }

        /// <summary>
        /// Creates a tile template GameObject.
        /// </summary>
        public static TileBehaviour CreateTileTemplate ()
        {
            return CreateTileTemplate ("[Tile Template]", AnchorPoint.MiddleCenter);
        }

        /// <summary>
        /// Creates a tile template GameObject.
        /// </summary>
        /// <returns>The tile template.</returns>
        /// <param name="name">Name.</param>
        public static TileBehaviour CreateTileTemplate (string name)
        {
            return CreateTileTemplate (name, AnchorPoint.MiddleCenter);
        }

        /// <summary>
        /// Creates a tile template GameObject.
        /// </summary>
        /// <returns>The tile template.</returns>
        /// <param name="anchorPoint">Anchor point.</param>
        public static TileBehaviour CreateTileTemplate (AnchorPoint anchorPoint)
        {
            return CreateTileTemplate ("[Tile Template]", anchorPoint);
        }

        /// <summary>
        /// Creates a tile template GameObject.
        /// </summary>
        /// <returns>The tile template.</returns>
        /// <param name="tileName">Tile name.</param>
        /// <param name="anchorPoint">Anchor point.</param>
        public static TileBehaviour CreateTileTemplate (string tileName, AnchorPoint anchorPoint)
        {
            GameObject tileTemplate = new GameObject (tileName);
            TileBehaviour tile = tileTemplate.AddComponent<TileBehaviour> ();
            MeshFilter meshFilter = tileTemplate.AddComponent<MeshFilter> ();
            MeshRenderer meshRenderer = tileTemplate.AddComponent<MeshRenderer> ();
            BoxCollider boxCollider = tileTemplate.AddComponent<BoxCollider> ();
         
            // add the geometry
            Mesh mesh = meshFilter.mesh;
            switch (anchorPoint) {
            case AnchorPoint.TopLeft:
                mesh.vertices = new Vector3[] {
                    new Vector3 (1.0f, 0.0f, 0.0f),
                    new Vector3 (1.0f, 0.0f, -1.0f),
                    new Vector3 (0.0f, 0.0f, -1.0f),
                    new Vector3 (0.0f, 0.0f, 0.0f)
                };
                break;
            case AnchorPoint.TopCenter:
                mesh.vertices = new Vector3[] {
                    new Vector3 (0.5f, 0.0f, 0.0f),
                    new Vector3 (0.5f, 0.0f, -1.0f),
                    new Vector3 (-0.5f, 0.0f, -1.0f),
                    new Vector3 (-0.5f, 0.0f, 0.0f)
                };
                break;
            case AnchorPoint.TopRight:
                mesh.vertices = new Vector3[] {
                    new Vector3 (0.0f, 0.0f, 0.0f),
                    new Vector3 (0.0f, 0.0f, -1.0f),
                    new Vector3 (-1.0f, 0.0f, -1.0f),
                    new Vector3 (-1.0f, 0.0f, 0.0f)
                };
                break;
            case AnchorPoint.MiddleLeft:
                mesh.vertices = new Vector3[] {
                    new Vector3 (1.0f, 0.0f, 0.5f),
                    new Vector3 (1.0f, 0.0f, -0.5f),
                    new Vector3 (0.0f, 0.0f, -0.5f),
                    new Vector3 (0.0f, 0.0f, 0.5f)
                };
                break;
            case AnchorPoint.MiddleRight:
                mesh.vertices = new Vector3[] {
                    new Vector3 (0.0f, 0.0f, 0.5f),
                    new Vector3 (0.0f, 0.0f, -0.5f),
                    new Vector3 (-1.0f, 0.0f, -0.5f),
                    new Vector3 (-1.0f, 0.0f, 0.5f)
                };
                break;
            case AnchorPoint.BottomLeft:
                mesh.vertices = new Vector3[] {
                    new Vector3 (1.0f, 0.0f, 1.0f),
                    new Vector3 (1.0f, 0.0f, 0.0f),
                    new Vector3 (0.0f, 0.0f, 0.0f),
                    new Vector3 (0.0f, 0.0f, 1.0f)
                };
                break;
            case AnchorPoint.BottomCenter:
                mesh.vertices = new Vector3[] {
                    new Vector3 (0.5f, 0.0f, 1.0f),
                    new Vector3 (0.5f, 0.0f, 0.0f),
                    new Vector3 (-0.5f, 0.0f, 0.0f),
                    new Vector3 (-0.5f, 0.0f, 1.0f)
                };
                break;
            case AnchorPoint.BottomRight:
                mesh.vertices = new Vector3[] {
                    new Vector3 (0.0f, 0.0f, 1.0f),
                    new Vector3 (0.0f, 0.0f, 0.0f),
                    new Vector3 (-1.0f, 0.0f, 0.0f),
                    new Vector3 (-1.0f, 0.0f, 1.0f)
                };
                break;
            default: // MiddleCenter
                mesh.vertices = new Vector3[] {
                    new Vector3 (0.5f, 0.0f, 0.5f),
                    new Vector3 (0.5f, 0.0f, -0.5f),
                    new Vector3 (-0.5f, 0.0f, -0.5f),
                    new Vector3 (-0.5f, 0.0f, 0.5f)
                };
                break;
            }
            mesh.triangles = new int[] { 0, 1, 2, 0, 2, 3 };
     
            // add normals
            mesh.normals = new Vector3[] {
                Vector3.up,
                Vector3.up,
                Vector3.up,
                Vector3.up
            };
            // add uv coordinates
            mesh.uv = new Vector2[] {
                new Vector2 (1.0f, 1.0f),
                new Vector2 (1.0f, 0.0f),
                new Vector2 (0.0f, 0.0f),
                new Vector2 (0.0f, 1.0f)
            };
         
            // add a material
            string shaderName = "Somian/Unlit/Transparent";
            Shader shader = Shader.Find (shaderName);
         
#if DEBUG_LOG
        Debug.Log("DEBUG: shader for tile template: " + shaderName + ", exists: " + (shader != null));
#endif
         
            tile.material = meshRenderer.material = new Material (shader);
         
            // setup the collider
            boxCollider.size = new Vector3 (1.0f, 0f, 1.0f);
     
            return tile;
        }

        /// <summary>
        /// Sets the texture.
        /// </summary>
        /// <param name="texture">Texture.</param>
        public void SetTexture (Texture2D texture)
        {
            material = this.gameObject.GetComponent<Renderer> ().material;
            material.mainTexture = texture;
            material.mainTexture.wrapMode = TextureWrapMode.Clamp;
            material.mainTexture.filterMode = FilterMode.Trilinear;
            this.GetComponent<Renderer> ().enabled = true;
            this.Show ();
        }

        /// <summary>
        /// Gets the tile key.
        /// </summary>
        /// <returns>The tile key.</returns>
        /// <param name="roundedZoom">Rounded zoom.</param>
        /// <param name="tileX">Tile x.</param>
        /// <param name="tileY">Tile y.</param>
        public static string GetTileKey (int roundedZoom, int tileX, int tileY)
        {
            return roundedZoom + "_" + tileX + "_" + tileY;
        }

        #endregion
    }

}

Here is the other script.

using UnityEngine;

using System;

using UnitySlippyMap.Map;
using UnitySlippyMap.Markers;
using UnitySlippyMap.Layers;
using ProjNet.CoordinateSystems;
using ProjNet.CoordinateSystems.Transformations;
using ProjNet.Converters.WellKnownText;
using System.IO;
using System.Collections;
using System.Collections.Generic;

public class TestMap : MonoBehaviour
{
    private MapBehaviour map;
 
    public Texture    LocationTexture;
    public Texture    MarkerTexture;
 
    private float    guiXScale;
    private float    guiYScale;
    private Rect    guiRect;
 
    private bool isPerspectiveView = false;
    private float    perspectiveAngle = 30.0f;
    private float    destinationAngle = 0.0f;
    private float    currentAngle = 0.0f;
    private float    animationDuration = 0.5f;
    private float    animationStartTime = 0.0f;
 
    private List<LayerBehaviour> layers;
    private int currentLayerIndex = 0;
 
    bool Toolbar (MapBehaviour map)
    {
        GUI.matrix = Matrix4x4.Scale (new Vector3 (guiXScale, guiXScale, 1.0f));
     
        GUILayout.BeginArea (guiRect);
     
        GUILayout.BeginHorizontal ();
     
        //GUILayout.Label("Zoom: " + map.CurrentZoom);
     
        bool pressed = false;
        if (GUILayout.RepeatButton ("+", GUILayout.ExpandHeight (true))) {
            map.Zoom (1.0f);
            pressed = true;
        }
        if (Event.current.type == EventType.Repaint) {
            Rect rect = GUILayoutUtility.GetLastRect ();
            if (rect.Contains (Event.current.mousePosition))
                pressed = true;
        }
     
        if (GUILayout.Button ("2D/3D", GUILayout.ExpandHeight (true))) {
            if (isPerspectiveView) {
                destinationAngle = -perspectiveAngle;
            } else {
                destinationAngle = perspectiveAngle;
            }
         
            animationStartTime = Time.time;
         
            isPerspectiveView = !isPerspectiveView;
        }
        if (Event.current.type == EventType.Repaint) {
            Rect rect = GUILayoutUtility.GetLastRect ();
            if (rect.Contains (Event.current.mousePosition))
                pressed = true;
        }
     
        if (GUILayout.Button ("Center", GUILayout.ExpandHeight (true))) {
            map.CenterOnLocation ();
        }
        if (Event.current.type == EventType.Repaint) {
            Rect rect = GUILayoutUtility.GetLastRect ();
            if (rect.Contains (Event.current.mousePosition))
                pressed = true;
        }
     
        string layerMessage = String.Empty;
        if (map.CurrentZoom > layers [currentLayerIndex].MaxZoom)
            layerMessage = "\nZoom out!";
        else if (map.CurrentZoom < layers [currentLayerIndex].MinZoom)
            layerMessage = "\nZoom in!";
        if (GUILayout.Button (((layers != null && currentLayerIndex < layers.Count) ? layers [currentLayerIndex].name + layerMessage : "Layer"), GUILayout.ExpandHeight (true))) {
            #if UNITY_3_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_3_6 || UNITY_3_7 || UNITY_3_8 || UNITY_3_9
            layers[currentLayerIndex].gameObject.SetActiveRecursively(false);
            #else
            layers [currentLayerIndex].gameObject.SetActive (false);
            #endif
            ++currentLayerIndex;
            if (currentLayerIndex >= layers.Count)
                currentLayerIndex = 0;
            #if UNITY_3_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_3_6 || UNITY_3_7 || UNITY_3_8 || UNITY_3_9
            layers[currentLayerIndex].gameObject.SetActiveRecursively(true);
            #else
            layers [currentLayerIndex].gameObject.SetActive (true);
            #endif
            map.IsDirty = true;
        }
     
        if (GUILayout.RepeatButton ("-", GUILayout.ExpandHeight (true))) {
            map.Zoom (-1.0f);
            pressed = true;
        }
        if (Event.current.type == EventType.Repaint) {
            Rect rect = GUILayoutUtility.GetLastRect ();
            if (rect.Contains (Event.current.mousePosition))
                pressed = true;
        }
     
        GUILayout.EndHorizontal ();
     
        GUILayout.EndArea ();
     
        return pressed;
    }
 
    private
        #if !UNITY_WEBPLAYER
        IEnumerator
            #else
            void
            #endif
            Start ()
    {
        // setup the gui scale according to the screen resolution
        guiXScale = (Screen.orientation == ScreenOrientation.Landscape ? Screen.width : Screen.height) / 480.0f;
        guiYScale = (Screen.orientation == ScreenOrientation.Landscape ? Screen.height : Screen.width) / 640.0f;
        // setup the gui area
//        guiRect = new Rect (16.0f * guiXScale, 4.0f * guiXScale, Screen.width / guiXScale - 32.0f * guiXScale, 32.0f * guiYScale);
     
        // create the map singleton
        map = MapBehaviour.Instance;
        map.CurrentCamera = Camera.main;
        map.InputDelegate += UnitySlippyMap.Input.MapInput.BasicTouchAndKeyboard;
        map.CurrentZoom = 5.0f;
        // 9 rue Gentil, Lyon
        map.CenterWGS84 = new double[2] { -53.30081389999998, -17.774114423750106};
        map.UsesLocation = true;
        map.InputsEnabled = true;
        map.ShowsGUIControls = true;
     
        map.GUIDelegate += Toolbar;
     
        layers = new List<LayerBehaviour> ();
     
        // create an OSM tile layer
        OSMTileLayer osmLayer = map.CreateLayer<OSMTileLayer> ("OSM");
        osmLayer.BaseURL = "http://a.tile.openstreetmap.org/";
     
        layers.Add (osmLayer);
     
        // create a WMS tile layer
        WMSTileLayerBehaviour wmsLayer = map.CreateLayer<WMSTileLayerBehaviour> ("WMS");
        wmsLayer.BaseURL = "http://129.206.228.72/cached/osm?"; // http://www.osm-wms.de : seems to be of very limited use
        wmsLayer.Layers = "osm_auto:all";
        #if UNITY_3_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_3_6 || UNITY_3_7 || UNITY_3_8 || UNITY_3_9
        wmsLayer.gameObject.SetActiveRecursively(false);
        #else
        wmsLayer.gameObject.SetActive (false);
        #endif
     
        layers.Add (wmsLayer);
     
        // create a VirtualEarth tile layer
        VirtualEarthTileLayerBehaviour virtualEarthLayer = map.CreateLayer<VirtualEarthTileLayerBehaviour> ("VirtualEarth");
        // Note: this is the key UnitySlippyMap, DO NOT use it for any other purpose than testing
        virtualEarthLayer.Key = "ArgkafZs0o_PGBuyg468RaapkeIQce996gkyCe8JN30MjY92zC_2hcgBU_rHVUwT";
        #if UNITY_WEBPLAYER
        virtualEarthLayer.ProxyURL = "http://reallyreallyreal.com/UnitySlippyMap/demo/veproxy.php";
        #endif
        #if UNITY_3_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_3_6 || UNITY_3_7 || UNITY_3_8 || UNITY_3_9
        virtualEarthLayer.gameObject.SetActiveRecursively(false);
        #else
        virtualEarthLayer.gameObject.SetActive (false);
        #endif
     
        layers.Add (virtualEarthLayer);
     
        #if !UNITY_WEBPLAYER // FIXME: SQLite won't work in webplayer except if I find a full .NET 2.0 implementation (for free)
        // create an MBTiles tile layer
        bool error = false;
        // on iOS, you need to add the db file to the Xcode project using a directory reference
        string mbTilesDir = "MBTiles/";
        string filename = "UnitySlippyMap_World_0_8.mbtiles";
        string filepath = null;
        if (Application.platform == RuntimePlatform.IPhonePlayer) {
            filepath = Application.streamingAssetsPath + "/" + mbTilesDir + filename;
        } else if (Application.platform == RuntimePlatform.Android) {
            // Note: Android is a bit tricky, Unity produces APK files and those are never unzip on the device.
            // Place your MBTiles file in the StreamingAssets folder (http://docs.unity3d.com/Documentation/Manual/StreamingAssets.html).
            // Then you need to access the APK on the device with WWW and copy the file to persitentDataPath
            // to that it can be read by SqliteDatabase as an individual file
            string newfilepath = Application.temporaryCachePath + "/" + filename;
            if (File.Exists (newfilepath) == false) {
                Debug.Log ("DEBUG: file doesn't exist: " + newfilepath);
                filepath = Application.streamingAssetsPath + "/" + mbTilesDir + filename;
                // TODO: read the file with WWW and write it to persitentDataPath
                WWW loader = new WWW (filepath);
                yield return loader;
                if (loader.error != null) {
                    Debug.LogError ("ERROR: " + loader.error);
                    error = true;
                } else {
                    Debug.Log ("DEBUG: will write: '" + filepath + "' to: '" + newfilepath + "'");
                    File.WriteAllBytes (newfilepath, loader.bytes);
                }
            } else
                Debug.Log ("DEBUG: exists: " + newfilepath);
            filepath = newfilepath;
        } else {
            filepath = Application.streamingAssetsPath + "/" + mbTilesDir + filename;
        }
     
        if (error == false) {
            Debug.Log ("DEBUG: using MBTiles file: " + filepath);
            //            MBTilesLayerBehaviour mbTilesLayer = map.CreateLayer<MBTilesLayerBehaviour>("MBTiles");
            //            mbTilesLayer.Filepath = filepath;
            #if UNITY_3_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_3_6 || UNITY_3_7 || UNITY_3_8 || UNITY_3_9
            mbTilesLayer.gameObject.SetActiveRecursively(false);
            #else
            //            mbTilesLayer.gameObject.SetActive(false);
            #endif
         
            //            layers.Add(mbTilesLayer);
        } else
            Debug.LogError ("ERROR: MBTiles file not found!");
     
        #endif
     
        // create some test 2D markers
        GameObject go = TileBehaviour.CreateTileTemplate (TileBehaviour.AnchorPoint.MiddleCenter).gameObject;
        go.GetComponent<Renderer> ().material.mainTexture = MarkerTexture;
        go.GetComponent<Renderer> ().material.renderQueue = 4001;
        go.transform.localScale = new Vector3(4.00f, 0.01f, 1.20f);
        go.transform.localScale /= 5.0f;
     
        go.AddComponent<CameraFacingBillboard> ().Axis = Vector3.up;
        var markerClick = go.AddComponent<MarkerClick> ();
     
     
        GameObject markerGO;
     
        markerGO = Instantiate (go) as GameObject;
        markerClick = go.AddComponent<MarkerClick> ();
        map.CreateMarker<MarkerBehaviour> ("AV. BARÃO DO RIO BRANCO, /630, DOURADINA, 44 - 36632400", new double[2] {-53.29279159999999, -23.383297506866544  }, markerGO);
     
DestroyImmediate (go);
     
        // create the location marker
        go = TileBehaviour.CreateTileTemplate ().gameObject;
        go.GetComponent<Renderer> ().material.mainTexture = LocationTexture;
        go.GetComponent<Renderer> ().material.renderQueue = 4000;
        go.transform.localScale /= 27.0f;
     
     
        markerGO = Instantiate (go) as GameObject;
        map.SetLocationMarker<LocationMarkerBehaviour> (markerGO);
     
        DestroyImmediate (go);
    }
 
    void OnApplicationQuit ()
    {
        map = null;
    }
 
    void Update ()
    {
        if (destinationAngle != 0.0f) {
            Vector3 cameraLeft = Quaternion.AngleAxis (-90.0f, Camera.main.transform.up) * Camera.main.transform.forward;
            if ((Time.time - animationStartTime) < animationDuration) {
                float angle = Mathf.LerpAngle (0.0f, destinationAngle, (Time.time - animationStartTime) / animationDuration);
                Camera.main.transform.RotateAround (Vector3.zero, cameraLeft, angle - currentAngle);
                currentAngle = angle;
            } else {
                Camera.main.transform.RotateAround (Vector3.zero, cameraLeft, destinationAngle - currentAngle);
                destinationAngle = 0.0f;
                currentAngle = 0.0f;
                map.IsDirty = true;
            }
         
            map.HasMoved = true;
        }
    }
 
    #if DEBUG_PROFILE
    void LateUpdate()
    {
        Debug.Log("PROFILE:\n" + UnitySlippyMap.Profiler.Dump());
        UnitySlippyMap.Profiler.Reset();
    }
    #endif
}

Anyone customized this code for map ??? please share your code…