Код: Выделить всё
//PlayerInteraction.cs
private void OnTriggerEnter2D(Collider2D collision)
{
if (collision.TryGetComponent(out ReactToPlayer component))
{
component.React(gameObject);
}
}
Код: Выделить всё
public class GoalReactToPlayer : ReactToPlayer
{
public override void React(GameObject player)
{
EventBus.Raise(new WinEvent());
}
}
Код: Выделить всё
public class GameController: MonoBehavior
{
private void OnEnable()
{
_winEventBiding = new(WinAction);
EventBus.Register(_winEventBiding);
}
private async void WinAction(WinEvent @event)
{
await Task.Delay(500);
var a = _sceneTransitioner.LoadNextScene();
a.completed += a => Reload();
}
Код: Выделить всё
public class SceneTransitioner : MonoBehaviour
{
public AsyncOperation LoadNextScene()
{
DOTween.KillAll();
int index = SceneManager.GetActiveScene().buildIndex;
var a = SceneManager.LoadSceneAsync(index + 1,LoadSceneMode.Single);
return a;
}
}
Какие ключевые слова я мог бы поискать решение этой проблемы и как ее отладить? Спасибо за помощь
Подробнее здесь: https://stackoverflow.com/questions/783 ... i-debug-it