Пример #1
0
        void Update()
        {
            if (flippingStarted)
            {
                elapsedTime += Time.deltaTime;
                if (elapsedTime > DelayBeforeStart)
                {
                    if (nextPageCountDown < 0)
                    {
                        if ((ControledBook.CurrentPaper < targetPaper &&
                             Mode == FlipMode.RightToLeft) ||
                            (ControledBook.CurrentPaper > targetPaper &&
                             Mode == FlipMode.LeftToRight))
                        {
                            isPageFlipping = true;
                            PageFlipper.FlipPage(ControledBook, PageFlipTime, Mode, () => { isPageFlipping = false; });
                        }
                        else
                        {
                            flippingStarted            = false;
                            ControledBook.interactable = isBookInteractable;
                            this.enabled = false;
                        }

                        nextPageCountDown = PageFlipTime + TimeBetweenPages + Time.deltaTime;
                    }
                    nextPageCountDown -= Time.deltaTime;
                }
            }
        }
Пример #2
0
 public void FlipLeftPage()
 {
     if (isPageFlipping)
     {
         return;
     }
     if (ControledBook.CurrentPaper <= 0)
     {
         return;
     }
     isPageFlipping = true;
     PageFlipper.FlipPage(ControledBook, PageFlipTime, FlipMode.LeftToRight, () => { isPageFlipping = false; });
 }
Пример #3
0
 public void FlipRightPage()
 {
     if (isPageFlipping)
     {
         return;
     }
     if (ControledBook.CurrentPaper >= ControledBook.papers.Count)
     {
         return;
     }
     isPageFlipping = true;
     PageFlipper.FlipPage(ControledBook, PageFlipTime, FlipMode.RightToLeft, () => { isPageFlipping = false; });
 }