/// <summary> /// See the InstantiateDelegates docs /// </summary> /// <param name="prefab">The prefab to spawn an instance from</param> /// <returns>void</returns> internal static void DestroyInstance(GameObject instance) { if (InstanceHandler.DestroyDelegates != null) { InstanceHandler.DestroyDelegates(instance); } else { Object.Destroy(instance); } }
/// <summary> /// See the DestroyDelegates docs /// </summary> /// <param name="prefab">The prefab to spawn an instance from</param> /// <param name="pos">The position to spawn the instance</param> /// <param name="rot">The rotation of the new instance</param> /// <returns>Transform</returns> internal static GameObject InstantiatePrefab(GameObject prefab, Vector3 pos, Quaternion rot) { if (InstanceHandler.InstantiateDelegates != null) { return(InstanceHandler.InstantiateDelegates(prefab, pos, rot)); } else { return(Object.Instantiate(prefab, pos, rot) as GameObject); } }