Exemplo n.º 1
0
 void Start()
 {
     if (detector == null)
     {
         detector = GetComponent <BaseTeleportDetector>();
     }
     if (visualizer == null)
     {
         visualizer = GetComponent <BaseTeleportVisualizer>();
     }
     if (transition == null)
     {
         transition = GetComponent <BaseTeleportTransition>();
     }
 }
        void Start()
        {
            if (detector == null)
            {
                detector = GetComponent <BaseTeleportDetector>();
            }
            if (visualizer == null)
            {
                visualizer = GetComponent <BaseTeleportVisualizer>();
            }
            if (transition == null)
            {
                transition = GetComponent <BaseTeleportTransition>();
            }
            float startingHeight = DetectPlayerHeight();

            player.transform.position = new Vector3(player.transform.position.x, player.transform.position.y + (playerHeight - startingHeight), player.transform.position.z);
        }