예제 #1
0
        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);
        }
예제 #2
0
        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;
            }
        }
예제 #3
0
        public static GameObject Spawn(PoolInfo info)
        {
            GameObject go = Instance.Pools[info.SelectedPoolIndex].Spawn();

            Instance.Pools[info.SelectedPoolIndex].AfterSpawn(go);
            return(go);
        }
예제 #4
0
        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);
        }
예제 #5
0
		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;
		}
예제 #6
0
 public static GameObject Spawn(PoolInfo info, Vector3 position, Quaternion rotation)
 {
     return(SimplePoolManager.Spawn(info, position, rotation));
 }
예제 #7
0
 //If you forget how to use it :P
 public static GameObject Spawn(PoolInfo info)
 {
     return(SimplePoolManager.Spawn(info));
 }