Пример #1
0
        public void SetupTriggers(TerrainGridSystem tgs)
        {
            TerrainTrigger trigger = terrain.gameObject.GetComponent <TerrainTrigger> ();

            if (trigger == null)
            {
                trigger = terrain.gameObject.AddComponent <TerrainTrigger> ();
            }
            trigger.Init <TerrainCollider> (tgs);
        }
Пример #2
0
 public void SetupTriggers(TerrainGridSystem tgs)
 {
     for (int k = 0; k < rr.Length; k++)
     {
         if (rr[k].renderer == null)
         {
             continue;
         }
         if (rr[k].renderer.GetComponent <TerrainTrigger>() == null)
         {
             TerrainTrigger trigger = rr[k].renderer.gameObject.AddComponent <TerrainTrigger>();
             trigger.Init <MeshCollider>(tgs);
         }
     }
 }