Esempio n. 1
0
 /// <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);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// See the DestroyDelegates docs
 /// </summary>
 /// <param name="prefab">The prefab to spawn an instance from</param>
 /// <returns>void</returns>
 internal void DestroyInstance(GameObject instance)
 {
     if (this.destroyDelegates != null)
     {
         this.destroyDelegates(instance);
     }
     else
     {
         InstanceHandler.DestroyInstance(instance);
     }
 }
Esempio n. 3
0
 /// <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);
     }
 }
Esempio n. 4
0
 /// <summary>
 /// See the InstantiateDelegates 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 GameObject InstantiatePrefab(GameObject prefab, Vector3 pos, Quaternion rot)
 {
     if (this.instantiateDelegates != null)
     {
         return(this.instantiateDelegates(prefab, pos, rot));
     }
     else
     {
         return(InstanceHandler.InstantiatePrefab(prefab, pos, rot));
     }
 }