private void AddItemToArray(OverridableMonoBehaviour behaviour) { if (behaviour.GetType().GetMethod("UpdateMe").DeclaringType != typeof(OverridableMonoBehaviour)) { regularArray = ExtendAndAddItemToArray(regularArray, behaviour); regularUpdateArrayCount++; } if (behaviour.GetType().GetMethod("FixedUpdateMe").DeclaringType != typeof(OverridableMonoBehaviour)) { fixedArray = ExtendAndAddItemToArray(fixedArray, behaviour); fixedUpdateArrayCount++; } if (behaviour.GetType().GetMethod("LateUpdateMe").DeclaringType == typeof(OverridableMonoBehaviour)) { return; } lateArray = ExtendAndAddItemToArray(lateArray, behaviour); lateUpdateArrayCount++; }
private void AddItemToArray(OverridableMonoBehaviour behaviour) { #if NETFX_CORE var type = behaviour.GetType(); var method = type.GetMethod("UpdateMe"); if (method.DeclaringType != typeof(OverridableMonoBehaviour)) { regularArray = ExtendAndAddItemToArray(regularArray, behaviour); regularUpdateArrayCount++; } if (behaviour.GetType().GetMethod("FixedUpdateMe").DeclaringType != typeof(OverridableMonoBehaviour)) { fixedArray = ExtendAndAddItemToArray(fixedArray, behaviour); fixedUpdateArrayCount++; } if (behaviour.GetType().GetMethod("LateUpdateMe").DeclaringType == typeof(OverridableMonoBehaviour)) { return; } lateArray = ExtendAndAddItemToArray(lateArray, behaviour); lateUpdateArrayCount++; #else if (behaviour.GetType().GetMethod("UpdateMe").DeclaringType != typeof(OverridableMonoBehaviour)) { regularArray = ExtendAndAddItemToArray(regularArray, behaviour); regularUpdateArrayCount++; } if (behaviour.GetType().GetMethod("FixedUpdateMe").DeclaringType != typeof(OverridableMonoBehaviour)) { fixedArray = ExtendAndAddItemToArray(fixedArray, behaviour); fixedUpdateArrayCount++; } if (behaviour.GetType().GetMethod("LateUpdateMe").DeclaringType == typeof(OverridableMonoBehaviour)) { return; } lateArray = ExtendAndAddItemToArray(lateArray, behaviour); lateUpdateArrayCount++; #endif }