Fixed Object Pooling and cascading

This commit is contained in:
2025-12-14 19:19:40 +08:00
parent 68046b8960
commit 95b43ed772
13 changed files with 154 additions and 40 deletions

View File

@@ -0,0 +1,30 @@
using Services;
using UnityEngine;
using Utils;
using VContainer.Unity;
using Views;
namespace Presenter {
public class GemPresenter {
private Gem gem;
private GemView gemView;
public Gem Gem => this.gem;
public GemView GemView => this.gemView;
public GemPresenter(Gem gem, GemView gemView) {
this.gem = gem;
this.gemView = gemView;
}
public void Tick() {
if (this.gemView == null) {
return;
}
if (!this.gem.Position.Compare(this.gemView.transform.localPosition)) {
this.gemView.UpdatePosition(this.gem.Position);
}
}
}
}