コード例 #1
0
    public IEnumerator ReloadLoadSceneSmoth()
    {
        _resetingPosition = true;
        _roy   = null;
        _klunk = null;
        bool ok = false;

        LeanTween.value(gameObject, (x) => { _hidder.alpha = x; }, 0, 1, _fadeInTime)
        .setEase(_fadeInType)
        .setOnComplete(() =>
        {
            ok = true;
        });
        yield return(new WaitUntil(() => { return ok; }));

        yield return(SceneManager.LoadSceneAsync(SceneManager.GetActiveScene().buildIndex));

        LeanTween.value(gameObject, (x) => { _hidder.alpha = x; }, 1, 0, _fadeOutTime)
        .setEase(_fadeOutType);
        _resetingPosition = false;
        SceneFlow currentSceneFlow = FindObjectOfType <SceneFlow>();

        if (currentSceneFlow == null)
        {
            Destroy(gameObject);
            yield break;
        }
        _bounds     = currentSceneFlow._bounds;
        _finishZone = currentSceneFlow._finishZone;
        _roy        = FindObjectOfType <Roy>();
        _klunk      = FindObjectOfType <Klunk>();
        Destroy(currentSceneFlow.gameObject);
    }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     button    = this.GetComponent <Button>();
     sceneFlow = FindObjectOfType <SceneFlow>();
     firebase  = FindObjectOfType <FirebaseAPI>();
     button.onClick.AddListener(SceneChange);
 }
コード例 #3
0
 void Start()
 {
     button    = this.GetComponent <Button>();
     sceneFlow = FindObjectOfType <SceneFlow>();
     button.onClick.AddListener(UpdateCurrentPage);
     firebaseE = FindObjectOfType <FirebaseAPIEmployee>();
     firebaseR = FindObjectOfType <FirebaseAPIRegistration>();
 }
コード例 #4
0
    private void OnEnable()
    {
        float t = 0.05f;

        if (SceneManager.GetActiveScene().name == SceneFlow.GetSceneName(SceneList.Credits))
        {
            t = 1.5f;
        }
        else if (SceneManager.GetActiveScene().name == SceneFlow.GetSceneName(SceneList.MainTitle))
        {
            t = 2f;
        }
        StartCoroutine(SetFirstOption(t));
    }
コード例 #5
0
    void CheckHealth()
    {
        if (enemy.health <= 0 || player.health <= 0)
        {
            Debug.Log("End Game Early");
            GM.playerHealth = player.health;

            //if player wins disable the ui and turn the collection ui on
            if (GM.playerHealth == 0)
            {
                SceneFlow.RunScene(SceneList.MainScene);
            }
            else
            {
                StopAllCoroutines();
                battleUI.SetActive(false);
                cardPickerUI.SetActive(true);
            }
        }
    }
コード例 #6
0
    private void FixedUpdate()
    {
        if (_end)
        {
            return;
        }

        Collider[] cols =
            Physics.OverlapBox(transform.position, _killZone.extents, Quaternion.identity, _whereIsPlayers);

        if (cols.Length > 0)
        {
            SceneFlow sceneFlow = FindObjectOfType <SceneFlow>();
            if (sceneFlow != null)
            {
                _end = true;
                sceneFlow.StartCoroutine(sceneFlow.ReloadLoadSceneSmoth());
            }
        }
    }
コード例 #7
0
    public void ChangeScene(SceneFlow sFlow)
    {
        switch (sFlow)
        {
        case SceneFlow.PREVIOUS:

            if (_sceneIndex - 1 >= 0)
            {
                _sceneIndex--;
            }
            else
            {
                Application.Quit();
            }
            break;

        case SceneFlow.CURRENT:
            break;

        case SceneFlow.NEXT:
            _sceneIndex++;
            break;

        case SceneFlow.INFO:
            _sceneIndex = 2;
            break;

        case SceneFlow.MENU:
            _sceneIndex = 0;
            break;
        }
        if (_sceneIndex >= 0)
        {
            SceneManager.LoadScene(_sceneIndex);
        }
    }
コード例 #8
0
 public void LoadMenu()
 {
     Time.timeScale = 1f;
     SceneFlow.RunScene(SceneList.MainMenu);
 }
コード例 #9
0
ファイル: GameManager.cs プロジェクト: Oiral/Project-Hyperion
 public void StartBattle()
 {
     SavePlayerPosition();
     SceneFlow.RunScene(SceneList.Battle);
 }
コード例 #10
0
 public void ExitShop()
 {
     //exit the shop maybe
     Debug.Log("Quit Shop");
     SceneFlow.RunScene(SceneList.MainScene);
 }
コード例 #11
0
 public void AddCard(GameCard card)
 {
     //Debug.Log(card.relatedCard.nameOfCard);
     battleManager.player.currentDeck.unactiveDeck.Add(card.relatedCard);
     SceneFlow.RunScene(SceneList.MainScene);
 }
コード例 #12
0
 public void OpenShop()
 {
     SceneFlow.RunScene(SceneList.Shop);
 }
コード例 #13
0
 public void CallCredits()
 {
     SceneFlow.RunScene(SceneList.Credits);
 }
コード例 #14
0
 public void PlayGame()
 {
     SceneFlow.RunScene(SceneList.MainScene);
 }
コード例 #15
0
 //Rename Credits
 public void ReturnToMainMenu()
 {
     SceneFlow.RunScene(SceneList.MainMenu);
 }
コード例 #16
0
 void Start()
 {
     button    = this.GetComponent <Button>();
     sceneFlow = FindObjectOfType <SceneFlow>();
     button.onClick.AddListener(UpdateCurrentPage);
 }
コード例 #17
0
 public void Start()
 {
     sceneLoader = FindObjectOfType <SceneFlow>();
 }