// Use this for initialization void Awake() { Portal1 = GameObject.Instantiate(P1Prefab); Portal2 = GameObject.Instantiate(P2Prefab); Portal1.SetActive(false); Portal2.SetActive(false); portalLength = Portal1.GetComponent <BoxCollider2D>().size.y *3; PPos = new PortalPosition(Portal1.transform.position, Portal2.transform.position); }
private void Start() { instance = this; }
public void Teleport(GameObject player, PortalPosition pos) { player.transform.position = new Vector3(pos.xPos, pos.yPos, 0f); }