コード例 #1
0
ファイル: DialogueManager.cs プロジェクト: Yeis/Scratchy
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            DisplayNextSentence();
        }
        else if (Input.GetKey("escape"))
        {
            Application.Quit();
        }

        if (scene.name == "Beginning_Scene" && narrator.hasFinished && !audioData.isPlaying)
        {
            StartCoroutine(ChangeSceneAfterSound("Bus_Scene"));
        }
        else if (scene.name == "Bus_Scene" && player.hasFinished && !audioData.isPlaying)
        {
            fadeController.FadeIn(1);
            StartCoroutine(ChangeSceneAfterSound("House_Overview"));
        }
        else if (scene.name == "House_Overview" && player.hasFinished && !audioData.isPlaying)
        {
            fadeController.FadeIn(1);
            StartCoroutine(ChangeSceneAfterSound("Scratch_Game"));
        }
        else if (scene.name == "End_Scene" && player.hasFinished)
        {
            fadeController.FadeIn(1);
            title.enabled   = true;
            authors.enabled = true;
            StartCoroutine(FinishGameAfterDuration(5));
        }
    }
コード例 #2
0
    public void GoMainMenu(int _sceneIndex = 0)
    {
        //Audio down
        audioMng.FadeAll(0);
        audioMng.Clear();

        fadeCtrl.FadeIn(() => { SceneManager.LoadScene(_sceneIndex); });
    }
コード例 #3
0
    IEnumerator WaitToReset()
    {
        isWait = true;
        _AudioController.ChangeMusic(_AudioController.level1);
        _FadeController.FadeIn();
        yield return(new WaitForSeconds(1f));

        SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
    }
コード例 #4
0
    public void StartIdle()
    {
        ClearIdleTimer();
        RemoveListeners();
        idleEnabled = true;
        environmentCameraController.movementFinished.AddListener(OnMovementFinished);
        fadeController.fadedIn.AddListener(OnStartFidedIn);
        fadeController.FadeIn();

        idleStarted?.Invoke();
    }
コード例 #5
0
        private IEnumerator HandleGameOverState()
        {
            if (gameOver)
            {
                yield break;
            }
            gameOver = true;

            yield return(fadeController.FadeIn(5f));

            obstacleManager.StopSpawning();

            player.SetActive(false);
            hand.SetActive(false);

            yield return(new WaitForSeconds(1));

            player.SetActive(true);
            hand.SetActive(true);

            yield return(fadeController.FadeOut(50f));

            obstacleManager.StartSpawning();

            gameOver = false;
        }
コード例 #6
0
    public IEnumerator PopulateNewLevel()
    {
        if (isFever)
        {
            isFever = false;
            feverLight.SetActive(false);
            feverBG.SetTrigger("FeverOff");
            SoundManager.instance.PlayBGM(bgm);
            FindObjectOfType <BulletManager>().ChangeBulletType(BulletManager.BulletType.Default);

            StopCoroutine(feverRoutine);
        }

        hostageObject.SetActive(false);
        level.text = currentLevel.ToString();
        minionNum.transform.parent.gameObject.SetActive(false);

        yield return(PlanetPivot.instance.StartCoroutine(PlanetPivot.instance.RotatePlanet()));

        alertAnim.GetComponent <Animator>().SetTrigger("Alert");
        SoundManager.instance.PlaySFX(chicken);
        yield return(new WaitForSeconds(2f));

        yield return(FadeController.FadeIn(ufo.GetComponent <SpriteRenderer>()));

        SoundManager.instance.PlaySFX(alien);

        PopulateLevelInfo();
        minionNum.transform.parent.gameObject.SetActive(true);
    }
コード例 #7
0
    IEnumerator Respawn(int m_index, bool val)
    {
        float t = 0.5f;

        if (val)
        {
            yield return(StartCoroutine(fade.FadeOut()));
        }
        yield return(new WaitForSeconds(.5f));

        while (t > 0)
        {
            yield return(null);

            t -= Time.deltaTime;
            bicycle.transform.position    = spawnSystem.GetChild(m_index).position + (-Vector3.up * distanceSpawn);
            bicycle.transform.eulerAngles = new Vector3(0f, spawnSystem.GetChild(m_index).eulerAngles.y, 0f);
            bicycle.GetComponent <Rigidbody>().velocity = Vector3.zero;
            bicycle.BrakeExtreme();
        }

        if (val)
        {
            StartCoroutine(fade.FadeIn());
        }

        oneCall = true;
    }
