Unity Simple ProgressTracker is a generic class designed to track progress on a list of items within Unity projects. It provides a flexible way to define execution requirements and actions for each item in the list and automatically updates the progress based on specified conditions.
- Generic implementation for tracking progress on a list of items.
- Supports customizable execution requirements and actions for each item.
- Designed to be integrated into Unity projects seamlessly.
- Easy-to-use interface for initializing and updating progress.
To use the ProgressTracker class in your Unity project, follow these steps:
- Download or clone the repository.
- Copy the
ProgressTracker.cs
script into your Unity project's Assets folder.
- Create a list of items you want to track progress on.
- Define the execution requirements and actions using lambda functions or methods.
- Initialize the ProgressTracker instance with the list, requirements, and actions.
- Call the
Update()
method within theUpdate()
function of a MonoBehaviour script in Unity to track progress.
Example:
using UnityEngine;
using System;
using System.Collections.Generic;
public class Example : MonoBehaviour
{
private ProgressTracker<int> progressTracker;
private void Start()
{
List<int> itemList = new List<int>() { 1, 2, 3, 4, 5 };
// Example requirement: Even numbers
Func<int, bool> requirements = (item) => item % 2 == 0;
// Example action: Log item processed
Action<int> actions = (item) => Debug.Log("Item " + item + " processed.");
progressTracker = new ProgressTracker<int>(itemList, requirements, actions);
}
private void Update()
{
progressTracker.Update();
}
}
Contributions are welcome! Fork the repository, make your changes, and submit a pull request.
If you encounter any issues or have suggestions for improvement, please open an issue.