ИИ гонщиков, запуск, перезапуск игры и пр
This commit is contained in:
1 parent
f557c58c9d
commit
efcfaae647
48 files changed
+1486
-212
No files matched your search
@@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Code.Example.Race.Racer;
|
||||
using Code.Example.Race.Track;
|
||||
using Code.Infrastructure.EventBus;
|
||||
using Code.Infrastructure.Loadings;
|
||||
using Reflex.Attributes;
|
||||
using Code.Infrastructure.Loadings;
|
||||
|
||||
namespace Code.Example.Race
|
||||
{
|
||||
@@ -52,7 +52,7 @@ namespace Code.Example.Race
|
||||
}
|
||||
|
||||
private void RacersLoadCompleted() =>
|
||||
_eventBus.RaiseEvent<IRaceGameInitializedHandle>(x => x.RaceGameReady());
|
||||
_eventBus.RaiseEvent<IRaceGameHandle>(x => x.RaceGameReady());
|
||||
|
||||
public List<Racer.Racer> PlacedRacers { get; } = new();
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Code.Example.Race
|
||||
|
||||
foreach (var racer in PlacedRacers)
|
||||
{
|
||||
racer.Initialize(_raceTrackData.trackData.Checkpoints);
|
||||
racer.Initialize(_raceTrackData.trackData.Checkpoints.Select(x=> x.transform).ToList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,23 +84,20 @@ namespace Code.Example.Race
|
||||
|
||||
_raceGameLoading.DoProgress();
|
||||
}
|
||||
|
||||
// private Dictionary<RacerType, Racer.AI.Racer> _spawnedRacers = new();
|
||||
public void RacerCreated(RacerType type, Racer.Racer racer)
|
||||
{
|
||||
// _spawnedRacers.Add(type, racer);
|
||||
// _raceGameLoading.DoProgress();
|
||||
}
|
||||
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
foreach (var racer in PlacedRacers) _scores.UnsubscribeRacer(racer);
|
||||
|
||||
_eventBus.Unsubscribe(this);
|
||||
_racerPrefabs.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public interface IRaceGameInitializedHandle : IGlobalSubscriber
|
||||
public interface IRaceGameHandle : IGlobalSubscriber
|
||||
{
|
||||
void RaceGameReady();
|
||||
void RaceGameEnded(RaceScores scores);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user