private IEnumerator Transition() { if (sceneToLoad < 0) { yield break; } DontDestroyOnLoad(gameObject); var buildIndex = SceneExtension.GetCurrentSceneBuildIndex(); //FindObjectOfType<PlayerController>().enabled = false; yield return(SceneExtension.LoadMultiSceneWithBuildIndexSequence(sceneToLoad, true)); //var player = FindObjectOfType<PlayerController>(); //var cam = FindObjectOfType<PixelPerfectCamera>(); //player.enabled = false; var otherPortal = GetOtherScenePortal(buildIndex); //UpdatePlayerSpawnPosition(otherPortal, player.gameObject, cam.gameObject); //player.enabled = true; Destroy(gameObject); }