public static GameObject Spawn(PoolInfo info, Vector3 position, Quaternion rotation) { GameObject go = Instance.Pools[info.SelectedPoolIndex].Spawn(position, rotation); Instance.Pools[info.SelectedPoolIndex].AfterSpawn(go); return(go); }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { if (SimplePoolManager.HasInstance) { PoolInfo info = (PoolInfo)fieldInfo.GetValue(property.serializedObject.targetObject); if (info != null) { SimplePoolManager.Instance.NameIndexChanged -= info.NameIndexChanged; SimplePoolManager.Instance.NameIndexChanged += info.NameIndexChanged; } SerializedProperty SelectedPoolIndex = property.FindPropertyRelative("SelectedPoolIndex"); if (SelectedPoolIndex.intValue < 0 || SelectedPoolIndex.intValue >= SimplePoolManager.Instance.PoolNames.Length) { SelectedPoolIndex.intValue = 0; } SelectedPoolIndex.intValue = EditorGUI.Popup(position, label.text, SelectedPoolIndex.intValue, SimplePoolManager.Instance.PoolNames); } else { Color before = GUI.color; GUI.color = Color.red; EditorGUI.LabelField(position, "Error: No SimplePoolManager found"); GUI.color = before; } }
public static GameObject Spawn(PoolInfo info) { GameObject go = Instance.Pools[info.SelectedPoolIndex].Spawn(); Instance.Pools[info.SelectedPoolIndex].AfterSpawn(go); return(go); }
public static GameObject Spawn(PoolInfo info, Vector3 localPosition, Quaternion localRotation, Vector3 localScale) { GameObject go = Instance.Pools[info.SelectedPoolIndex].Spawn(localPosition, localRotation, localScale); Instance.Pools[info.SelectedPoolIndex].AfterSpawn(go); return(go); }
public static GameObject Spawn(PoolInfo info, Vector3 localPosition, Quaternion localRotation, Vector3 localScale) { GameObject go = Instance.Pools[info.SelectedPoolIndex].Spawn(localPosition, localRotation, localScale); Instance.Pools[info.SelectedPoolIndex].AfterSpawn(go); return go; }
public static GameObject Spawn(PoolInfo info, Vector3 position, Quaternion rotation) { return(SimplePoolManager.Spawn(info, position, rotation)); }
//If you forget how to use it :P public static GameObject Spawn(PoolInfo info) { return(SimplePoolManager.Spawn(info)); }