![]() |
Feel 6.0
The best way to improve your game's feel and make it extra juicy
|
This class lets you randomly spawn objects within its bounds (defined by a 3D collider) More...
Public Types | |
| enum | StartModes { Awake , Start , None } |
| the possible start modes More... | |
| enum | ScaleModes { Uniform , Vector3 } |
| the possible scale modes you can use to rescale objects More... | |
Public Member Functions | |
| virtual void | InstantiateRandomObject () |
| Spawns a random object from the pool of choices. | |
Public Attributes | |
| StartModes | StartMode = StartModes.Awake |
| whether this instantiator should auto trigger on Awake, Start, or never | |
| string | InstantiatedObjectName = "RandomInstantiated" |
| the name to give to the instantiated object | |
| bool | ParentInstantiatedToThisObject = true |
| if this is true, the instantiated object will be parented to the spawner | |
| bool | DestroyPreviouslyInstantiatedObjects = true |
| if this is true, every time InstantiateRandomObject is called, any previously instantiated object will be destroyed | |
| List< GameObject > | RandomPool |
| the list containing all the objects that can potentially be instantiated | |
| Vector2Int | Quantity = new Vector2Int(1, 1) |
| the min and max bounds to use to determine a random quantity of objects to spawn | |
| ScaleModes | ScaleMode = ScaleModes.Uniform |
| the scale mode to use (uniform scales the whole object, Vector3 randomizes x, y and z scale elements | |
| float | MinScale = 1f |
| the min scale to use in uniform mode | |
| float | MaxScale = 1f |
| the max scale to use in uniform mode | |
| Vector3 | MinVectorScale = Vector3.one |
| the min scale to use in vector3 mode | |
| Vector3 | MaxVectorScale = Vector3.one |
| the max scale to use in vector3 mode | |
| bool | InstantiateButton |
| a test button for your inspector | |
Protected Member Functions | |
| virtual void | Awake () |
| On awake we instantiate if needed. | |
| virtual void | Start () |
| On Start we instantiate if needed. | |
| virtual void | Instantiate () |
| Instantiates as many objects as needed, clearing previously existing ones if needed. | |
Protected Attributes | |
| Collider | _collider |
| List< GameObject > | _instantiatedGameObjects |
| Vector3 | _newScale = Vector3.zero |
This class lets you randomly spawn objects within its bounds (defined by a 3D collider)
|
protectedvirtual |
On awake we instantiate if needed.
|
protectedvirtual |
Instantiates as many objects as needed, clearing previously existing ones if needed.
|
virtual |
Spawns a random object from the pool of choices.
|
protectedvirtual |
On Start we instantiate if needed.
|
protected |
|
protected |
|
protected |
| bool MoreMountains.Tools.MMRandomBoundsInstantiator.DestroyPreviouslyInstantiatedObjects = true |
if this is true, every time InstantiateRandomObject is called, any previously instantiated object will be destroyed
| bool MoreMountains.Tools.MMRandomBoundsInstantiator.InstantiateButton |
a test button for your inspector
| string MoreMountains.Tools.MMRandomBoundsInstantiator.InstantiatedObjectName = "RandomInstantiated" |
the name to give to the instantiated object
| float MoreMountains.Tools.MMRandomBoundsInstantiator.MaxScale = 1f |
the max scale to use in uniform mode
| Vector3 MoreMountains.Tools.MMRandomBoundsInstantiator.MaxVectorScale = Vector3.one |
the max scale to use in vector3 mode
| float MoreMountains.Tools.MMRandomBoundsInstantiator.MinScale = 1f |
the min scale to use in uniform mode
| Vector3 MoreMountains.Tools.MMRandomBoundsInstantiator.MinVectorScale = Vector3.one |
the min scale to use in vector3 mode
| bool MoreMountains.Tools.MMRandomBoundsInstantiator.ParentInstantiatedToThisObject = true |
if this is true, the instantiated object will be parented to the spawner
| Vector2Int MoreMountains.Tools.MMRandomBoundsInstantiator.Quantity = new Vector2Int(1, 1) |
the min and max bounds to use to determine a random quantity of objects to spawn
| List<GameObject> MoreMountains.Tools.MMRandomBoundsInstantiator.RandomPool |
the list containing all the objects that can potentially be instantiated
| ScaleModes MoreMountains.Tools.MMRandomBoundsInstantiator.ScaleMode = ScaleModes.Uniform |
the scale mode to use (uniform scales the whole object, Vector3 randomizes x, y and z scale elements
| StartModes MoreMountains.Tools.MMRandomBoundsInstantiator.StartMode = StartModes.Awake |
whether this instantiator should auto trigger on Awake, Start, or never