/// <summary> /// Broadcasts a message to the participants in a bark. Used to send the OnBarkStart and /// OnBarkEnd messages to the speaker and listener. /// </summary> /// <param name='message'> /// Message (i.e., OnBarkStart or OnBarkEnd). /// </param> /// <param name='speaker'> /// Speaker. /// </param> /// <param name='listener'> /// Listener. /// </param> private static void InformParticipants(string message, Transform speaker, Transform listener) { if (speaker != null) { speaker.BroadcastMessage(message, speaker, SendMessageOptions.DontRequireReceiver); if ((listener != null) && (listener != speaker)) { listener.BroadcastMessage(message, speaker, SendMessageOptions.DontRequireReceiver); } } }
/// <summary> /// Set the parent of some GameObject to this GameObject. The 'OnTransformHierarchyChanged' message will be broadcasted /// to child and all its children signaling it that the change occurred, unless the new child is already a child of the GameObject. /// Note that changing the parent of complex hierarchies is expensive regardless of the suppress, if you're calling this /// method frequently, you probably have a design flaw in your game. Reparenting shouldn't occur that frequently. /// </summary> /// <param name="obj"></param> /// <param name="child"></param> /// <param name="suppressChangeHierarchyMessage">Don't send the OnTransformHierarchyChanged message.</param> public static void AddChild(this Transform obj, Transform child, bool suppressChangeHierarchyMessage = false) { if (child == null) throw new System.ArgumentNullException("child"); if (child.parent == obj) return; child.parent = obj; if (!suppressChangeHierarchyMessage) child.BroadcastMessage(SPConstants.MSG_ONTRANSFORMHIERARCHYCHANGED, SendMessageOptions.DontRequireReceiver); }
/// <summary> /// Call this method to despawn a prefab using Pool Boss. All the Spawners and Killable use this method. /// </summary> /// <param name="transToDespawn">Transform to despawn</param> public static void Despawn(Transform transToDespawn) { if (!_isReady) { LevelSettings.LogIfNew(NotInitError); return; } // ReSharper disable once ConditionIsAlwaysTrueOrFalse if (transToDespawn == null) { LevelSettings.LogIfNew("No Transform passed to Despawn method."); return; } #if PHOTON_NETWORK if (!CheckIfClientSideOnly(transToDespawn)) { var targetPV = transToDespawn.GetComponent<PhotonView>(); var owner = targetPV.owner; var vId = targetPV.viewID; if (owner != null) { if (owner.ID == PhotonNetwork.player.ID) { //then we own it so we can destory it PhotonNetwork.Destroy(transToDespawn.gameObject); return; } _view.RPC("RemoteDespawn", owner, transToDespawn.name, vId); //some reason we get NullReferenceException here so im going to try sending to all targets and have the rpc function check if owner } else { //the owner of this object must have left the game or d/c //lets make the master client the owner then and then ask him to despawn targetPV.TransferOwnership(PhotonNetwork.masterClient); _view.RPC("RemoteDespawn", PhotonNetwork.masterClient, transToDespawn.name, vId); //some reason we get NullReferenceException here so im going to try sending to all targets and have the rpc function check if owner } } #endif // ReSharper disable HeuristicUnreachableCode if (Instance == null) { // Scene changing, do nothing. return; } if (!SpawnUtility.IsActive(transToDespawn.gameObject)) { return; // already sent to despawn } var itemName = GetPrefabName(transToDespawn); if (!PoolItemsByName.ContainsKey(itemName)) { if (Instance.autoAddMissingPoolItems) { CreateMissingPoolItem(transToDespawn, itemName, false); } else { LevelSettings.LogIfNew("The Transform '" + itemName + "' passed to Despawn is not in Pool Boss. Not despawning."); return; } } transToDespawn.BroadcastMessage(DespawnedMessageName, SendMessageOptions.DontRequireReceiver); var cloneList = PoolItemsByName[itemName]; SetParent(transToDespawn, Trans); SpawnUtility.SetActive(transToDespawn.gameObject, false); Instance._changes++; if (Instance.logMessages || cloneList.LogMessages) { Debug.Log("Pool Boss despawned '" + itemName + "' at " + Time.time); } cloneList.SpawnedClones.Remove(transToDespawn); cloneList.DespawnedClones.Add(transToDespawn); // ReSharper restore HeuristicUnreachableCode }
/// <summary> /// Basically the same method as Despawn() but this will be called from netowrkPooler on all clients. /// </summary> /// <param name="transToDespawn">Transform to despawn</param> public static void NetworkDespawn(Transform transToDespawn) { if (Instance.logMessages) { Debug.Log("NetworkDespawn: Player (" + PhotonNetwork.player.ID + ") is networkDespawning " + transToDespawn.name); } if (!_isReady) { LevelSettings.LogIfNew(NotInitError); return; } // ReSharper disable once ConditionIsAlwaysTrueOrFalse // ReSharper disable HeuristicUnreachableCode if (transToDespawn == null) { LevelSettings.LogIfNew("No Transform passed to Despawn method."); return; } // ReSharper restore HeuristicUnreachableCode if (Instance == null) { // Scene changing, do nothing. return; } if (!SpawnUtility.IsActive(transToDespawn.gameObject)) { return; // already sent to despawn } var itemName = GetPrefabName(transToDespawn); if (!PoolItemsByName.ContainsKey(itemName)) { if (Instance.autoAddMissingPoolItems) { CreateMissingPoolItem(transToDespawn, itemName, false); } else { LevelSettings.LogIfNew("The Transform '" + itemName + "' passed to Despawn is not in Pool Boss. Not despawning."); return; } } transToDespawn.BroadcastMessage(DespawnedMessageName, SendMessageOptions.DontRequireReceiver); var cloneList = PoolItemsByName[itemName]; SetParent(transToDespawn, Trans); SpawnUtility.SetActive(transToDespawn.gameObject, false); Instance._changes++; if (Instance.logMessages || cloneList.LogMessages) { Debug.Log("Pool Boss despawned '" + itemName + "' at " + Time.time); } cloneList.SpawnedClones.Remove(transToDespawn); cloneList.DespawnedClones.Add(transToDespawn); }
public static bool UnityEngineTransformMCall(object objSelf, string functionName, List <CQ_Value> param, out CQ_Value returnValue, bool mustEqual) { UnityEngine.Transform obj = (UnityEngine.Transform)objSelf; if (param.Count == 1 && functionName == "SetParent" && MatchType(param, new Type[] { typeof(UnityEngine.Transform) }, mustEqual)) { returnValue = null; obj.SetParent((UnityEngine.Transform)param[0].ConvertTo(typeof(UnityEngine.Transform))); return(true); } if (param.Count == 2 && functionName == "SetParent" && MatchType(param, new Type[] { typeof(UnityEngine.Transform), typeof(bool) }, mustEqual)) { returnValue = null; obj.SetParent((UnityEngine.Transform)param[0].ConvertTo(typeof(UnityEngine.Transform)), (bool)param[1].ConvertTo(typeof(bool))); return(true); } if (param.Count == 2 && functionName == "SetPositionAndRotation" && MatchType(param, new Type[] { typeof(UnityEngine.Vector3), typeof(UnityEngine.Quaternion) }, mustEqual)) { returnValue = null; obj.SetPositionAndRotation((UnityEngine.Vector3)param[0].ConvertTo(typeof(UnityEngine.Vector3)), (UnityEngine.Quaternion)param[1].ConvertTo(typeof(UnityEngine.Quaternion))); return(true); } if (param.Count == 1 && functionName == "Translate" && MatchType(param, new Type[] { typeof(UnityEngine.Vector3) }, mustEqual)) { returnValue = null; obj.Translate((UnityEngine.Vector3)param[0].ConvertTo(typeof(UnityEngine.Vector3))); return(true); } if (param.Count == 2 && functionName == "Translate" && MatchType(param, new Type[] { typeof(UnityEngine.Vector3), typeof(UnityEngine.Space) }, mustEqual)) { returnValue = null; obj.Translate((UnityEngine.Vector3)param[0].ConvertTo(typeof(UnityEngine.Vector3)), (UnityEngine.Space)param[1].ConvertTo(typeof(UnityEngine.Space))); return(true); } if (param.Count == 3 && functionName == "Translate" && MatchType(param, new Type[] { typeof(float), typeof(float), typeof(float) }, mustEqual)) { returnValue = null; obj.Translate((float)param[0].ConvertTo(typeof(float)), (float)param[1].ConvertTo(typeof(float)), (float)param[2].ConvertTo(typeof(float))); return(true); } if (param.Count == 4 && functionName == "Translate" && MatchType(param, new Type[] { typeof(float), typeof(float), typeof(float), typeof(UnityEngine.Space) }, mustEqual)) { returnValue = null; obj.Translate((float)param[0].ConvertTo(typeof(float)), (float)param[1].ConvertTo(typeof(float)), (float)param[2].ConvertTo(typeof(float)), (UnityEngine.Space)param[3].ConvertTo(typeof(UnityEngine.Space))); return(true); } if (param.Count == 2 && functionName == "Translate" && MatchType(param, new Type[] { typeof(UnityEngine.Vector3), typeof(UnityEngine.Transform) }, mustEqual)) { returnValue = null; obj.Translate((UnityEngine.Vector3)param[0].ConvertTo(typeof(UnityEngine.Vector3)), (UnityEngine.Transform)param[1].ConvertTo(typeof(UnityEngine.Transform))); return(true); } if (param.Count == 4 && functionName == "Translate" && MatchType(param, new Type[] { typeof(float), typeof(float), typeof(float), typeof(UnityEngine.Transform) }, mustEqual)) { returnValue = null; obj.Translate((float)param[0].ConvertTo(typeof(float)), (float)param[1].ConvertTo(typeof(float)), (float)param[2].ConvertTo(typeof(float)), (UnityEngine.Transform)param[3].ConvertTo(typeof(UnityEngine.Transform))); return(true); } if (param.Count == 1 && functionName == "Rotate" && MatchType(param, new Type[] { typeof(UnityEngine.Vector3) }, mustEqual)) { returnValue = null; obj.Rotate((UnityEngine.Vector3)param[0].ConvertTo(typeof(UnityEngine.Vector3))); return(true); } if (param.Count == 2 && functionName == "Rotate" && MatchType(param, new Type[] { typeof(UnityEngine.Vector3), typeof(UnityEngine.Space) }, mustEqual)) { returnValue = null; obj.Rotate((UnityEngine.Vector3)param[0].ConvertTo(typeof(UnityEngine.Vector3)), (UnityEngine.Space)param[1].ConvertTo(typeof(UnityEngine.Space))); return(true); } if (param.Count == 3 && functionName == "Rotate" && MatchType(param, new Type[] { typeof(float), typeof(float), typeof(float) }, mustEqual)) { returnValue = null; obj.Rotate((float)param[0].ConvertTo(typeof(float)), (float)param[1].ConvertTo(typeof(float)), (float)param[2].ConvertTo(typeof(float))); return(true); } if (param.Count == 4 && functionName == "Rotate" && MatchType(param, new Type[] { typeof(float), typeof(float), typeof(float), typeof(UnityEngine.Space) }, mustEqual)) { returnValue = null; obj.Rotate((float)param[0].ConvertTo(typeof(float)), (float)param[1].ConvertTo(typeof(float)), (float)param[2].ConvertTo(typeof(float)), (UnityEngine.Space)param[3].ConvertTo(typeof(UnityEngine.Space))); return(true); } if (param.Count == 2 && functionName == "Rotate" && MatchType(param, new Type[] { typeof(UnityEngine.Vector3), typeof(float) }, mustEqual)) { returnValue = null; obj.Rotate((UnityEngine.Vector3)param[0].ConvertTo(typeof(UnityEngine.Vector3)), (float)param[1].ConvertTo(typeof(float))); return(true); } if (param.Count == 3 && functionName == "Rotate" && MatchType(param, new Type[] { typeof(UnityEngine.Vector3), typeof(float), typeof(UnityEngine.Space) }, mustEqual)) { returnValue = null; obj.Rotate((UnityEngine.Vector3)param[0].ConvertTo(typeof(UnityEngine.Vector3)), (float)param[1].ConvertTo(typeof(float)), (UnityEngine.Space)param[2].ConvertTo(typeof(UnityEngine.Space))); return(true); } if (param.Count == 3 && functionName == "RotateAround" && MatchType(param, new Type[] { typeof(UnityEngine.Vector3), typeof(UnityEngine.Vector3), typeof(float) }, mustEqual)) { returnValue = null; obj.RotateAround((UnityEngine.Vector3)param[0].ConvertTo(typeof(UnityEngine.Vector3)), (UnityEngine.Vector3)param[1].ConvertTo(typeof(UnityEngine.Vector3)), (float)param[2].ConvertTo(typeof(float))); return(true); } if (param.Count == 1 && functionName == "LookAt" && MatchType(param, new Type[] { typeof(UnityEngine.Transform) }, mustEqual)) { returnValue = null; obj.LookAt((UnityEngine.Transform)param[0].ConvertTo(typeof(UnityEngine.Transform))); return(true); } if (param.Count == 2 && functionName == "LookAt" && MatchType(param, new Type[] { typeof(UnityEngine.Transform), typeof(UnityEngine.Vector3) }, mustEqual)) { returnValue = null; obj.LookAt((UnityEngine.Transform)param[0].ConvertTo(typeof(UnityEngine.Transform)), (UnityEngine.Vector3)param[1].ConvertTo(typeof(UnityEngine.Vector3))); return(true); } if (param.Count == 2 && functionName == "LookAt" && MatchType(param, new Type[] { typeof(UnityEngine.Vector3), typeof(UnityEngine.Vector3) }, mustEqual)) { returnValue = null; obj.LookAt((UnityEngine.Vector3)param[0].ConvertTo(typeof(UnityEngine.Vector3)), (UnityEngine.Vector3)param[1].ConvertTo(typeof(UnityEngine.Vector3))); return(true); } if (param.Count == 1 && functionName == "LookAt" && MatchType(param, new Type[] { typeof(UnityEngine.Vector3) }, mustEqual)) { returnValue = null; obj.LookAt((UnityEngine.Vector3)param[0].ConvertTo(typeof(UnityEngine.Vector3))); return(true); } if (param.Count == 1 && functionName == "TransformDirection" && MatchType(param, new Type[] { typeof(UnityEngine.Vector3) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Vector3); returnValue.value = obj.TransformDirection((UnityEngine.Vector3)param[0].ConvertTo(typeof(UnityEngine.Vector3))); return(true); } if (param.Count == 3 && functionName == "TransformDirection" && MatchType(param, new Type[] { typeof(float), typeof(float), typeof(float) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Vector3); returnValue.value = obj.TransformDirection((float)param[0].ConvertTo(typeof(float)), (float)param[1].ConvertTo(typeof(float)), (float)param[2].ConvertTo(typeof(float))); return(true); } if (param.Count == 1 && functionName == "InverseTransformDirection" && MatchType(param, new Type[] { typeof(UnityEngine.Vector3) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Vector3); returnValue.value = obj.InverseTransformDirection((UnityEngine.Vector3)param[0].ConvertTo(typeof(UnityEngine.Vector3))); return(true); } if (param.Count == 3 && functionName == "InverseTransformDirection" && MatchType(param, new Type[] { typeof(float), typeof(float), typeof(float) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Vector3); returnValue.value = obj.InverseTransformDirection((float)param[0].ConvertTo(typeof(float)), (float)param[1].ConvertTo(typeof(float)), (float)param[2].ConvertTo(typeof(float))); return(true); } if (param.Count == 1 && functionName == "TransformVector" && MatchType(param, new Type[] { typeof(UnityEngine.Vector3) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Vector3); returnValue.value = obj.TransformVector((UnityEngine.Vector3)param[0].ConvertTo(typeof(UnityEngine.Vector3))); return(true); } if (param.Count == 3 && functionName == "TransformVector" && MatchType(param, new Type[] { typeof(float), typeof(float), typeof(float) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Vector3); returnValue.value = obj.TransformVector((float)param[0].ConvertTo(typeof(float)), (float)param[1].ConvertTo(typeof(float)), (float)param[2].ConvertTo(typeof(float))); return(true); } if (param.Count == 1 && functionName == "InverseTransformVector" && MatchType(param, new Type[] { typeof(UnityEngine.Vector3) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Vector3); returnValue.value = obj.InverseTransformVector((UnityEngine.Vector3)param[0].ConvertTo(typeof(UnityEngine.Vector3))); return(true); } if (param.Count == 3 && functionName == "InverseTransformVector" && MatchType(param, new Type[] { typeof(float), typeof(float), typeof(float) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Vector3); returnValue.value = obj.InverseTransformVector((float)param[0].ConvertTo(typeof(float)), (float)param[1].ConvertTo(typeof(float)), (float)param[2].ConvertTo(typeof(float))); return(true); } if (param.Count == 1 && functionName == "TransformPoint" && MatchType(param, new Type[] { typeof(UnityEngine.Vector3) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Vector3); returnValue.value = obj.TransformPoint((UnityEngine.Vector3)param[0].ConvertTo(typeof(UnityEngine.Vector3))); return(true); } if (param.Count == 3 && functionName == "TransformPoint" && MatchType(param, new Type[] { typeof(float), typeof(float), typeof(float) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Vector3); returnValue.value = obj.TransformPoint((float)param[0].ConvertTo(typeof(float)), (float)param[1].ConvertTo(typeof(float)), (float)param[2].ConvertTo(typeof(float))); return(true); } if (param.Count == 1 && functionName == "InverseTransformPoint" && MatchType(param, new Type[] { typeof(UnityEngine.Vector3) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Vector3); returnValue.value = obj.InverseTransformPoint((UnityEngine.Vector3)param[0].ConvertTo(typeof(UnityEngine.Vector3))); return(true); } if (param.Count == 3 && functionName == "InverseTransformPoint" && MatchType(param, new Type[] { typeof(float), typeof(float), typeof(float) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Vector3); returnValue.value = obj.InverseTransformPoint((float)param[0].ConvertTo(typeof(float)), (float)param[1].ConvertTo(typeof(float)), (float)param[2].ConvertTo(typeof(float))); return(true); } if (param.Count == 0 && functionName == "DetachChildren") { returnValue = null; obj.DetachChildren(); return(true); } if (param.Count == 0 && functionName == "SetAsFirstSibling") { returnValue = null; obj.SetAsFirstSibling(); return(true); } if (param.Count == 0 && functionName == "SetAsLastSibling") { returnValue = null; obj.SetAsLastSibling(); return(true); } if (param.Count == 1 && functionName == "SetSiblingIndex" && MatchType(param, new Type[] { typeof(int) }, mustEqual)) { returnValue = null; obj.SetSiblingIndex((int)param[0].ConvertTo(typeof(int))); return(true); } if (param.Count == 0 && functionName == "GetSiblingIndex") { returnValue = new CQ_Value(); returnValue.type = typeof(int); returnValue.value = obj.GetSiblingIndex(); return(true); } if (param.Count == 1 && functionName == "Find" && MatchType(param, new Type[] { typeof(string) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Transform); returnValue.value = obj.Find((string)param[0].ConvertTo(typeof(string))); return(true); } if (param.Count == 1 && functionName == "IsChildOf" && MatchType(param, new Type[] { typeof(UnityEngine.Transform) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(bool); returnValue.value = obj.IsChildOf((UnityEngine.Transform)param[0].ConvertTo(typeof(UnityEngine.Transform))); return(true); } if (param.Count == 1 && functionName == "FindChild" && MatchType(param, new Type[] { typeof(string) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Transform); returnValue.value = obj.Find((string)param[0].ConvertTo(typeof(string))); return(true); } if (param.Count == 2 && functionName == "RotateAround" && MatchType(param, new Type[] { typeof(UnityEngine.Vector3), typeof(float) }, mustEqual)) { returnValue = null; obj.RotateAround((UnityEngine.Vector3)param[0].ConvertTo(typeof(UnityEngine.Vector3)), (float)param[1].ConvertTo(typeof(float))); return(true); } if (param.Count == 2 && functionName == "RotateAroundLocal" && MatchType(param, new Type[] { typeof(UnityEngine.Vector3), typeof(float) }, mustEqual)) { returnValue = null; obj.RotateAroundLocal((UnityEngine.Vector3)param[0].ConvertTo(typeof(UnityEngine.Vector3)), (float)param[1].ConvertTo(typeof(float))); return(true); } if (param.Count == 1 && functionName == "GetChild" && MatchType(param, new Type[] { typeof(int) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Transform); returnValue.value = obj.GetChild((int)param[0].ConvertTo(typeof(int))); return(true); } if (param.Count == 0 && functionName == "GetChildCount") { returnValue = new CQ_Value(); returnValue.type = typeof(int); returnValue.value = obj.GetChildCount(); return(true); } if (param.Count == 1 && functionName == "GetComponent" && MatchType(param, new Type[] { typeof(System.Type) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Component); returnValue.value = obj.GetComponent((System.Type)param[0].ConvertTo(typeof(System.Type))); return(true); } if (param.Count == 1 && functionName == "GetComponent" && MatchType(param, new Type[] { typeof(string) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Component); returnValue.value = obj.GetComponent((string)param[0].ConvertTo(typeof(string))); return(true); } if (param.Count == 2 && functionName == "GetComponentInChildren" && MatchType(param, new Type[] { typeof(System.Type), typeof(bool) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Component); returnValue.value = obj.GetComponentInChildren((System.Type)param[0].ConvertTo(typeof(System.Type)), (bool)param[1].ConvertTo(typeof(bool))); return(true); } if (param.Count == 1 && functionName == "GetComponentInChildren" && MatchType(param, new Type[] { typeof(System.Type) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Component); returnValue.value = obj.GetComponentInChildren((System.Type)param[0].ConvertTo(typeof(System.Type))); return(true); } if (param.Count == 1 && functionName == "GetComponentsInChildren" && MatchType(param, new Type[] { typeof(System.Type) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Component[]); returnValue.value = obj.GetComponentsInChildren((System.Type)param[0].ConvertTo(typeof(System.Type))); return(true); } if (param.Count == 2 && functionName == "GetComponentsInChildren" && MatchType(param, new Type[] { typeof(System.Type), typeof(bool) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Component[]); returnValue.value = obj.GetComponentsInChildren((System.Type)param[0].ConvertTo(typeof(System.Type)), (bool)param[1].ConvertTo(typeof(bool))); return(true); } if (param.Count == 1 && functionName == "GetComponentInParent" && MatchType(param, new Type[] { typeof(System.Type) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Component); returnValue.value = obj.GetComponentInParent((System.Type)param[0].ConvertTo(typeof(System.Type))); return(true); } if (param.Count == 1 && functionName == "GetComponentsInParent" && MatchType(param, new Type[] { typeof(System.Type) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Component[]); returnValue.value = obj.GetComponentsInParent((System.Type)param[0].ConvertTo(typeof(System.Type))); return(true); } if (param.Count == 2 && functionName == "GetComponentsInParent" && MatchType(param, new Type[] { typeof(System.Type), typeof(bool) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Component[]); returnValue.value = obj.GetComponentsInParent((System.Type)param[0].ConvertTo(typeof(System.Type)), (bool)param[1].ConvertTo(typeof(bool))); return(true); } if (param.Count == 1 && functionName == "GetComponents" && MatchType(param, new Type[] { typeof(System.Type) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(UnityEngine.Component[]); returnValue.value = obj.GetComponents((System.Type)param[0].ConvertTo(typeof(System.Type))); return(true); } if (param.Count == 1 && functionName == "CompareTag" && MatchType(param, new Type[] { typeof(string) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(bool); returnValue.value = obj.CompareTag((string)param[0].ConvertTo(typeof(string))); return(true); } if (param.Count == 3 && functionName == "SendMessageUpwards" && MatchType(param, new Type[] { typeof(string), typeof(object), typeof(UnityEngine.SendMessageOptions) }, mustEqual)) { returnValue = null; obj.SendMessageUpwards((string)param[0].ConvertTo(typeof(string)), (object)param[1].ConvertTo(typeof(object)), (UnityEngine.SendMessageOptions)param[2].ConvertTo(typeof(UnityEngine.SendMessageOptions))); return(true); } if (param.Count == 2 && functionName == "SendMessageUpwards" && MatchType(param, new Type[] { typeof(string), typeof(object) }, mustEqual)) { returnValue = null; obj.SendMessageUpwards((string)param[0].ConvertTo(typeof(string)), (object)param[1].ConvertTo(typeof(object))); return(true); } if (param.Count == 1 && functionName == "SendMessageUpwards" && MatchType(param, new Type[] { typeof(string) }, mustEqual)) { returnValue = null; obj.SendMessageUpwards((string)param[0].ConvertTo(typeof(string))); return(true); } if (param.Count == 2 && functionName == "SendMessageUpwards" && MatchType(param, new Type[] { typeof(string), typeof(UnityEngine.SendMessageOptions) }, mustEqual)) { returnValue = null; obj.SendMessageUpwards((string)param[0].ConvertTo(typeof(string)), (UnityEngine.SendMessageOptions)param[1].ConvertTo(typeof(UnityEngine.SendMessageOptions))); return(true); } if (param.Count == 3 && functionName == "SendMessage" && MatchType(param, new Type[] { typeof(string), typeof(object), typeof(UnityEngine.SendMessageOptions) }, mustEqual)) { returnValue = null; obj.SendMessage((string)param[0].ConvertTo(typeof(string)), (object)param[1].ConvertTo(typeof(object)), (UnityEngine.SendMessageOptions)param[2].ConvertTo(typeof(UnityEngine.SendMessageOptions))); return(true); } if (param.Count == 2 && functionName == "SendMessage" && MatchType(param, new Type[] { typeof(string), typeof(object) }, mustEqual)) { returnValue = null; obj.SendMessage((string)param[0].ConvertTo(typeof(string)), (object)param[1].ConvertTo(typeof(object))); return(true); } if (param.Count == 1 && functionName == "SendMessage" && MatchType(param, new Type[] { typeof(string) }, mustEqual)) { returnValue = null; obj.SendMessage((string)param[0].ConvertTo(typeof(string))); return(true); } if (param.Count == 2 && functionName == "SendMessage" && MatchType(param, new Type[] { typeof(string), typeof(UnityEngine.SendMessageOptions) }, mustEqual)) { returnValue = null; obj.SendMessage((string)param[0].ConvertTo(typeof(string)), (UnityEngine.SendMessageOptions)param[1].ConvertTo(typeof(UnityEngine.SendMessageOptions))); return(true); } if (param.Count == 3 && functionName == "BroadcastMessage" && MatchType(param, new Type[] { typeof(string), typeof(object), typeof(UnityEngine.SendMessageOptions) }, mustEqual)) { returnValue = null; obj.BroadcastMessage((string)param[0].ConvertTo(typeof(string)), (object)param[1].ConvertTo(typeof(object)), (UnityEngine.SendMessageOptions)param[2].ConvertTo(typeof(UnityEngine.SendMessageOptions))); return(true); } if (param.Count == 2 && functionName == "BroadcastMessage" && MatchType(param, new Type[] { typeof(string), typeof(object) }, mustEqual)) { returnValue = null; obj.BroadcastMessage((string)param[0].ConvertTo(typeof(string)), (object)param[1].ConvertTo(typeof(object))); return(true); } if (param.Count == 1 && functionName == "BroadcastMessage" && MatchType(param, new Type[] { typeof(string) }, mustEqual)) { returnValue = null; obj.BroadcastMessage((string)param[0].ConvertTo(typeof(string))); return(true); } if (param.Count == 2 && functionName == "BroadcastMessage" && MatchType(param, new Type[] { typeof(string), typeof(UnityEngine.SendMessageOptions) }, mustEqual)) { returnValue = null; obj.BroadcastMessage((string)param[0].ConvertTo(typeof(string)), (UnityEngine.SendMessageOptions)param[1].ConvertTo(typeof(UnityEngine.SendMessageOptions))); return(true); } if (param.Count == 0 && functionName == "ToString") { returnValue = new CQ_Value(); returnValue.type = typeof(string); returnValue.value = obj.ToString(); return(true); } if (param.Count == 0 && functionName == "GetInstanceID") { returnValue = new CQ_Value(); returnValue.type = typeof(int); returnValue.value = obj.GetInstanceID(); return(true); } if (param.Count == 0 && functionName == "GetHashCode") { returnValue = new CQ_Value(); returnValue.type = typeof(int); returnValue.value = obj.GetHashCode(); return(true); } if (param.Count == 1 && functionName == "Equals" && MatchType(param, new Type[] { typeof(object) }, mustEqual)) { returnValue = new CQ_Value(); returnValue.type = typeof(bool); returnValue.value = obj.Equals((object)param[0].ConvertTo(typeof(object))); return(true); } if (param.Count == 0 && functionName == "GetType") { returnValue = new CQ_Value(); returnValue.type = typeof(System.Type); returnValue.value = obj.GetType(); return(true); } returnValue = null; return(false); }
/// <summary> /// Despawn the specified GameObject /// The OnDespawned method will be called on the GameObject. /// </summary> public void Despawn(Transform transToDespawn) { transToDespawn.BroadcastMessage("OnDespawned", SendMessageOptions.DontRequireReceiver); transToDespawn.parent = parentTransform; transToDespawn.gameObject.SetActive(false); if (showDebugLog) { Debug.Log("EZ_PoolManager despawned " + transToDespawn.name); } spawnedList.Remove(transToDespawn); despawnedList.Add(transToDespawn); }