コード例 #8
0
 void GoToDemoUI()
 {
     fadeScreen.FadeIn(0.1f, () =>
     {
         SceneManager.LoadSceneAsync(1);
     });
 }
コード例 #9
0
    private void Start()
    {
        m_fadeController = FadeController.Instance;
        m_fadeController.SetSortingOrder(1);
        m_fadeController.FadeIn(1.0f, Color.black);

        FadeController.Instance.FadeIn(1.0f);
    }
コード例 #10
0
    private IEnumerator DoTransition(SceneTransitionZone sceneTransition)
    {
        zoomSound.Play();
        yield return(fadeController.FadeOut(Color.black, fadeDuration));

        gameObject.transform.position = sceneTransition.target.spawnPoint;
        yield return(fadeController.FadeIn(fadeDuration));
    }
コード例 #11
0
ファイル: ChangeScene.cs プロジェクト: dvyurij/InternProj
 IEnumerator Activate()
 {
     m_fader.FadeIn(2.0f, () => {
         UnityEngine.Debug.Log("Fade In");
         async.allowSceneActivation = true;
     });
     yield return(null);
 }
コード例 #12
0
    public IEnumerator ScreenFade(float fadeOutTime, float fadeInTime, Color screenColor)
    {
        yield return(fadeController.FadeOut(screenColor, fadeOutTime));

        yield return(new WaitForSeconds(0.5f));

        yield return(fadeController.FadeIn(fadeInTime));
    }
コード例 #13
0
    public IEnumerator StartGame()
    {
        canvas.enabled = false;
        yield return(fadeController.FadeOut(Color.black, fadeDuration));

        SwitchToPlayer();
        yield return(fadeController.FadeIn(fadeDuration));
    }
コード例 #14
0
ファイル: UI.cs プロジェクト: pknu-wap/Rogue-like2D-2019-2nd-
    // Update is called once per frame

    public void OnStartButton(string scene)
    {
        clicked        = true;
        Time.timeScale = 1.0f;
        fader.FadeIn(1.0f, () =>
        {
            SceneManager.LoadScene(scene);
        });
    }
コード例 #15
0
 private void Start()
 {
     cf = canvasFinish;
     cf.SetActive(false);
     isPlay = false;
     counter.gameObject.SetActive(false);
     title.gameObject.SetActive(false);
     StartCoroutine(fadeController.FadeIn());
 }
コード例 #16
0
    IEnumerator Activate()
    {
        fader.FadeIn(3f);
        yield return(new WaitForSeconds(3f));

        fader.FadeOut(2f, () => {
            UnityEngine.SceneManagement.SceneManager.LoadSceneAsync("1_StartScene");
        });
    }
コード例 #17
0
    IEnumerator LoadSceneCR(int sceneIndex, float fadeOutTime, float fadeInTime)
    {
        FadeController.FadeOut(fadeOutTime);
        yield return(new WaitForSeconds(fadeOutTime));

        SceneManager.LoadScene(sceneIndex);
        FadeController.FadeIn(fadeInTime);
        instance.changingScenes = false;
    }
コード例 #18
0
    IEnumerator Activate()
    {
        yield return(null);

        fader.FadeIn(1f, () => {
            UnityEngine.SceneManagement.SceneManager.LoadSceneAsync("3_GameScene");
            Fade.SetActive(false);
        });
    }
コード例 #19
0
    void Start()
    {
        _highlight      = transform.Find("Highlight").gameObject;
        _gameController = GameObject.Find("GameController").GetComponent <GameController>();

        _fadeController = transform.parent.parent.Find("black_screen").GetComponent <FadeController>();

        StartCoroutine(_fadeController.FadeIn(0.35f));
    }
コード例 #20
0
 void NextDialogo()
 {
     isFirstNext = true;
     idFala      = 0;
     idDialogo++;
     if (idDialogo >= dialogo.Length) //ultima cena
     {
         isLastScene = true;
         canvasText.SetActive(false);
         _FadeController.FadeIn();
         StartCoroutine("WaitFadeOut");
     }
     else
     {
         _FadeController.FadeIn();
         StartCoroutine("WaitFadeOut");
         UpdateFalasList();
     }
 }
