Esempio n. 1
0
        public static TEventCaster GetEventCaster <TEventCaster>(this ColliderEventData eventData) where TEventCaster : MonoBehaviour, IColliderEventCaster
        {
            if (!(eventData.eventCaster is TEventCaster))
            {
                return(null);
            }

            return(eventData.eventCaster as TEventCaster);
        }
Esempio n. 2
0
        public static bool TryGetEventCaster <TEventCaster>(this ColliderEventData eventData, out TEventCaster eventCaster) where TEventCaster : MonoBehaviour, IColliderEventCaster
        {
            eventCaster = null;

            if (!(eventData.eventCaster is TEventCaster))
            {
                return(false);
            }

            eventCaster = eventData.eventCaster as TEventCaster;
            return(true);
        }