예제 #1
0
    void Update()
    {
        if (flippingStarted)
        {
            elapsedTime += Time.deltaTime;
            if (elapsedTime > DelayBeforeStart)
            {
                if (nextPageCountDown < 0)
                {
                    if ((ControledBook.CurrentPaper <= ControledBook.EndFlippingPaper &&
                         Mode == FlipMode.RightToLeft) ||
                        (ControledBook.CurrentPaper > ControledBook.StartFlippingPaper &&
                         Mode == FlipMode.LeftToRight))
                    {
                        isPageFlipping = true;
                        PageFlipper.FlipPage(ControledBook, PageFlipTime, Mode, () => { isPageFlipping = false; });
                    }
                    else
                    {
                        flippingStarted = false;
                        this.enabled    = false;
                    }

                    nextPageCountDown = PageFlipTime + TimeBetweenPages + Time.deltaTime;
                }
                nextPageCountDown -= Time.deltaTime;
            }
        }
    }
예제 #2
0
 private void PrePageHandle()
 {
     if (isPageFlipping || book.CurrentPaper <= 0)
     {
         return;
     }
     isPageFlipping = true;
     videoPlayer.Stop();
     PageFlipper.FlipPage(book, pageFlipTime, FlipMode.LeftToRight, () => {
         isPageFlipping = false;
         CheckPage(book.CurrentPaper);
     });
 }
예제 #3
0
 private void NextPageHandle()
 {
     if (isPageFlipping || book.CurrentPaper >= book.papers.Count)
     {
         return;
     }
     isPageFlipping = true;
     videoPlayer.Stop();
     PageFlipper.FlipPage(book, pageFlipTime, FlipMode.RightToLeft, () => {
         isPageFlipping = false;
         CheckPage(book.CurrentPaper);
     });
 }
예제 #4
0
 public void FlipLeftPage(Action callback = null)
 {
     if (isPageFlipping)
     {
         return;
     }
     if (ControledBook.CurrentPaper <= 0)
     {
         return;
     }
     callback += () => { isPageFlipping = false; };
     PageFlipper.FlipPage(ControledBook, PageFlipTime, FlipMode.LeftToRight, callback);
 }
예제 #5
0
 public void FlipLeftPage()
 {
     if (isPageFlipping)
     {
         return;
     }
     if (ControledBook.CurrentPaper <= 0)
     {
         return;
     }
     isPageFlipping = true;
     PageFlipper.FlipPage(ControledBook, PageFlipTime, FlipMode.LeftToRight, () => { isPageFlipping = false; });
 }
예제 #6
0
 public void FlipRightPage()
 {
     if (isPageFlipping)
     {
         return;
     }
     if (ControledBook.CurrentPaper >= ControledBook.papers.Length)
     {
         return;
     }
     isPageFlipping = true;
     PageFlipper.FlipPage(ControledBook, PageFlipTime, FlipMode.RightToLeft, () => { isPageFlipping = false; });
 }
예제 #7
0
 public void FlipRightPage(Action callback = null)
 {
     if (isPageFlipping)
     {
         return;
     }
     if (ControledBook.CurrentPaper >= ControledBook.papers.Count)
     {
         return;
     }
     isPageFlipping = true;
     callback      += () => { isPageFlipping = false; };
     PageFlipper.FlipPage(ControledBook, PageFlipTime, FlipMode.RightToLeft, callback);
 }
예제 #8
0
    void Update()
    {
        if (flippingStarted)
        {
            elapsedTime += Time.deltaTime;
            if (elapsedTime > DelayBeforeStart)
            {
                if (nextPageCountDown < 0)
                {
                    if ((ControledBook.CurrentPaper <= ControledBook.EndFlippingPaper &&
                         Mode == FlipMode.RightToLeft) ||
                        (ControledBook.CurrentPaper > ControledBook.StartFlippingPaper &&
                         Mode == FlipMode.LeftToRight))
                    {
                        isPageFlipping = true;
                        PageFlipper.FlipPage(ControledBook, PageFlipTime, Mode, () => { isPageFlipping = false; });
                    }
                    else
                    {
                        flippingStarted = false;
                        this.enabled    = false;
                    }

                    nextPageCountDown = PageFlipTime + TimeBetweenPages + Time.deltaTime;
                }
                nextPageCountDown -= Time.deltaTime;
            }
        }
        if (Input.GetKeyDown(KeyCode.C))
        {
            UImanagerRef.audioS.clip = UImanagerRef.herbierPagePlus;
            UImanagerRef.audioS.Play();
            FlipRightPage();
        }
        if (Input.GetKeyDown(KeyCode.W))
        {
            UImanagerRef.audioS.clip = UImanagerRef.herbierPageMoins;
            UImanagerRef.audioS.Play();
            FlipLeftPage();
        }
    }