// Use this for initialization
    void Start()
    {
        x = y = 0;

        xtionInterface     = GameObject.Find("CameraInterface").GetComponent <XtionInterface>();
        terrainUpdateDelay = new WaitForSeconds(1f);

        m_terrain     = (Terrain)gameObject.GetComponent <Terrain>();
        terrainWidth  = m_terrain.terrainData.heightmapWidth;
        terrainHeight = m_terrain.terrainData.heightmapHeight;

        // Create the game object containing the renderer
        mf = gameObject.AddComponent(typeof(MeshFilter)) as MeshFilter;
        mr = gameObject.AddComponent(typeof(MeshRenderer)) as MeshRenderer;

        // Retrieve a mesh instance
        mesh = gameObject.GetComponent <MeshFilter>().mesh;

        m_heightValues    = new float[terrainWidth, terrainHeight];
        prev_heightValues = new float[terrainWidth, terrainHeight];
    }
 // Use this for initialization
 void Start()
 {
     xtionInterface = GameObject.Find("CameraInterface").GetComponent <XtionInterface>();
     heightMap      = GameObject.Find("HeightMap").GetComponent <HeightMap>();
 }