Beispiel #1
0
 // Keep in mind that it's possible that this happens more than once, since it happens when both the current TransportBeam fully collapses or when
 // the gameObject this TransportBeamGrabber.cs is attached to leaves the trigger area.
 private void ExitTrigger2D()
 {
     insideBeam    = false;
     transportBeam = null;
     //Debug.Log(gameObject.transform.name + " left the trigger area");
     //upwardsVelocity = 0f;
 }
Beispiel #2
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.GetComponent <TransportBeam>() != null && other.gameObject.GetComponent <TransportBeam>().Tangible)
     {
         transportBeam = other.gameObject.GetComponent <TransportBeam>();
         insideBeam    = true;
     }
 }
Beispiel #3
0
    public void OnTransportBeamCollapseEnds(object sender, EventArgs e)
    {
        TransportBeam senderBeam = (TransportBeam)sender;

        if (senderBeam == transportBeam)
        {
            ExitTrigger2D();
        }
    }