IEnumerator NextPicture()
    {
        InRoutine = true;

        if (components[index].DoneWithSlide())
        {
            yield return(new WaitForSeconds(TimeOnPicture));
        }

        ++index;

        if (index < components.Length)
        {
            components[index].OnSlide();
            yield return(new WaitForSeconds(TimeOnPicture));
        }
        else
        {
            OnPanel = false;

            MultiPanel p = GetComponentInParent <MultiPanel>();
            if (p == null || !p.NextPart())
            {
                ChapterManager.instance.NextPanel();
            }
        }
        InRoutine = false;
    }
示例#2
0
 void OnMouseDown()
 {
     if (!BeenClicked)
     {
         BeenClicked = true;
         audioManager.instance.Play("onClick");
         MultiPanel p = GetComponentInParent <MultiPanel>();
         if (p == null || !p.NextPart())
         {
             Debug.Log("NO MORE PANELS");
             ChapterManager.instance.NextPanel();
         }
     }
 }
    // Update is called once per frame
    void Update()
    {
        if (Pressed && OnPanel)
        {
            if (HoldUXIndicator)
            {
                HoldUXIndicator.SetActive(false);
            }
            if (RoundToOneDP(timer) % SpriteChangeTimer == 0)
            {
                if (timer < totalTime)
                {
                    SpriteRend.sprite = Sprites[(int)(timer / SpriteChangeTimer)];

                    if ((int)(timer / SpriteChangeTimer) == Sprites.Count - 1 && TimesLooped == TimesToRepeat)
                    {
                        ShowAllEndObjects();
                    }
                }
                else
                {
                    if (TimesLooped == TimesToRepeat)
                    {
                        OnPanel = false;
                        MultiPanel p = GetComponentInParent <MultiPanel>();
                        if (p == null || !p.NextPart())
                        {
                            Debug.Log("activating next panel from hold click times ");
                            ChapterManager.instance.NextPanel();
                        }
                    }
                    else
                    {
                        timer        = 0f;
                        TimesLooped += 1;
                    }
                }
            }
            timer += Time.deltaTime;
        }
    }