コード例 #1
0
 void InitiateTeleport(ToTeleportObject toTeleportLoc)
 {
     foreach (Collider c in colliders)
     {
         c.gameObject.transform.position = toTeleportLoc.gameObject.transform.position;
     }
     Destroy(toTeleportLoc.gameObject);
     Destroy(this.gameObject);
 }
コード例 #2
0
    // Update is called once per frame
    void Update()
    {
        ToTeleportObject to = FindObjectOfType <ToTeleportObject>();

        if (to != null)
        {
            InitiateTeleport(to);
        }
    }