Я только что создал сборку Webgl для моей игры головоломки в Unity. В то время как оконная версия работала просто отлично. Я столкнулся с ошибкой в Интернете, когда она не может загрузить следующий уровень, когда вы столкнулись с целью. Здесь код: < /p>
//PlayerInteraction.cs
private void OnTriggerEnter2D(Collider2D collision)
{
if (collision.TryGetComponent(out ReactToPlayer component))
{
component.React(gameObject);
}
}
< /code>
public class GoalReactToPlayer : ReactToPlayer
{
public override void React(GameObject player)
{
EventBus.Raise(new WinEvent());
}
}
< /code>
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();
}
}
< /code>
public class SceneTransitioner : MonoBehaviour
{
public AsyncOperation LoadNextScene()
{
DOTween.KillAll();
int index = SceneManager.GetActiveScene().buildIndex;
var a = SceneManager.LoadSceneAsync(index + 1,LoadSceneMode.Single);
return a;
}
}
< /code>
btw here the Itch.io link: (https://nathanmakegame.itch.io/dungeon-escape)
What are the keywords that I could search to fix this problem and how can I debug it? Thanks for all helps
Подробнее здесь: https://stackoverflow.com/questions/783 ... i-debug-it
Игра не может загрузить следующую сцену, как я могу ее отладить? ⇐ C#
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Моя игра Unity WebGL не может загрузить следующую сцену. Как мне ее отладить?
Anonymous » » в форуме C# - 0 Ответы
- 21 Просмотры
-
Последнее сообщение Anonymous
-