using UnityEngine; namespace Lights { public static class LightSystem { private static bool initialized = false; private static LightConfig config; private static string baseCommand = "8530"; public static void Init() { if (initialized) return; config = new LightConfig(); initialized = true; } public static void SetLight(LightMode mode) { } public static void SetIndicator(Indiсator indiсator, float percent) { string channel = indiсator switch { Indiсator.MissileAmmo => "1", Indiсator.TorpedoAmmo => "2", Indiсator.Life => "3" }; int diodesCount = 22; int diodesToLight = (int)(22 * percent); ComPortController.Send(baseCommand + channel + diodesToLight); } public static void SetAllIndicators(float percent) { SetIndicator(Indiсator.MissileAmmo, percent); SetIndicator(Indiсator.TorpedoAmmo, percent); SetIndicator(Indiсator.Life, percent); } } public class LightConfig { } public enum LightMode { Idle } public enum Indiсator { Life, TorpedoAmmo, MissileAmmo } }