Exemple #1
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.P))
     {
         if (Placer.IsPlacing)
         {
             Placer.CancelPlacement();
         }
         else
         {
             Placer.BeginPlacement(_item);
         }
     }
 }
Exemple #2
0
    public void Done(bool CancelPlacement = false)
    {
        // shitty hack to make sure a new board is generated on the next new board menu open. Works by tricking the caching system into thinking SizeX has changed
        PreviousSizeX = -69696969;

        // close the menu and disable the script
        NewBoardCanvas.enabled = false;

        if (CancelPlacement)
        {
            GameplayUIManager.UIState = UIState.None;
            BoardPlacer.CancelPlacement();
        }
        else
        {
            GameplayUIManager.UIState = UIState.BoardBeingPlaced;
        }

        //Input.ResetInputAxes(); // so that if V is used to place the board (a double tap), the board menu is not opened again // unnecessary now that we have UI states?
    }