Ejemplo n.º 1
0
 /// <summary>
 /// This method appends to the array of higher resolution
 /// subsets for runtime addition of terrain layers
 /// </summary>
 /// <param name="newHighResSubset"></param>
 public void AddHigherResolutionSubset(TerrainAccessor newHighResSubset)
 {
     //need to lock array here
     if (m_higherResolutionSubsets == null)
     {
         m_higherResolutionSubsets = new TerrainAccessor[0];
     }
     lock (m_higherResolutionSubsets)
     {
         TerrainAccessor[] temp_highres = new TerrainAccessor[m_higherResolutionSubsets.Length + 1];
         for (int i = 0; i < m_higherResolutionSubsets.Length; i++)
         {
             temp_highres[i] = m_higherResolutionSubsets[i];
         }
         temp_highres[temp_highres.Length - 1] = newHighResSubset;
         m_higherResolutionSubsets             = temp_highres;
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Method removes the specified high resolution subset from the
 /// array of terrain layers, decreases the array size by 1
 /// </summary>
 /// <param name="highResSubset"></param>
 public void RemoveHigherResolutionSubset(TerrainAccessor highResSubset)
 {
     // lock array here
     if (m_higherResolutionSubsets == null)
     {
         m_higherResolutionSubsets = new TerrainAccessor[0];
     }
     lock (m_higherResolutionSubsets)
     {
         TerrainAccessor[] temp_highres = new TerrainAccessor[m_higherResolutionSubsets.Length + 1];
         for (int i = 0; i < m_higherResolutionSubsets.Length; i++)
         {
             if (m_higherResolutionSubsets[i] != highResSubset)
             {
                 temp_highres[i] = m_higherResolutionSubsets[i];
             }
         }
         m_higherResolutionSubsets = temp_highres;
     }
 }