Ejemplo n.º 1
0
    // trigger wolf follow player
    private void CheckGameOver()
    {
        if (wrongTurnCount >= 3)
        {
            wrongTurnCount = 0;
            rightTurnCount = 0;
            runOderIndex   = 0;
            player.ResetPlayerPos(oriPlayerPos);
            isTriggerWolf = false;
            isTriggerRun  = false;
            wolf.StopAnimalSound();
            PlotModule.Instance().CaptionIndex = gameOverIndex;
            this.captionLabel.text = "GameOver! Please run again!";
            Invoke("ClearLabel", 3.0f);
            Debug.Log("Game Over! reset player position");
        }
        if (rightTurnCount >= 5 && !isSuccess)
        {
            Debug.Log("Run Success");
            this.isTriggerWolf = false;
            this.isTriggerRun  = false;
            this.isSuccess     = true;
            this.wolf.StopAnimalSound();
            this.audioSource.Stop();
            this.audioYeal.Play();
            this.audioFall.Play();
            Invoke("GotoNextLevel", 3f);
        }

        //play plot - get into next level
    }
Ejemplo n.º 2
0
 private void Init()
 {
     this.player.IsRestrictPath = true;
     guide.SetDogPosition(dogPos[dogPosIndex++]);
     PlotModule.Instance().SetPlotCaption(audioSource, captionLabel, ConfigMap.Instance().GuideCaptionMap);
     tipsPanel.ShowForwardTip(true);
 }
Ejemplo n.º 3
0
 protected override void OnLoad()
 {
     this.PlotCaptionMap = ConfigMap.Instance().SoloCaptionMap;
     this.selectPanel.ShowSelectPanel(false);
     PlotModule.Instance().AudioContainer = audioContainer;
     InitLoginUI();
 }
Ejemplo n.º 4
0
 void TriggerNextMission()
 {
     if (currentRoomIndex == nextRoomIndex)
     {
         PlotModule.Instance().SetCaptionByIndex(audioSource, captionLabel, PlotCaptionMap, 0);
         nextRoomIndex++;
     }
 }
Ejemplo n.º 5
0
 public static PlotModule Instance()
 {
     if (instance == null)
     {
         instance = new PlotModule();
     }
     return(instance);
 }
Ejemplo n.º 6
0
 void TriggerAITestFinished()
 {
     if (!this.plotStatusDic["isFinishiTestAI"])
     {
         this.plotStatusDic["isFinishiTestAI"] = true;
         PlotModule.Instance().SetCaptionByIndex(audioSource, captionLabel, PlotCaptionMap, 12);
         this.labObjects.ShowLabTest3(true);
     }
 }
Ejemplo n.º 7
0
 private void CheckNPC()
 {
     if (guide.PlayerInRange() && npcIndex < npcPos.Length)
     {
         PlotModule.Instance().SetCaptionByIndex(audioSource, captionLabel, ConfigMap.Instance().AlleyCaptionMap, GameCommon.Randomi(1, 2));
         guide.ResetDog(npcPos[npcIndex]);
         npcIndex++;
     }
 }
Ejemplo n.º 8
0
    void CheckPlayerRunOrder()
    {
        if ((Time.time - runStartTime) % durationTime < runTime)
        {
            player.IsControllable = false;
        }
        else if (runOderIndex < playerRunDir.Count)
        {
            player.IsControllable = true;
            //this.captionLabel.text = playerRunDir[runOderIndex].ToString();
            if (playerRunDir[runOderIndex] == KeyCode.LeftArrow)
            {
                audioDog.clip = audioContainer.audioPlotList[13];
                if (!audioDog.isPlaying)
                {
                    audioDog.Play();
                }
                PlotModule.Instance().PlayAudioByIndex(audioSource, 11);
            }
            else
            {
                audioDog.clip = audioContainer.audioPlotList[12];
                if (!audioDog.isPlaying)
                {
                    audioDog.Play();
                }
                PlotModule.Instance().PlayAudioByIndex(audioSource, 10);
            }

            if (Input.GetKeyDown(playerRunDir[runOderIndex]))           //LeftArrow
            {
                //wolf sound decrease;
                wolf.audioBark.volume -= 0.15f;
                rightTurnCount++;
                runOderIndex++;
                runStartTime = Time.time;
            }
            else if (Input.anyKeyDown && !Input.GetKeyDown(playerRunDir[runOderIndex]))
            {
                PlotModule.Instance().PlayAudioByIndex(audioSource, 14);
                runOderIndex++;
                wrongTurnCount++;
                runStartTime           = Time.time;
                wolf.audioBark.volume += 0.15f;
            }
        }

        //judge out of time
        if (Time.time - runStartTime > durationTime)
        {
            runOderIndex++;
            wrongTurnCount++;
            runStartTime           = Time.time;
            wolf.audioBark.volume += 0.1f;
        }
    }
