// Use this for initialization void Start() { petList = FindObjectOfType <TamingPetList>(); gameManager = GameObject.FindGameObjectWithTag("GameManager"); change = help_text.GetComponent <Text>(); scene = gameManager.GetComponent <SceneSwitch>(); fade = screenfade.GetComponent <ScreenFade>(); plist = gameManager.GetComponent <Player_party>(); petnameChange.SetActive(false); buttons.SetActive(true); fade.FadeToClear(); if (scene.areaNum == 1) { Instantiate(areas[0]); } else if (scene.areaNum == 6) { Instantiate(areas[2]); } StartCoroutine(TimeDelay(0.5f)); }
void Update() { if (isTransitioning == false) { return; } // Animate player to position with linear steps player.position = Vector3.MoveTowards( player.position, targetPosition, transitionSpeed * Time.deltaTime); // Check if transition is finished. if (player.transform.position.Equals(targetPosition)) { fader.FadeToClear(); isTransitioning = false; } }