예제 #1
0
    void Update()
    {
        if (Player.People <= 0 && isFail == false)
        {
            StartCoroutine("PeopleFail");
        }
        if (Player.Policy <= 0 && isFail == false)
        {
            StartCoroutine("PolicyFail");
        }
        if (Player.Economic <= 0 && isFail == false)
        {
            StartCoroutine("EconomicFail");
        }
        if (Player.Military <= 0 && isFail == false)
        {
            StartCoroutine("MilitaryFail");
        }
        if (isFail || isWin)
        {
            if (Input.GetMouseButton(0))
            {
                SceneManager.LoadScene(0);
            }
        }

        if (Player.ProgressValue >= GameConfig.EventCount && EventCreator.NextId == -1 && isWin == false)
        {
            AudiosController.GameWin();
            StartCoroutine("Win");
        }
    }
 public void ShowNewEvent()
 {
     currentEvent = EventCreator.GetGameEvent();//获取事件
     AudiosController.ChangeEvent(currentEvent.ImageIndex);
     ShowBox.text     = currentEvent.ShowText;
     OptionAText.text = currentEvent.OptionTextA;
     OptionBText.text = currentEvent.OptionTextB;
     ChracaterObj.GetComponent <SpriteRenderer>().sprite = CharacterSprites[currentEvent.ImageIndex];
     Camera.main.GetComponent <ScrollController>().ExpandScroll();
 }
예제 #3
0
 public void StartUp()
 {
     configKey = "Audios:Uri";
     config    = new Mock <IConfiguration>();
     config.Setup(c => c[configKey]).Returns(Directory.GetCurrentDirectory());
     testAudioName = "testAudio.mp3";
     if (!File.Exists(testAudioName))
     {
         File.Create(testAudioName);
     }
     controller = new AudiosController(config.Object);
 }
예제 #4
0
 IEnumerator PolicyFail()
 {
     Debug.Log("2");
     for (int i = 0; i < 100; i++)
     {
         float x = i / 100f;
         losemask.color = new Color(0, 0, 0, x);
         yield return(new WaitForSeconds(0.01f));
     }
     isFail = true;
     FailImages[1].SetActive(true);
     AudiosController.GameOver();
     yield break;
 }
 void MoveDoor()
 {
     AudiosController.DoorMove();
     StartCoroutine("DoorAnimation");
 }
예제 #6
0
 public void ExpandScroll()
 {
     AudiosController.ScrollDown();
     StartCoroutine("expandScroll");
 }
예제 #7
0
 public void RollScroll()
 {
     AudiosController.ScrollUp();
     StartCoroutine("rollScroll");
 }