private void Teleport()
    {
        lineRenderer.enabled = false;
        teleportEnd.gameObject.SetActive(false);

        if (validTeleport)
        {
            teleportManager.Teleport(lineRenderer.GetPosition(lineRenderer.positionCount - 1));
        }
    }
예제 #2
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.tag == "Player")
        {
            manager.lastTeleporter = info;

            if (SceneManager.GetActiveScene().name != info.SceneName)
            {
                SceneManager.LoadScene(info.SceneName);
            }
            else
            {
                manager.Teleport();
            }
        }
    }