コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        if (SendOnEnter == true)
        {
            foreach (GameObject EnteredObject in Sender.GetInteractors(TriggerState.Enter))
            {
                EnteredObject.GetComponent <Transform>().SetPositionAndRotation(Destination.transform.position, Destination.transform.rotation);
                ResetVelocity(EnteredObject);
            }
        }

        if (SendOnStay == true)
        {
            foreach (GameObject EnteredObject in Sender.GetInteractors(TriggerState.Stay))
            {
                EnteredObject.GetComponent <Transform>().SetPositionAndRotation(Destination.transform.position, Destination.transform.rotation);
                ResetVelocity(EnteredObject);
            }
        }
        if (SendOnExit == true)
        {
            foreach (GameObject EnteredObject in Sender.GetInteractors(TriggerState.Exit))
            {
                EnteredObject.GetComponent <Transform>().SetPositionAndRotation(Destination.transform.position, Destination.transform.rotation);
                ResetVelocity(EnteredObject);
            }
        }
    }
コード例 #2
0
 // Update is called once per frame
 void Update()
 {
     if (ReceivedList.Count > 0)
     {
         if (SendTriggerZone.GetInteractors(TriggerState.Exit).Count > 0)
         {
             foreach (GameObject Traveler in SendTriggerZone.GetInteractors(TriggerState.Exit))
             {
                 ReceivedList.Remove(Traveler);
             }
         }
     }
     if (TeleporterType != TeleporterBehaviorMode.Receiver)
     {
         if (SendTriggerZone != null)
         {
             if (SendOnEnter == true)
             {
                 if (SendTriggerZone.GetInteractors(TriggerState.Enter).Count > 0)
                 {
                     foreach (GameObject Traveler in SendTriggerZone.GetInteractors(TriggerState.Enter))
                     {
                         TeleportSend(Traveler);
                     }
                 }
             }
             if (SendOnStay == true)
             {
                 if (SendTriggerZone.GetInteractors(TriggerState.Stay).Count > 0)
                 {
                     foreach (GameObject Traveler in SendTriggerZone.GetInteractors(TriggerState.Stay))
                     {
                         TeleportSend(Traveler);
                     }
                 }
             }
             if (SendOnExit == true)
             {
                 if (SendTriggerZone.GetInteractors(TriggerState.Exit).Count > 0)
                 {
                     foreach (GameObject Traveler in SendTriggerZone.GetInteractors(TriggerState.Exit))
                     {
                         TeleportSend(Traveler);
                     }
                 }
             }
         }
     }
 }
コード例 #3
0
 // Update is called once per frame
 void Update()
 {
     if (LaunchOnEnter == true)
     {
         foreach (GameObject EnteredObject in GravityLiftZone.GetInteractors(TriggerState.Enter))
         {
             LaunchObject(EnteredObject);
         }
     }
     if (LaunchOnStay == true)
     {
         foreach (GameObject EnteredObject in GravityLiftZone.GetInteractors(TriggerState.Stay))
         {
             LaunchObject(EnteredObject);
         }
     }
     if (LaunchOnExit == true)
     {
         foreach (GameObject EnteredObject in GravityLiftZone.GetInteractors(TriggerState.Exit))
         {
             LaunchObject(EnteredObject);
         }
     }
 }