Exemple #1
0
        IEnumerator Restart()
        {
            uiManager.fadeToBlack = true;
            uiManager.hudWindow.SetActive(false);

            RGBColor col = new RGBColor(255, 200, 0);
            Color    c   = col.getRGBColor;

            UpdateStatus(c, "You Died");

            yield return(new WaitForSeconds(4f));

            uiManager.loadingScreen.SetActive(true);
            SceneManager.LoadScene(SceneManager.GetActiveScene().name);
            CheckSaveFile();
            uiManager.fadeFromBlack = true;
        }
        public override void Interact(PlayerManager playerManager)
        {
            Vector3 rotationDirection = transform.position - playerManager.transform.position;

            rotationDirection.y = 0;
            rotationDirection.Normalize();
            Quaternion tr             = Quaternion.LookRotation(rotationDirection);
            Quaternion targetRotation = Quaternion.Slerp(playerManager.transform.rotation, tr, 300 * Time.deltaTime);

            playerManager.transform.rotation = targetRotation;

            //play the animation
            playerManager.ActivateCheckPoint(playerStandingPosition);

            DisableInactiveCP();
            Invoke("EnableParticle", delay);
            //ActivateCheckPoint();

            RGBColor col = new RGBColor(200, 217, 40);
            Color    c   = col.getRGBColor;

            gameManager.UpdateStatus(c, "Bonfire Lit");
            gameManager.Saving();
        }