ИИ гонщиков, запуск, перезапуск игры и пр

This commit is contained in:
ThomasCharester committed 2026-02-09 16:22:37 +03:00
1 parent f557c58c9d
commit efcfaae647
48 files changed
+1486 -212

No files matched your search

@@ -1,13 +1,10 @@
using System;
using System.Collections.Generic;
using Code.Example.Race.Racer;
using Code.Example.Race.Track;
using Code.Infrastructure.EventBus;
using Code.Infrastructure.UI;
using Reflex.Attributes;
using TMPro;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine;
namespace Code.Example.Race.UI
{
@@ -25,24 +22,22 @@ namespace Code.Example.Race.UI
public override void Open(Action callback = null)
{
playerScore.gameObject.SetActive(true);
callback?.Invoke();
// image.DOColor(shownColor, 1f).onComplete = () => callback?.Invoke();
}
public override void Close(Action callback = null)
{
playerScore.gameObject.SetActive(true);
playerScore.gameObject.SetActive(false);
callback?.Invoke();
// image.DOColor(hiddenColor, 1f).onComplete += () => callback?.Invoke();
}
}
public void OnRacerPassedCheckpoint(Racer.Racer racer)
{
}
public void ScoreChanged(Racer.Racer racer, int additionalScore, List<KeyValuePair<Racer.Racer,int>> scores)
public void ScoreChanged(Racer.Racer racer, ScoreData additionalScore, List<KeyValuePair<Racer.Racer,ScoreData>> scores)
{
// if (racer.Data.type == RacerType.Player)
string output = "";
foreach (var score in scores) output += $@"{score.Key.Data.name}: {score.Value}\n";
foreach (var score in scores) output += $@"{score.Key.Data.name}: {score.Value.lapsPassed} \t {score.Value.checkpointsPassed}\n";
playerScore.text = output;
}
}
+30
View File
@@ -0,0 +1,30 @@
using System;
using Code.Infrastructure.UI;
using DG.Tweening;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace Code.Example.Race.UI
{
public class WinScreen : UIPanel
{
[SerializeField] private Image image;
[SerializeField] private TMP_Text winText;
[SerializeField] private Color shownColor;
[SerializeField] private Color hiddenColor;
public void SetText(string text) => winText.text = text;
public override void Open(Action callback = null)
{
image.DOColor(shownColor, 1f).onComplete = () => callback?.Invoke();
winText.DOColor(shownColor, 1f).onComplete = () => callback?.Invoke();
}
public override void Close(Action callback = null)
{
image.DOColor(hiddenColor, 1f).onComplete = () => callback?.Invoke();
winText.DOColor(hiddenColor, 1f).onComplete = () => callback?.Invoke();
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 9093110373134c91b06be09705639ddd
timeCreated: 1770455340