23 lines
607 B
C#
23 lines
607 B
C#
using UnityEngine;
|
|
|
|
public class Teleporter : MonoBehaviour
|
|
{
|
|
public GameObject ObjectToTeleportA;
|
|
public GameObject ObjectToTeleportB;
|
|
|
|
public Transform TeleportLocationA;
|
|
public Transform TeleportLocationB;
|
|
|
|
public void TeleporObjects()
|
|
{
|
|
if (ObjectToTeleportA != null && TeleportLocationA != null)
|
|
{
|
|
ObjectToTeleportA.transform.position = TeleportLocationA.position;
|
|
}
|
|
if (ObjectToTeleportB != null && TeleportLocationB != null)
|
|
{
|
|
ObjectToTeleportB.transform.position = TeleportLocationB.position;
|
|
}
|
|
}
|
|
}
|