コード例 #1
0
 public static void MessageSystemUnregister <U>(this U receiver) where U : MonoBehaviour
 {
     foreach (var inter in typeof(U).GetInterfaces().Where(
                  i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(Receiver <>)))
     {
         var messageType = inter.GetGenericArguments().First();
         MessageSystem.GetMessageSystem()?.unregisterReceiver(messageType, receiver);
     }
 }
コード例 #2
0
 public static void MessageSystemPush <T>(this MonoBehaviour sender, T message)
 {
     MessageSystem.GetMessageSystem()?.pushMessage(message, sender.gameObject);
     return;
 }