Упростить управление подсветкой и удалить файлы тестов производ-сти
This commit is contained in:
parent
a936f932f7
commit
d182c6a1d9
@ -1 +0,0 @@
|
||||
{"TestSuite":"","Date":0,"Player":{"Development":false,"ScreenWidth":0,"ScreenHeight":0,"ScreenRefreshRate":0,"Fullscreen":false,"Vsync":0,"AntiAliasing":0,"Batchmode":false,"RenderThreadingMode":"MultiThreaded","MtRendering":false,"GraphicsJobs":false,"GpuSkinning":false,"Platform":"","ColorSpace":"","AnisotropicFiltering":"","BlendWeights":"","GraphicsApi":"","ScriptingBackend":"IL2CPP","AndroidTargetSdkVersion":"AndroidApiLevel36","AndroidBuildSystem":"Gradle","BuildTarget":"StandaloneWindows64","StereoRenderingPath":"MultiPass"},"Hardware":{"OperatingSystem":"","DeviceModel":"","DeviceName":"","ProcessorType":"","ProcessorCount":0,"GraphicsDeviceName":"","SystemMemorySizeMB":0},"Editor":{"Version":"6000.4.8f1","Branch":"6000.4/staging","Changeset":"f8b72d3d7343","Date":1778633116},"Dependencies":["com.coplaydev.unity-mcp@10.1.2","com.github-glitchenzo.nugetforunity@4.5.0","com.unity.2d.sprite@1.0.0","com.unity.addressables@2.9.1","com.unity.ide.visualstudio@2.0.27","com.unity.render-pipelines.universal@17.4.0","com.unity.ugui@2.0.0","com.unity.modules.accessibility@1.0.0","com.unity.modules.adaptiveperformance@1.0.0","com.unity.modules.ai@1.0.0","com.unity.modules.androidjni@1.0.0","com.unity.modules.animation@1.0.0","com.unity.modules.assetbundle@1.0.0","com.unity.modules.audio@1.0.0","com.unity.modules.cloth@1.0.0","com.unity.modules.director@1.0.0","com.unity.modules.imageconversion@1.0.0","com.unity.modules.imgui@1.0.0","com.unity.modules.jsonserialize@1.0.0","com.unity.modules.particlesystem@1.0.0","com.unity.modules.physics@1.0.0","com.unity.modules.physics2d@1.0.0","com.unity.modules.screencapture@1.0.0","com.unity.modules.terrain@1.0.0","com.unity.modules.terrainphysics@1.0.0","com.unity.modules.tilemap@1.0.0","com.unity.modules.ui@1.0.0","com.unity.modules.uielements@1.0.0","com.unity.modules.umbra@1.0.0","com.unity.modules.unityanalytics@1.0.0","com.unity.modules.unitywebrequest@1.0.0","com.unity.modules.unitywebrequestassetbundle@1.0.0","com.unity.modules.unitywebrequestaudio@1.0.0","com.unity.modules.unitywebrequesttexture@1.0.0","com.unity.modules.unitywebrequestwww@1.0.0","com.unity.modules.vectorgraphics@1.0.0","com.unity.modules.vehicles@1.0.0","com.unity.modules.video@1.0.0","com.unity.modules.vr@1.0.0","com.unity.modules.wind@1.0.0","com.unity.modules.xr@1.0.0","com.unity.modules.subsystems@1.0.0","com.unity.modules.hierarchycore@1.0.0","com.unity.render-pipelines.core@17.4.0","com.unity.shadergraph@17.4.0","com.unity.render-pipelines.universal-config@17.4.0","com.unity.test-framework@1.6.0","com.unity.profiling.core@1.0.3","com.unity.scriptablebuildpipeline@2.6.1","com.unity.nuget.newtonsoft-json@3.2.2","com.unity.searcher@4.9.4","com.unity.burst@1.8.29","com.unity.mathematics@1.3.3","com.unity.collections@6.4.0","com.unity.ext.nunit@2.0.5","com.unity.nuget.mono-cecil@1.11.6","com.unity.test-framework.performance@3.4.0"],"Results":[]}
|
||||
@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a94a4c688a87bb44dbacba4baeda4c91
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1 +0,0 @@
|
||||
{"MeasurementCount":-1}
|
||||
@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 77be37e1925f83641a6e921e70789506
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -398,7 +398,6 @@ public class GameManager : MonoBehaviour
|
||||
if (gameMode == GameMode.pvp)//переключаем таймеры только в pvp
|
||||
{
|
||||
timerManager.SetActiveTimer(currentPlayer);
|
||||
LightSystem.Player(currentPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,10 +1,7 @@
|
||||
using CharacterSystem;
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
|
||||
//Зависит от ComWrapper
|
||||
public static class LightSystem
|
||||
{
|
||||
private const string LIGHT_COMMAND_PREFIX = "80";
|
||||
private const string ButtonLightingOnCommand = "2171";
|
||||
private const string ButtonLightingOffCommand = "2170";
|
||||
private const string SpecialEffectCommandPrefix = "8560";
|
||||
@ -35,155 +32,6 @@ public static class LightSystem
|
||||
return;
|
||||
}
|
||||
|
||||
ComWrapper.Send($"{SpecialEffectCommandPrefix}{effectNumber:D2}{durationSeconds}");
|
||||
ComWrapper.Send($"{SpecialEffectCommandPrefix}{effectNumber:D2}{durationSeconds:D2}");
|
||||
}
|
||||
|
||||
public static void Idle()
|
||||
{
|
||||
if (Random.Range(0, 2) == 0)
|
||||
SendLightCommandToCom(LightMode.Idle1);
|
||||
else
|
||||
SendLightCommandToCom(LightMode.Idle2);
|
||||
}
|
||||
|
||||
public static void Win()
|
||||
{
|
||||
SendLightCommandToCom(LightMode.Win);
|
||||
}
|
||||
|
||||
public static void Lose()
|
||||
{
|
||||
SendLightCommandToCom(LightMode.Lose);
|
||||
}
|
||||
|
||||
public static void Player(Team currentPlayer)
|
||||
{
|
||||
if (currentPlayer == Team.Player1)
|
||||
SendLightCommandToCom(LightMode.Orange);
|
||||
else
|
||||
SendLightCommandToCom(LightMode.Blue);
|
||||
}
|
||||
|
||||
public static void Prize()
|
||||
{
|
||||
SendLightCommandToCom(LightMode.Prize);
|
||||
}
|
||||
|
||||
public static void Character(Character currentCharacter)
|
||||
{
|
||||
LightMode lightMode;
|
||||
|
||||
lightMode = currentCharacter.CharacterIndex switch
|
||||
{
|
||||
0 => LightMode.Toaster,
|
||||
1 => LightMode.Tama,
|
||||
2 => LightMode.Dog,
|
||||
3 => LightMode.Sam,
|
||||
4 => LightMode.Mistress,
|
||||
_ => LightMode.Idle2
|
||||
};
|
||||
|
||||
SendLightCommandToCom(lightMode);
|
||||
}
|
||||
|
||||
public static void Promo()
|
||||
{
|
||||
string[] signals = { "521", "523", "524" };
|
||||
|
||||
string signal = signals[Random.Range(0, signals.Length)];
|
||||
SendLightCommandToCom(signal);
|
||||
}
|
||||
|
||||
|
||||
private static void SendLightCommandToCom(LightMode lightMode)
|
||||
{
|
||||
try
|
||||
{
|
||||
string signal = GetLightString(lightMode);
|
||||
ComWrapper.Send(signal);
|
||||
}
|
||||
catch { Debug.LogError("Ошибка отправки светового сигнала."); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Принимает сингнал без префикса. В процессе сам его добавляет.
|
||||
/// </summary>
|
||||
private static void SendLightCommandToCom(string signal)
|
||||
{
|
||||
try
|
||||
{
|
||||
ComWrapper.Send(LIGHT_COMMAND_PREFIX + signal);
|
||||
}
|
||||
catch { Debug.LogError("Ошибка отправки светового сигнала."); }
|
||||
}
|
||||
|
||||
private static string GetLightString(LightMode lightMode)
|
||||
{
|
||||
string lightsingal;
|
||||
|
||||
//определить версию
|
||||
int version = ConfigManager.Config.LightVersion;
|
||||
if (version == 1)
|
||||
{
|
||||
//1 версия
|
||||
lightsingal = lightMode switch
|
||||
{
|
||||
LightMode.Idle1 => "500",
|
||||
LightMode.Idle2 => "507",
|
||||
LightMode.Orange => "501",
|
||||
LightMode.Blue => "502",
|
||||
LightMode.Win => "503",
|
||||
LightMode.Lose => "504",
|
||||
LightMode.Prize => "509",
|
||||
|
||||
LightMode.Toaster => "500",
|
||||
LightMode.Tama => "513",
|
||||
LightMode.Dog => "514",
|
||||
LightMode.Sam => "515",
|
||||
LightMode.Mistress => "516",
|
||||
|
||||
_ => "500"
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
//2 версия (пока дефолт)
|
||||
lightsingal = lightMode switch
|
||||
{
|
||||
LightMode.Idle1 => "500",
|
||||
LightMode.Idle2 => "507",
|
||||
LightMode.Orange => "501",
|
||||
LightMode.Blue => "502",
|
||||
LightMode.Win => "503",
|
||||
LightMode.Lose => "504",
|
||||
LightMode.Prize => "509",
|
||||
|
||||
LightMode.Toaster => "513",
|
||||
LightMode.Tama => "514",
|
||||
LightMode.Dog => "515",
|
||||
LightMode.Sam => "516",
|
||||
LightMode.Mistress => "517",
|
||||
|
||||
_ => "500"
|
||||
};
|
||||
}
|
||||
|
||||
return LIGHT_COMMAND_PREFIX + lightsingal;
|
||||
}
|
||||
}
|
||||
|
||||
public enum LightMode
|
||||
{
|
||||
Idle1,
|
||||
Idle2,
|
||||
Orange,
|
||||
Blue,
|
||||
Win,
|
||||
Lose,
|
||||
Prize,
|
||||
Toaster,
|
||||
Tama,
|
||||
Dog,
|
||||
Sam,
|
||||
Mistress
|
||||
}
|
||||
}
|
||||
@ -71,7 +71,6 @@ public class Menu : MonoBehaviour, IControlable
|
||||
private void Enable()
|
||||
{
|
||||
ControlsEnabled = true;
|
||||
LightSystem.Idle();
|
||||
}
|
||||
|
||||
private void Disable()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user