// Control book with Left / Right arrows
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.RightArrow))
        {
            bookController.TurnToPreviousPage();
        }
        else if (Input.GetKeyDown(KeyCode.X))
        {
            bookController.NextPage();
        }
        else if (Input.GetKeyDown(KeyCode.W))
        {
            bookController.PreviousPage();
        }
        else if (Input.GetKeyDown(KeyCode.LeftArrow))
        {
            bookController.TurnToNextPage();
        }
        else if (Input.GetKeyDown(KeyCode.Space))
        {
            if (bookController.getBookState() == AnimatedBookController.BOOK_STATE.OPENED)
            {
                bookController.CloseBook();
            }
            else if (bookController.getBookState() == AnimatedBookController.BOOK_STATE.CLOSED)
            {
                bookController.OpenBook();
            }
        }
    }
Beispiel #2
0
 public void CallTurnPreviousPage()
 {
     foreach (var hand in Player.instance.hands)
     {
         if (hand != null)
         {
             animatedBookController.TurnToPreviousPage();
         }
     }
 }
 // Control book with Left / Right arrows
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.RightArrow))
     {
         bookController.TurnToPreviousPage();
     }
     else if (Input.GetKeyDown(KeyCode.LeftArrow))
     {
         bookController.TurnToNextPage();
     }
 }