Exemple #1
0
    public void InitScene()
    {
        frontScene = GameObject.Find(crtSceneName);
        rearScene  = GameObject.Find(prvSceneName);

        frontScene.SendMessage("ResetFrame");
        rearScene.SendMessage("ResetFrame");
        if (crtSceneName != prvSceneName)
        {
            rearScene.SendMessage("StopLoopCounter");
        }

        frontScene.transform.position = new Vector3(0, 0, 1);
        rearScene.transform.position  = new Vector3(0, 0, 2);

        traceText.InputTraceText("Next Chapter Invoke Start");
        Invoke("GotoNextChapter", 600f);
    }
Exemple #2
0
    public void VideoPlayControl()
    {
        if (isPlay)
        {
            isPlay = !isPlay;
            traceText.InputTraceText("Video fade out and Destroy");
            StartCoroutine(FadeOutAndDeactivate());
            chapterControl.NextChapter();
        }
        else
        {
            isPlay = !isPlay;
            traceText.InputTraceText("Video fade in and Actiate");
            VideoReplay();

            // Detect end of video clip
            vp.loopPointReached += DetectVideoEnd;
        }
    }
Exemple #3
0
    void Update()
    {
        if (isPlay)
        {
            if (!audioSourceOne.isPlaying)
            {
                crtLoopCount++;
                traceText.InputTraceText("current BGM loop count: " + crtLoopCount);

                if (crtLoopCount < maxLoopCount)
                {
                    traceText.InputTraceText("Chapter2 BGM Play");
                    ChapterTwoBGMPlay();
                }
                else if (crtLoopCount >= maxLoopCount)
                {
                    traceText.InputTraceText("Chapter3 Play");
                    isPlay       = false;
                    crtLoopCount = 0;
                    chapterControl.NextChapter();
                }
            }
        }
    }
    /****************************
     * Sequence play method
     ***************************/
    // A mrthod to play the sequence in a loop
    IEnumerator PlayLoop(float delay)
    {
        yield return(new WaitForSeconds(delay));

        frameCounter = (++frameCounter) % textures.Length;
        if (frameCounter == textures.Length - 1 && isLoopCount)
        {
            loopCounter++;
            traceText.InputTraceText("Chapter3 Scene Loop Counter: " + loopCounter + ", " + this.gameObject.name);
            if (loopCounter >= maxLoopCounter)
            {
                GotoNextChapter();
            }
        }
        StopCoroutine("PlayLoop");
    }
 public void SequenceFadeOutAndDeactivate()
 {
     traceText.InputTraceText("Chapter2 Sequence fade out and deactivate");
     StartCoroutine(FadeOutAndDeactivate());
 }