コード例 #1
0
 void Awake()
 {
     //Debug.Log(PlayerModule.Instance().unlockLevelList.Count);
     // Init Select Panel
     if (PlayerModule.Instance().unlockLevelList.Count > 0)
     {
         if (PlayerModule.Instance().unlockLevelList.Contains(MainBehaviour.startScene))
         {
             selectPanel.ShowBeachIcon();
         }
         if (PlayerModule.Instance().unlockLevelList.Contains(MainBehaviour.forestScene))
         {
             selectPanel.ShowForestIcon();
         }
         if (PlayerModule.Instance().unlockLevelList.Contains(MainBehaviour.caveScene))
         {
             selectPanel.ShowCaveIcon();
         }
         if (PlayerModule.Instance().unlockLevelList.Contains(MainBehaviour.townScene))
         {
             selectPanel.ShowTownIcon();
         }
         if (PlayerModule.Instance().unlockLevelList.Contains(MainBehaviour.alleyScene))
         {
             selectPanel.ShowAlleyIcon();
         }
         selectPanel.SetPathSprite("select_path" + PlayerModule.Instance().unlockLevelList.Count);
     }
 }
コード例 #2
0
    public void InitLoginUI()
    {
        //this.menuPanel.Invoke("DisableButtons",0);
        //load plot caption if game first play
        if (PlayerModule.Instance().IsChooseLevel)
        {
            OnChooseLevelListener();
            return;
        }

        if (PlayerModule.Instance().IsFirstPlay)
        {
            this.logoPanel.ShowLogoPanel(true);
            this.logoPanel.ShowStudio(false);
            this.logoPanel.ShowLeftSpeaker(false);
            this.logoPanel.ShowRightSpeaker(false);
            this.logoPanel.ShowCaptions(false);
            this.menuPanel.ShowMenuPanel(false);
            this.menuPanel.DisableButtons();
            this.menuPanel.ShowSecondPlayUI(false);

            Invoke("LeftSpeakerCheck", logoTime);
            Invoke("RightSpeakerCheck", checkTime + logoTime);
            Invoke("PlayLoginPlot", checkTime * 2 + logoTime);
            menuTime = checkTime * 2 + logoTime + soloTrigger[PlotCaptionMap.Count - 1] + 5.0f;
        }
        else
        {
            this.logoPanel.ShowStudio(true);
            this.logoPanel.ShowLogoPanel(false);
            menuTime = 0;            //logoTime;
        }

        Invoke("LoadMenu", menuTime);
    }
コード例 #3
0
ファイル: MainBehaviour.cs プロジェクト: zhouchuan/Essence
 private void InitGameData()
 {
     if (!PlayerModule.Instance().PlayerDataExist())
     {
         Debug.Log("Create Game Data File!");
         PlayerModule.Instance().WritePlayerData();
     }
 }
コード例 #4
0
ファイル: LabPlotScript.cs プロジェクト: zhouchuan/Essence
 // Trigger go to sofa room down
 void TriggerFinalRoom2()
 {
     //trigger light
     watchPos = watchPos2;
     watchRot = watchRot2;
     spotLightDown.gameObject.SetActive(true);
     PlayerModule.Instance().IsTestPassed = 2;
 }
コード例 #5
0
ファイル: LabPlotScript.cs プロジェクト: zhouchuan/Essence
 // Trigger go to sofa room up
 void TriggerFinalRoom1()
 {
     //trigger light
     watchPos = watchPos1;
     watchRot = watchRot1;
     spotLightUp.gameObject.SetActive(true);
     PlayerModule.Instance().IsTestPassed = 1;
 }
コード例 #6
0
    void OnStartListener()
    {
        PlayerModule.Instance().SetPlayDate();
        PlayerModule.Instance().IsFirstPlay  = false;
        PlayerModule.Instance().IsTestPassed = 0;

        Application.LoadLevel(MainBehaviour.startScene);

        Debug.Log("Game : Start!");
    }
コード例 #7
0
ファイル: MainBehaviour.cs プロジェクト: zhouchuan/Essence
    void Awake()
    {
        DontDestroyOnLoad(gameObject);
        GenerateFile();
        ConfigMap.Instance();
        PlayerModule.Instance();
        PlotModule.Instance();

        InitGameData();
        PlayerModule.Instance().LoadPlayerData();
    }
コード例 #8
0
 // Continue to play last sence you have played
 void OnContinueListener()
 {
     if (PlayerModule.Instance().LastLevelName != null)
     {
         Application.LoadLevel(PlayerModule.Instance().LastLevelName);
     }
     else
     {
         Application.LoadLevel(MainBehaviour.startScene);
     }
 }
コード例 #9
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);
 }
コード例 #10
0
ファイル: AbsBehaviour.cs プロジェクト: zhouchuan/Essence
    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();
    }
コード例 #11
0
 // Load - Choose Level Room
 void OnChooseLevelListener()
 {
     PlayerModule.Instance().IsChooseLevel = false;
     menuPanel.ShowMenuPanel(false);
     logoPanel.ShowLogoPanel(false);
     selectPanel.ShowSelectPanel(true);
     Debug.Log(PlayerModule.Instance().unlockLevelList.Count);
     if (PlayerModule.Instance().unlockLevelList.Count > 0)
     {
         if (PlayerModule.Instance().unlockLevelList.Contains(MainBehaviour.startScene))
         {
             selectPanel.ShowBeachIcon();
         }
         if (PlayerModule.Instance().unlockLevelList.Contains(MainBehaviour.forestScene))
         {
             selectPanel.ShowForestIcon();
         }
         if (PlayerModule.Instance().unlockLevelList.Contains(MainBehaviour.caveScene))
         {
             selectPanel.ShowCaveIcon();
         }
         if (PlayerModule.Instance().unlockLevelList.Contains(MainBehaviour.townScene))
         {
             selectPanel.ShowTownIcon();
         }
         if (PlayerModule.Instance().unlockLevelList.Contains(MainBehaviour.alleyScene))
         {
             selectPanel.ShowAlleyIcon();
         }
         if (PlayerModule.Instance().unlockLevelList.Contains(MainBehaviour.labScene))
         {
             selectPanel.ShowLabIcon();
         }
         if (PlayerModule.Instance().unlockLevelList.Count == 6)
         {
             selectPanel.ShowPathTexture(true);
         }
         else
         {
             selectPanel.ShowPathTexture(false);
             selectPanel.SetPathSprite("select_path" + PlayerModule.Instance().unlockLevelList.Count);
         }
     }
 }
コード例 #12
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();
        }
    }
コード例 #13
0
ファイル: MainBehaviour.cs プロジェクト: zhouchuan/Essence
 void OnApplicationQuit()
 {
     PlayerModule.Instance().WritePlayerData();
     Debug.Log("Game : Quit & Write game info! ");
 }
コード例 #14
0
ファイル: LabPlotScript.cs プロジェクト: zhouchuan/Essence
    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);
            }
        }
    }
コード例 #15
0
 // Return to Select UI
 void OnReturnSelectListener()
 {
     PlayerModule.Instance().IsChooseLevel = true;
     Application.LoadLevel(MainBehaviour.loginScence);
 }