Beispiel #1
0
    /// <summary>
    /// Clears the contents of this tree node and its subtrees.
    /// </summary>
    public void Clear()
    {
        if (m_leftHashTree != null)
        {
            m_leftHashTree.Clear();
            m_leftHashTree = null;
        }

        if (m_rightHashTree != null)
        {
            m_rightHashTree.Clear();
            m_rightHashTree = null;
        }

        if (m_dynamicMeshCube != null)
        {
            m_dynamicMeshCube.Clear();
        }

        if (m_meshPrefab != null)
        {
            GameObject.DestroyImmediate(m_meshPrefab);
            m_meshPrefab = null;
        }
    }
 /// <summary>
 /// Clears all meshing data.
 /// </summary>
 public void Clear()
 {
     // i think this causes a thread contention because we are updating the mesh in the Update call
     m_isClearing  = true;
     m_insertCount = 0;
     m_regenerationQueue.Clear();
     m_meshStorage.Clear();
     m_isClearing = false;
 }