npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

com.bigbearstudios.bbunity-pools

v2.1.0

Published

Pool system for Unity - Requires Unity / C# to use

Downloads

2

Readme

BBUnity Pools

Concepts

Pool

A Pool is the main container for all of the Pool Definitions. There are two types of Pools, a Static Pool which must be manually spawned and a TimedPool which will spawn automatically after a given amount of time.

Pool Definition

A Pool Definition is the definition for a single entity which can be spawned from a pool. Its properties differ slightly for Static / Timed Pool but the shared properties are:

  • Name(String): The name of the definition, this is used when spawning manually to find the definition.
  • Prefab (GameObject): The GameObject which will be used to instantiate the new object.
  • Starting Size (Int): The starting size of the pool. How many objects will be instantiated upon Start.
  • Maximum Size (Int): The maximum size of the pool. The pool will never spawn more than this amount.
  • Use Disabled Instances (Boolean): Should disabled instances be classified as 'avalible'?

Pool Behaviour

A Pool Behaviour is the component assigned to every object which is spawned by a Pool. You can add this component yourself, or you can allow BBUnity Events do it for you.

Basic Usage

To get started with BBUnity Pools simply add a StaticPool or TimedPool component onto the GameObject you wish to use as the pool container. Once you have done this expand the "Pool Definitions" tabs see below for the properties for a Static / Timed Pool and how to use each one.

Static Pool

Static pools have all of the shared properties outlined above, they require manual spawning via the following interface:


/*
 * First you need to get a reference to the pool. You can do this via a variable and the Unity inspector or via the Find method.
 */

StaticPool pool = StaticPool.Find("Pool Name within Unity");

//Spawn an item with no extra params
pool.Spawn("definition_name");

//Spawn with a given position
pool.Spawn("definition_name", position);

//Spawn with a position and scale
pool.Spawn("definition_name", position, scale);

//Spawn with a parent, position, scale
pool.Spawn("definition_name", parent, position, scale);

//Spawn with a before callback
pool.Spawn("definition_name", (PoolBehaviour behaviour) => {  });

//Spawn with a before callback, after callback
pool.Spawn("definition_name", (PoolBehaviour behaviour) => {  }, (PoolBehaviour behaviour) => {  });

//Using a definition directly
StaticPoolDefinition definition = pool.FindPoolDefinition("Definition Name");

definition.Spawn();
definition.Spawn(position);
pool.Spawn((PoolBehaviour behaviour) => {  }, (PoolBehaviour behaviour) => {  });

Timed Pool

Callbacks

Best Practises