private void SendCreationMessage(PoolableGameObject newObj) { newObj._createMsgSent = true; if (onObjectCreation != null) { onObjectCreation(newObj.gameObject); } var _poolables = newObj.GetComponentsInChildren <IGameObjectPoolable>(true); for (int i = 0; i < _poolables.Length; i++) { _poolables[i].OnObjectCreated(); } }
private void SendCreationMessage(PoolableGameObject newObj) { newObj._createMsgSent = true; // The object is inactive so we have to do this manually. MonoBehaviour[] behaviours = newObj.GetComponentsInChildren <MonoBehaviour>(true); for (int i = 0; i < behaviours.Length; i++) { MethodInfo method = behaviours[i].GetType().GetMethod( CREATION_FUNCTION, BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public, null, System.Type.EmptyTypes, null); if (method != null) { method.Invoke(behaviours[i], null); } } }
private void SendCreationMessage(PoolableGameObject newObj) { // The object is inactive so we have to do this manually. MonoBehaviour[] behaviours = newObj.GetComponentsInChildren<MonoBehaviour>(true); for (int i = 0; i < behaviours.Length; i++) { MethodInfo method = behaviours[i].GetType().GetMethod( CREATION_FUNCTION, BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public, null, System.Type.EmptyTypes, null); if (method != null) { method.Invoke(behaviours[i], null); } } }