private void GetTeleportMatch() { GameObject[] teles = GameObject.FindGameObjectsWithTag("TeleportPlat"); foreach (GameObject t in teles) { TeleportID teleID = t.GetComponent <TeleportID>(); if (t != this.gameObject && teleID.teleportID == id.teleportID) { otherTeleportPlat = t.GetComponent <Teleport>(); return; } } }
private void Awake() { id = GetComponent <TeleportID>(); }