Развитие гоночек
This commit is contained in:
1 parent
ec60c47652
commit
b54083521f
532 files changed
+16091
-28231
No files matched your search
@@ -1,14 +1,24 @@
|
||||
using Code.Example.Race.Racer.AI;
|
||||
using Code.Infrastructure.EventBus;
|
||||
using Reflex.Attributes;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Code.Example.Race.Track
|
||||
{
|
||||
public class CheckPoint : MonoBehaviour
|
||||
{
|
||||
[Inject] private EventBus _eventBus;
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
var racer = other.GetComponent<AIDebugRacer>();
|
||||
var racer = other.GetComponent<Racer.AI.Racer>();
|
||||
racer.NextWaypoint();
|
||||
|
||||
_eventBus.RaiseEvent<IRacerPassedCheckpointHandler>(h => h.OnRacerPassedCheckpoint(racer));
|
||||
}
|
||||
}
|
||||
|
||||
public interface IRacerPassedCheckpointHandler : IGlobalSubscriber
|
||||
{
|
||||
void OnRacerPassedCheckpoint(Racer.AI.Racer racer);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user