Ejemplo n.º 9
0
 private void CheckEnterNextRoom()
 {
     //finished guide part - go to Next sence
     if (guide.PlayerInRange() && dogPosIndex >= dogPos.Count)
     {
         this.guide.StopAnimalSound();
         PlotModule.Instance().SetPlotCaption(audioSource, captionLabel, ConfigMap.Instance().GuideCaptionMap);
         Invoke("NextLevel", PlotModule.Instance().CurrentAudioLength);
     }
 }
Ejemplo n.º 10
0
 void OnFlexibilityTestFinished()
 {
     if (!this.plotStatusDic ["isFinishTest2"])
     {
         this.plotStatusDic ["isFinishTest2"] = true;
         this.timeLabel.gameObject.SetActive(false);
         this.labObjects.ShowLabTest2(true);
         PlotModule.Instance().SetCaptionByIndex(audioSource, captionLabel, PlotCaptionMap, 10);
     }
 }
Ejemplo n.º 11
0
 // Call when start flexibility test - animation call
 void TriggerFlexibilityTest()
 {
     if (!this.plotStatusDic["isFinishTest1"])
     {
         this.restartPos = this.player.GetPlayerPos();
         this.plotStatusDic["isFinishTest1"] = true;
         this.timeLabel.gameObject.SetActive(true);
         PlotModule.Instance().PlayAudioByName(audioWater, "Lab-water");
     }
 }
Ejemplo n.º 12
0
    public void PlaySeriesCaption(int from, int to, float triggerTimes)
    {
        PlotModule.Instance().CaptionIndex = from;
        for (int i = 0; i < to - from + 1; i++)
        {
            Invoke("PlayPlot", triggerTimes);

            triggerTimes += audioContainer.AudioLengthList[i + from];
            //Debug.Log("index :  "+PlotModule.Instance().CaptionIndex+"  "+(i+from) +"  "+triggerTimes +"  " +Time.time);
        }
    }
Ejemplo n.º 13
0
 private void LoadMenu()
 {
     this.logoPanel.ShowCaptions(false);
     this.menuPanel.ShowMenuPanel(true);
     if (!PlayerModule.Instance().IsFirstPlay)
     {
         this.menuPanel.ShowSecondPlayUI(true);
     }
     PlotModule.Instance().PlayAudioByIndex(audioSource, uibmIndex);
     this.menuPanel.Invoke("ShowButtons", 3.0f);
 }
Ejemplo n.º 14
0
    void Awake()
    {
        DontDestroyOnLoad(gameObject);
        GenerateFile();
        ConfigMap.Instance();
        PlayerModule.Instance();
        PlotModule.Instance();

        InitGameData();
        PlayerModule.Instance().LoadPlayerData();
    }
Ejemplo n.º 15
0
    protected override void OnUpdate()
    {
        PrelogueCall("PlayPrelogue");
        CheckCollision();
        InputCheck();

        if (PlotModule.Instance().CaptionIndex == 12 && !CheckPlotPlay())
        {
            Application.LoadLevel(MainBehaviour.alleyScene);
        }
    }
Ejemplo n.º 16
0
 // check is the condition satisify trigger wolf
 private void CheckWolf()
 {
     if (wolf.PlayerInRange(10) && soundCollections.Count == audioCollectionNum && !isTriggerWolf && !isSuccess)
     {
         wolf.PlayAnimalSound(true);
         SetAudioCollection(false);
         isTriggerWolf = true;
         int index = PlotModule.Instance().CaptionIndex;
         gameOverIndex = index;
         PlaySeriesCaption(index, index + 4, 3f);
     }
 }
Ejemplo n.º 17
0
    void TriggerDeath()
    {
        this.restartPanel.SetActive(true);
        this.player.IsControllable = false;
        this.mouseLook.enabled     = false;
        PlotModule.Instance().PlayAudioByName(audioCountDown, "Lab-FailAlert");

        if (this.player.GetPlayerPos().y < waterLevel)
        {
            PlotModule.Instance().PlayAudioByName(audioWaterDrop, "Lab-dropWater1");
        }
    }
