コード例 #1
0
 public void clearAll()
 {
     foreach (GameObject obj in GameObject.FindGameObjectsWithTag("Spawned Objects"))
     {
         if (obj.GetComponent <ElementProperties> ().removable)
         {
             ep.decNum(obj.name);
             BlockHover.hideGrid();
             BlockHover.hideRampGrid();
             ElementPlacing.holding  = false;
             ElementPlacing.currHold = "";
             Destroy(obj);
             ep.canPlace = true;
         }
     }
 }
コード例 #2
0
 public void RemoveElem()
 {
     if (placedElem.GetComponent <ElementProperties> ().removable)
     {
         ElementPlacing.currHold = ElementPlacing.truncateNumbers(placedElem.name);
         ElementPlacing.holding  = true;
         if (placedElem.name.Contains("ramp"))
         {
             BlockHover.showRampGrid();
             BlockHover.hideGrid();
         }
         else
         {
             BlockHover.showGrid();
             BlockHover.hideRampGrid();
         }
         ep.decNum(placedElem.name);
         Destroy(placedElem);
         placedElem  = null;
         ep.canPlace = true;
     }
 }