generic pool made

This commit is contained in:
Mausham
2025-12-17 15:50:28 -08:00
parent ff062d4c3d
commit 2a7759228f
29 changed files with 265 additions and 227 deletions

View File

@@ -1,4 +1,5 @@
using Darkmatter.Core;
using Darkmatter.Domain;
using UnityEngine;
using VContainer;
@@ -11,6 +12,7 @@ public class PlatformManager : MonoBehaviour,IPlatformManager
[SerializeField] private float inputScale = 360f;
float rotAmount = 0;
public bool hasFirstPlatformBuilt = false;
private void Start()
@@ -47,6 +49,15 @@ public class PlatformManager : MonoBehaviour,IPlatformManager
{
foreach (Platform platform in pool.All)
{
if (!hasFirstPlatformBuilt)
{
platform.SetPlatformRule(new FirstPlatformRule());
hasFirstPlatformBuilt=true;
}
else
{
platform.SetPlatformRule(new OtherPlatformRule());
}
platform.gameObject.SetActive(true);
platform.transform.position = new Vector3(0, yPos, 0);
yPos--;
@@ -56,6 +67,8 @@ public class PlatformManager : MonoBehaviour,IPlatformManager
public void BuildNewPlatform()
{
Platform platform = pool.GetFromPool();
platform.SetPlatformRule(new OtherPlatformRule());
platform.gameObject.SetActive(true);
platform.transform.position = new Vector3(0, yPos, 0);
yPos--;
}