Ejemplo n.º 18
0
    private void PlayLoginPlot()
    {
        this.loginCaption.SetCaptionText("");
        this.logoPanel.ShowCaptions(true);
        PlotModule.Instance().PlayAudioByIndex(audioSource, soloIndex);

        for (int i = 0; i < this.PlotCaptionMap.Count; i++)
        {
            Invoke("PlaySolo", soloTrigger[i]);
        }

        Invoke("ShowStudioLogo", 1);
    }
Ejemplo n.º 19
0
    void Awake()
    {
        this.PlotCaptionMap = new List <string>();
        PlotModule.Instance().ResetCaptionIndex();
        PlotModule.Instance().AudioContainer = audioContainer;
        if (Application.loadedLevelName != MainBehaviour.loginScence)
        {
            PlayerModule.Instance().LastLevelName = Application.loadedLevelName;
            PlayerModule.Instance().UnlockLevel(Application.loadedLevelName);
            Debug.Log(Application.loadedLevelName);
        }

        ClearLabel();
        OnLoad();
    }
Ejemplo n.º 20
0
 public bool CheckPlotPlay()
 {
     if (PlotModule.Instance().IsPlotPlaying(audioSource) && this.player != null)
     {
         this.player.IsPloting = true;
         isLabelEpt            = false;
         return(true);
     }
     else if (!isLabelEpt)
     {
         ClearLabel();
         player.IsPloting = false;
         isLabelEpt       = true;
     }
     return(false);
 }
Ejemplo n.º 21
0
    // Room2 - Jump & Climb Test
    private void FlexibilityTest()
    {
        if (!this.plotStatusDic["isFinishTest2"] && this.plotStatusDic["isFinishTest1"])
        {
            int leftSeconds = -1;

            if (!this.plotStatusDic["isTest2TimeUp"])
            {
                leftSeconds    = cdTimer.CountDownTimer(test2Time);
                timeLabel.text = "Time left: " + leftSeconds;

                waterObj.transform.localPosition += new Vector3(0f, 0.3f, 0f) * Time.deltaTime;
                if (leftSeconds == countDonwnSecond)
                {
                    // play count down every second
                    PlotModule.Instance().PlayAudioByName(audioCountDown, "CountDown-" + leftSeconds.ToString());
                    countDonwnSecond--;
                }
            }

            if (leftSeconds == 0 || this.player.IsDeath)            //&& ..touch the water
            {
                this.plotStatusDic["isTest2TimeUp"] = true;
                this.timeLabel.gameObject.SetActive(false);
                foreach (Light alertLight in alertLightList)
                {
                    alertLight.gameObject.SetActive(true);
                    alertLight.color = new Color(0.81f, 0, 0);
                }
                TriggerDeath();
            }

            if (leftSeconds == -1 || this.player.IsDeath)
            {
                //AlertLight
                foreach (Light alertLight in alertLightList)
                {
                    alertLight.intensity = 2 * (Mathf.Sin(Time.time * 2) + 2);
                }
            }
        }
    }
Ejemplo n.º 22
0
    protected override void OnUpdate()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            if (PlayerModule.Instance().IsFirstPlay&& logoPanel.gameObject.activeSelf)
            {
                CancelInvoke();
                this.audioSource.Stop();
                this.logoPanel.ShowLogoPanel(false);
                this.menuPanel.ShowMenuPanel(true);
                this.menuPanel.ShowButtons();
                PlotModule.Instance().PlayAudioByIndex(audioSource, uibmIndex);
            }

            if (selectPanel.gameObject.activeSelf)
            {
                menuPanel.ShowMenuPanel(true);
                selectPanel.ShowSelectPanel(false);
            }
            creditPanel.HideCredit();
        }
    }
Ejemplo n.º 23
0
    protected override void OnUpdate()
    {
        PrelogueCall("PlayPrelogue");
        CheckCollectSound();
        InputCheck();
        CheckWolf();

        if (isTriggerWolf && isTriggerRun)
        {
            CheckPlayerRunOrder();
            CheckGameOver();
        }

        //voiceover tips
        if (isTriggerWolf && !isTriggerRun && PlotModule.Instance().CaptionIndex >= 8 && !CheckPlotPlay())
        {
            if (Input.anyKeyDown)
            {
                isTriggerRun = true;
                runStartTime = Time.time;
            }
        }
    }
