Beispiel #1
0
 // Start is called before the first frame update
 void Start()
 {
     Typo.Utilities.Cameras.BasicCameraController camScript = FindObjectOfType <Typo.Utilities.Cameras.BasicCameraController>();
     if (camScript != null)
     {
         camScript.splineFollow.targetSpline = this;
     }
 }
Beispiel #2
0
 // Start is called before the first frame update
 void Start()
 {
     charScript = FindObjectOfType <TombiCharacterController>();
     //ikHandler = charScript.GetComponent<IKHandler>();
     coll = this.GetComponent <SphereCollider>();
     if (charScript != null)
     {
         rigidBody = charScript.GetComponent <Rigidbody>();
     }
     camScript               = FindObjectOfType <Typo.Utilities.Cameras.BasicCameraController>();
     currentActiveRail       = FindObjectOfType <PlayerMovementRailV1>();
     oldSwingForceMultiplier = swingForceMultiplier;
 }
Beispiel #3
0
    // The coroutine runs on its own at the same time as Update() and takes an integer indicating which scene to load.
    private IEnumerator LoadNewScene(int sceneIndex)
    {
        while (fadingOut)
        {
            yield return(null);
        }


        FindObjectOfType <AudioManager>().StopAllSounds();

        // Start an asynchronous operation to load the scene that was passed to the LoadNewScene coroutine.
        AsyncOperation asyncLoadingScreen = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(2);

        while (!asyncLoadingScreen.isDone)
        {
            yield return(null);
        }

        transitionImage.enabled = false;

        yield return(new WaitForSeconds(1));

        AsyncOperation asyncLoadScene = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(sceneIndex);

        // While the asynchronous operation to load the new scene is not yet complete, continue waiting until it's done.
        while (!asyncLoadScene.isDone)
        {
            yield return(null);
        }
        loadScene = false;

        FindObjectOfType <AudioManager>().UpdateSceneTheme(sceneIndex);

        TombiCharacterController charScript = FindObjectOfType <TombiCharacterController>();



        Typo.Utilities.Cameras.BasicCameraController camScript = FindObjectOfType <Typo.Utilities.Cameras.BasicCameraController>();

        LevelInfo lInfo = FindObjectOfType <LevelInfo>();


        if (lInfo != null)
        {
            if (lInfo.isIsometric)
            {
                charScript.movementSettings.lockZMovement = false;
                charScript.movementSettings.moveOnly      = true;

                camScript.Rotation.SetRotation(45f, 45f);
                camScript.DesiredDistance = 8;
                camScript.MaxZoomDistance = 8;
                camScript.MinZoomDistance = 8;
            }
            else
            {
                charScript.movementSettings.lockZMovement = true;
                charScript.movementSettings.moveOnly      = false;
                camScript.DesiredDistance = 6;
                camScript.MaxZoomDistance = 6;
                camScript.MinZoomDistance = 6;
            }
        }
        if (scenes[sceneIndex].inTransition)
        {
            fadingIn = true;

            StartCoroutine(FadeIn());

            if (camScript != null)
            {
                camScript.smoothCameraPosition = false;
            }

            while (fadingIn)
            {
                yield return(null);
            }
        }

        if (scenes[sceneIndex].skyboxMaterial != null)
        {
            RenderSettings.skybox = scenes[sceneIndex].skyboxMaterial;
        }

        if (camScript != null)
        {
            camScript.smoothCameraPosition = true;
        }

        if (sceneIndex == 1)
        {
            scene = 5;
        }
    }