Beispiel #1
0
 /// <summary>
 /// Sends the stack event notification.
 /// </summary>
 /// <param name="desc">Event descriptor.</param>
 private void SendNotification(StackGroupEventDescriptor desc)
 {
     if (desc.sourceGroup != null)
     {
         // Send notification to source GO
         AccessUtility.SendMessageUpwards(desc.sourceGroup.transform, "OnStackGroupEvent", desc);
         foreach (GameObject receiver in desc.sourceGroup.eventAdditionalReceivers)
         {
             // Send notification to additionaly specified GOs
             AccessUtility.SendMessage(receiver.transform, "OnStackGroupEvent", desc);
         }
     }
     if (desc.destinationGroup != null && desc.sourceGroup != desc.destinationGroup && desc.destinationGroup.trashBinMode == false)
     {
         // Send notification to destination GO
         AccessUtility.SendMessageUpwards(desc.destinationGroup.transform, "OnStackGroupEvent", desc);
         foreach (GameObject receiver in desc.destinationGroup.eventAdditionalReceivers)
         {
             // Send notification to additionaly specified GOs
             AccessUtility.SendMessage(receiver.transform, "OnStackGroupEvent", desc);
         }
     }
 }