Ejemplo n.º 24
0
 //check moving, set new dog position
 private void CheckTrigger()
 {
     if (guide.PlayerInRange() && dogPosIndex < dogPos.Count)
     {
         tipsPanel.ShowForwardTip(false);
         this.guide.StopAnimalSound();
         //set position
         guide.SetDogPosition(dogPos[dogPosIndex++]);
         inputIndex++;
         Invoke("PlayDogBark", 1);
         //set caption
         if (isTrigger && PlotModule.Instance().CaptionIndex < PlotModule.Instance().AudioContainer.audioPlotList.Count)
         {
             isTrigger = false;
             PlotModule.Instance().SetPlotCaption(audioSource, captionLabel, ConfigMap.Instance().GuideCaptionMap);
         }
         return;
     }
     else
     {
         isTrigger = true;
     }
 }
Ejemplo n.º 25
0
    private void PlotEvaluate()
    {
        if (this.player.CurrentSwitchObj != null)
        {
            if (this.player.CurrentSwitchObj.tag == "Sofa")
            {
                //trigger animation
                //play plot
                this.player.IsControllable      = false;
                this.plotStatusDic["isGetSofa"] = true;
                this.player.gameObject.GetComponent <MouseLook>().enabled = false;
            }
        }

        if (plotStatusDic["isGetSofa"] && !plotStatusDic["isEvaluating"])
        {
            this.player.CurrentSwitchObj = null;

            Vector3 currentPos = this.player.GetPlayerPos();
            float   wantedX    = Mathf.Lerp(currentPos.x, watchPos.x, Time.deltaTime);
            float   wantedY    = Mathf.Lerp(currentPos.y, watchPos.y, Time.deltaTime);
            float   wantedZ    = Mathf.Lerp(currentPos.z, watchPos.z, Time.deltaTime);
            this.player.transform.position = new Vector3(wantedX, wantedY, wantedZ);

            Quaternion lookAtRot = Quaternion.LookRotation(watchRot);
            this.player.transform.rotation = Quaternion.Slerp(this.player.transform.rotation, lookAtRot, Time.deltaTime);

            if ((this.player.transform.rotation.eulerAngles - watchDir).magnitude < 1)
            {
                this.player.gameObject.GetComponent <MouseLook>().enabled = true;
                this.mouseLook.axes           = MouseLook.RotationAxes.MouseX;
                plotStatusDic["isEvaluating"] = true;
                if (watchPos.y > 0)
                {
                    PlotModule.Instance().PlayAudioByName(audioSource, "Lab-endReject");
                    screenReject.renderer.material.mainTexture = movieReject;
                    movieReject.Play();
                }
                else
                {
                    PlotModule.Instance().PlayAudioByName(audioSource, "Lab-endPass");
                    screenPass.renderer.material.mainTexture = moviePass;
                    moviePass.Play();
                }
                return;
            }
        }

        //pass test
        if (plotStatusDic["isEvaluating"])
        {
            if (PlayerModule.Instance().IsTestPassed == 1 && !this.player.IsPloting)
            {
                this.player.IsControllable = false;
                this.mouseLook.enabled     = false;
                PlotModule.Instance().PlayAudioByName(audioCountDown, "Lab-FailAlert");
                destroyPanel.SetActive(true);
            }

            if (PlayerModule.Instance().IsTestPassed == 2 && !this.player.IsPloting)
            {
                Application.LoadLevel(MainBehaviour.infinityScene);
            }
        }
    }
Ejemplo n.º 26
0
 // Call when on platform - animation call
 void TriggerFlexibilityTestTips()
 {
     PlotModule.Instance().SetCaptionByIndex(audioSource, captionLabel, PlotCaptionMap, 9);
 }
Ejemplo n.º 27
0
 //Room4 - Order Obey Test
 void TriggerOderObeyTest()
 {
     PlotModule.Instance().SetCaptionByIndex(audioSource, captionLabel, PlotCaptionMap, 13);
     this.labObjects.ShowLabTest2(false);
 }
Ejemplo n.º 28
0
 void TriggerAITestTip()
 {
     PlotModule.Instance().SetCaptionByIndex(audioSource, captionLabel, PlotCaptionMap, 11);
     this.labObjects.ShowLabTest1(false);
     this.audioWater.Pause();
 }
Ejemplo n.º 29
0
 // Trigger drop - test03
 void OnTriggerDrop()
 {
     PlotModule.Instance().PlayAudioByName(audioCountDown, "Lab-FailAlert");
     Invoke("TriggerDestroy", 1f);
 }
Ejemplo n.º 30
0
 void OnMovementTestFinished()
 {
     PlotModule.Instance().SetCaptionByIndex(audioSource, captionLabel, PlotCaptionMap, 8);
 }