Чекпоинт
This commit is contained in:
parent
4a2dbeea61
commit
aca4e88b21
@ -1,11 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Mail;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
public static class ExternalFilesGetter
|
||||
@ -116,72 +112,6 @@ public static class ExternalFilesGetter
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static string ReadBotsAmountHash()
|
||||
{
|
||||
try
|
||||
{
|
||||
// Получаем путь к файлу Documents\C4\BotsAmount.rr
|
||||
string documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
|
||||
string filePath = Path.Combine(documentsPath, "C4", "BotsAmount.rr");
|
||||
|
||||
// Проверяем существование файла
|
||||
if (!File.Exists(filePath))
|
||||
{
|
||||
Console.WriteLine($"Файл не найден: {filePath}");
|
||||
return null;
|
||||
}
|
||||
|
||||
// Считываем содержимое файла
|
||||
string hash = File.ReadAllText(filePath).Trim();
|
||||
|
||||
// Выводим отладочную информацию
|
||||
Console.WriteLine($"Файл прочитан: {filePath}");
|
||||
Console.WriteLine($"Хэш: {hash}");
|
||||
Console.WriteLine($"Длина хэша: {hash.Length}");
|
||||
|
||||
return hash;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Ошибка при чтении файла: {ex.Message}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetMacAddressPythonStyle()
|
||||
{
|
||||
try
|
||||
{
|
||||
var nics = NetworkInterface.GetAllNetworkInterfaces();
|
||||
|
||||
foreach (var nic in nics)
|
||||
{
|
||||
var addr = nic.GetPhysicalAddress();
|
||||
if (addr != null && addr.GetAddressBytes().Length == 6)
|
||||
{
|
||||
// Форматирование в XX:XX:XX:XX:XX:XX
|
||||
byte[] bytes = addr.GetAddressBytes();
|
||||
return string.Join(":", bytes.Select(b => b.ToString("X2")));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
|
||||
return "00:00:00:00:00:00";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static string GetElektroVersion()
|
||||
{
|
||||
|
||||
@ -7,7 +7,6 @@ using UnityEngine.UI;
|
||||
|
||||
public class ShowWinnerState : IState
|
||||
{
|
||||
//Color orange = new Color(255, 143, 0, 1);
|
||||
Color empty = new Color(0, 0, 0, 0);
|
||||
|
||||
CoinCounter coinCounter;
|
||||
@ -43,7 +42,7 @@ public class ShowWinnerState : IState
|
||||
TextMeshProUGUI ToMenuLabel;
|
||||
float TimeRest = 60;
|
||||
|
||||
Transform coinPanel;
|
||||
/*Transform coinPanel;*/
|
||||
|
||||
bool needToPay;
|
||||
|
||||
@ -67,7 +66,7 @@ public class ShowWinnerState : IState
|
||||
}
|
||||
|
||||
//общее для всех режимов
|
||||
coinPanel = GameManager.coinPanel;
|
||||
//coinPanel = GameManager.coinPanel;
|
||||
|
||||
//таймер
|
||||
GameManager.timerManager.StopAllTimers();
|
||||
@ -288,8 +287,6 @@ public class ShowWinnerState : IState
|
||||
{
|
||||
SoundManager.instance.playSwitch();
|
||||
option = EndOption.Restart;
|
||||
//left.sprite = selected;
|
||||
//right.sprite = deselected;
|
||||
|
||||
right.transform.GetChild(0).GetComponent<Image>().color = empty;
|
||||
left.transform.GetChild(0).GetComponent<Image>().color = orange;
|
||||
@ -312,9 +309,6 @@ public class ShowWinnerState : IState
|
||||
subState = ShowWinnerSubstates.PanelRising;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (In.GetButtonDownAnyPlayer(PlayerAction.down))
|
||||
{
|
||||
SoundManager.instance.playChoose();
|
||||
@ -353,7 +347,6 @@ public class ShowWinnerState : IState
|
||||
{
|
||||
subState = ShowWinnerSubstates.PanelRising;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void InitPanel()
|
||||
@ -425,7 +418,7 @@ public class ShowWinnerState : IState
|
||||
}
|
||||
|
||||
|
||||
Vector3
|
||||
/*Vector3
|
||||
sCoin = new Vector3(0, -1.93f, 0),
|
||||
eCoin = new Vector3(-8.964f, 3.6f, 0);
|
||||
IEnumerator CoinToSide()
|
||||
@ -453,7 +446,7 @@ public class ShowWinnerState : IState
|
||||
}
|
||||
GameManager.coinPanel.localPosition = sCoin;
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
|
||||
@ -59,31 +59,9 @@ public class COMinput : InputSource
|
||||
Debug.Log($"Определена версия электроники: {elektroVersion}");
|
||||
|
||||
// Создаем маппинг в зависимости от версии
|
||||
if (elektroVersion == "2")
|
||||
if (elektroVersion == "1")
|
||||
{
|
||||
// Версия 2 (новая распиновка)
|
||||
pinMappings[ButtonPinMapping.up1] = 0;
|
||||
pinMappings[ButtonPinMapping.right1] = 1;
|
||||
pinMappings[ButtonPinMapping.down1] = 2;
|
||||
pinMappings[ButtonPinMapping.left1] = 3;
|
||||
pinMappings[ButtonPinMapping.action1] = 4;
|
||||
pinMappings[ButtonPinMapping.up2] = 10;
|
||||
pinMappings[ButtonPinMapping.right2] = 7;
|
||||
pinMappings[ButtonPinMapping.down2] = 8;
|
||||
pinMappings[ButtonPinMapping.left2] = 9;
|
||||
pinMappings[ButtonPinMapping.action2] = 11;
|
||||
pinMappings[ButtonPinMapping.startOnePlayer] = 5;
|
||||
pinMappings[ButtonPinMapping.startTwoPlayers] = 6;
|
||||
pinMappings[ButtonPinMapping.secret] = 12;
|
||||
pinMappings[ButtonPinMapping.extra] = 13;
|
||||
pinMappings[ButtonPinMapping.hasPrize] = 14;
|
||||
pinMappings[ButtonPinMapping.prizeGiven] = 15;
|
||||
|
||||
Debug.Log("Используется версия 2 распиновки (новая)");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Версия 1 или значение по умолчанию (старая распиновка)
|
||||
// Версия 1 (старая распиновка)
|
||||
pinMappings[ButtonPinMapping.up1] = 0;
|
||||
pinMappings[ButtonPinMapping.right1] = 1;
|
||||
pinMappings[ButtonPinMapping.down1] = 2;
|
||||
@ -102,6 +80,31 @@ public class COMinput : InputSource
|
||||
pinMappings[ButtonPinMapping.prizeGiven] = 15;
|
||||
|
||||
Debug.Log($"Используется версия 1 распиновки (значение по умолчанию). Полученная версия: {elektroVersion}");
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// Версия 2 (Дефолт)
|
||||
pinMappings[ButtonPinMapping.up1] = 0;
|
||||
pinMappings[ButtonPinMapping.right1] = 1;
|
||||
pinMappings[ButtonPinMapping.down1] = 2;
|
||||
pinMappings[ButtonPinMapping.left1] = 3;
|
||||
pinMappings[ButtonPinMapping.action1] = 4;
|
||||
pinMappings[ButtonPinMapping.up2] = 10;
|
||||
pinMappings[ButtonPinMapping.right2] = 7;
|
||||
pinMappings[ButtonPinMapping.down2] = 8;
|
||||
pinMappings[ButtonPinMapping.left2] = 9;
|
||||
pinMappings[ButtonPinMapping.action2] = 11;
|
||||
pinMappings[ButtonPinMapping.startOnePlayer] = 5;
|
||||
pinMappings[ButtonPinMapping.startTwoPlayers] = 6;
|
||||
pinMappings[ButtonPinMapping.secret] = 12;
|
||||
pinMappings[ButtonPinMapping.extra] = 13;
|
||||
pinMappings[ButtonPinMapping.hasPrize] = 14;
|
||||
pinMappings[ButtonPinMapping.prizeGiven] = 15;
|
||||
|
||||
Debug.Log("Используется версия 2 распиновки (новая)");
|
||||
}
|
||||
|
||||
// Создаем обратный маппинг для быстрого поиска
|
||||
|
||||
@ -49,9 +49,8 @@ public class MovesAndTimeCounter : MonoBehaviour
|
||||
private void UpdateTime()
|
||||
{
|
||||
float time = gm.vsBotThinkTime;
|
||||
time = (int)(time*Mathf.Pow(10, digitsAfterComma));
|
||||
time = time / Mathf.Pow(10, digitsAfterComma);
|
||||
timeLabel.text = timePrefix + time;
|
||||
|
||||
timeLabel.text = $"{timePrefix}{time.ToString($"F{digitsAfterComma}")}";
|
||||
}
|
||||
private void UpdateMoves()
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user