示例#1
0
 public void teleport(TeleportGateDual gate, GameObject pinball)
 {
     pinball.transform.position = (
         pinball.transform.position +
         (
             (
                 getOtherGate(gate).transform.position
                 //- new Vector3(0, getOtherGate(gate).transform.localScale.y / 2, 0)
             ) -
             (
                 gate.transform.position
                 //+ new Vector3(0, gate.transform.localScale.y / 2, 0)
             )
         )
         ); // * bufferMagnitude;
     isTeleportFrame = true;
 }
示例#2
0
 private TeleportGateDual getOtherGate(TeleportGateDual gate)
 {
     return(gate1 == gate ? gate2 : gate1);
 }
示例#3
0
 void Awake()
 {
     gate1 = transform.Find("Gate1").gameObject.GetComponent <TeleportGateDual>();
     gate2 = transform.Find("Gate2").gameObject.GetComponent <TeleportGateDual>();
 }