コード例 #21
0
    IEnumerator WaitFadeIn()
    {
        _FadeController.FadeIn();
        yield return(new WaitForSeconds(timeToFadeOut * 2));

        if (_FadeController.isFadeComplete == true)
        {
            SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
        }
    }
コード例 #22
0
 // Start is called before the first frame update
 void Start()
 {
     fader.FadeIn();
     drawTime = defaultTime;
     for (int i = 0; i < rankScore.Length; i++)
     {
         //順位事の付加ポイントを格納しとく
         rankScore[i] = 100 - (25 * i);
     }
 }
コード例 #23
0
 private void Update()
 {
     if (Input.anyKeyDown) {
         m_isIn = !m_isIn;
         if (m_isIn) {
             m_fadeController.FadeIn(m_fadeInTime, m_fadeInColor);
         } else {
             m_fadeController.FadeOut(m_fadeOutTime, m_fadeOutColor);
         }
     }
 }
コード例 #24
0
 private void Start()
 {
     m_fc = FindObjectOfType <FadeController>();
     m_am = FindObjectOfType <AudioManager>();
     if (m_fc)
     {
         Debug.Log($"GameManager::{m_fc.GetType().ToString()}");
     }
     PlayerIsFound = false;
     m_fc.FadeIn(m_waitoToStartFadeIn);
 }
コード例 #25
0
ファイル: Spawner.cs プロジェクト: Yeis/Scratchy
    void Start()
    {
        screenBounds   = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width, Screen.height, Camera.main.transform.position.z));
        audioData      = GetComponent <AudioSource>();
        fadeController = GetComponent <FadeController>();
        //ensure game start with fade black
        fadeController.FadeIn(0);

        fadeController.FadeOut(2);
        StartCoroutine(ItchSpawner());
    }
コード例 #26
0
    private void Start()
    {
        m_fadeController = FadeController.Instance;
        m_fadeController.SetSortingOrder(0);
        m_fadeController.FadeIn(1.0f, Color.black);

        if (TextObj != null)
        {
            TextObj.SetActive(false);
        }
    }
コード例 #27
0
    IEnumerator GameOverEvent_()
    {
        _musicPlayer.PlayPlayerDeath();
        yield return(StartCoroutine(_uiController.ShowGameOver()));

        yield return(new WaitForSeconds(3f));

        yield return(StartCoroutine(_blackScreenFadeController.FadeIn(1)));

        yield return(new WaitForSeconds(1f));

        GameObject.Find("LevelManager").GetComponent <Level> ().LoadStartMenu();
    }
コード例 #28
0
 private void Start()
 {
     m_fc          = FindObjectOfType <FadeController>();
     m_ac          = FindObjectOfType <AudioController>();
     m_audioSource = GetComponent <AudioSource>();
     if (m_loadSceneName != null)
     {
         Debug.Log($"{m_loadSceneName}をロードする準備ができました");
     }
     else
     {
         Debug.LogError("シーンを設定してください");
     }
     m_fc.FadeIn(m_waitTimeToFadeIn);
 }
コード例 #29
0
    private IEnumerator LoadLevel(int levelId, bool resetHp = false)
    {
        yield return(StartCoroutine(_fadeController.FadeIn()));

        SceneManager.LoadScene(levelId, LoadSceneMode.Single);
        foreach (GameObject g in _playerObjects)
        {
            g.SetActive(true);
        }
        if (resetHp)
        {
            _scriptablePlayer._lifes = 3;
        }
        yield return(StartCoroutine(_fadeController.FadeOut()));
    }
コード例 #30
0
    IEnumerator FadeInScene()
    {
        yield return(StartCoroutine(FadeController.FadeIn(reviveScene)));

        scoreObject.gameObject.GetComponent <RectTransform>().DOLocalMoveX(1080 / 2, 1, true);
        //scoreObject.gameObject.transform.DOMoveX(0, 1f, true);
        yield return(new WaitForSeconds(1f));

        finalScore.GetComponent <CanvasGroup>().DOFade(1, 0.5f);
        yield return(new WaitForSeconds(0.5f));

        bestScore.GetComponent <CanvasGroup>().DOFade(1, 0.5f);
        yield return(new WaitForSeconds(0.5f));

        todayBest.GetComponent <CanvasGroup>().DOFade(1, 0.5f);
        yield return(new WaitForSeconds(0.5f));

        StartCoroutine(FadeController.FadeIn(adsObject));
    }