123456789101112131415161718 |
- using System.Collections;
- using System.Collections.Generic;
- using JetBrains.Annotations;
- using UnityEngine;
- public class teleporter : MonoBehaviour
- {
- public Transform teleportLocation;
- private void OnTriggerEnter2D(Collider2D other) {
- if(other.tag == "Player"){
- if(other.transform == playerNetwork.localPlayerTransform){
- other.transform.position = teleportLocation.position;
- cameraRPG.instance.Teleport(teleportLocation.position);
- }
- }
- }
- }
|