Ignition / ObjectCounter
Namespace
Playniax.IgnitionInherits from
MonoBehaviourScript can be found in
Assets/Playniax/Framework/Ignition/Scripts (MonoBehaviour)/ObjectCounter.cs
Class ObjectCounter
DescriptionThe ObjectCounter keeps track of the number of GameObjects enabled in the scene.
In order for this to work you will need to add the ObjectCounter component to the GameObject that need to be included in the count.
Example can be found in
Assets/Playniax/Framework/Ignition/Examples/01 - Framework/ObjectCounter.unityExample script can be found in
Assets/Playniax/Framework/Ignition/Examples/01 - Framework/Scripts (MonoBehaviour)/ObjectCounter_Example.cs
using UnityEngine;
using UnityEngine.UI;
using Playniax.Ignition;
public class ObjectCounter_Example : MonoBehaviour
{
public Text text;
void Awake()
{
if (text == null) text = GetComponent<>Text>();
}
void Update()
{
// Get and display the number of objects.
text.text = ObjectCounter.count.ToString();
}
}