Installed book plugin, fixed compiler errors
This commit is contained in:
24
Assets/External/Book-Page Curl Pro/Examples/scripts/FastForwardFlipper.cs
vendored
Normal file
24
Assets/External/Book-Page Curl Pro/Examples/scripts/FastForwardFlipper.cs
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using BookCurlPro;
|
||||
namespace BookCurlPro.Examples
|
||||
{
|
||||
public class FastForwardFlipper : MonoBehaviour
|
||||
{
|
||||
public AutoFlip flipper;
|
||||
BookPro book;
|
||||
public InputField pageNumInputField;
|
||||
public void GotoPage()
|
||||
{
|
||||
int pageNum = int.Parse(pageNumInputField.text);
|
||||
if (pageNum < 0) pageNum = 0;
|
||||
if (pageNum > flipper.ControledBook.papers.Length * 2) pageNum = flipper.ControledBook.papers.Length * 2 - 1;
|
||||
flipper.enabled = true;
|
||||
flipper.PageFlipTime = 0.2f;
|
||||
flipper.TimeBetweenPages = 0;
|
||||
flipper.StartFlipping((pageNum + 1) / 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user