Ejemplo n.º 1
0
 /**
  * Colors the trap at the given position if one exists. Returns that trap's SpriteRenderer whcih should be passed into UnhighlightTrap.
  */
 public AbstractTrap HighlightTrap(Vector3 screenPos, Color color)
 {
     if (oGrid.CheckCell(screenPos))
     {
         AbstractTrap trap = (AbstractTrap)oGrid.GetCellObject(screenPos);
         trap.SetColor(color);
         return(trap);
     }
     return(null);
 }
Ejemplo n.º 2
0
    private void DeleteTrap(Vector2 coords)
    {
        Vector2Int iCoords = new Vector2Int((int)coords.x, (int)coords.y);

        trapCurrentNumber[(int)((AbstractTrap)objectGrid.GetCellObject(iCoords)).GetTrapType()]--;
        objectGrid.DeleteCellObject(iCoords);
        if (PlayerPrefs.GetInt("IsNavigator") == 0)
        {
            PV.RPC("DeleteTrap", RpcTarget.Others, coords);
        }
    }