Ejemplo n.º 1
0
        public UpdateDirectionsToPlayersSystem(Contexts contexts, Camera camera, Canvas canvas, Sprite arrow, int playersCount)
        {
            colorManager = TeamsColorManager.Instance();
            colorsMode   = colorManager.TeamsColorsMode;
            gameContext  = contexts.game;
            playersGroup =
                gameContext.GetGroup(GameMatcher.AllOf(GameMatcher.Player, GameMatcher.Team, GameMatcher.Transform).NoneOf(GameMatcher.CurrentPlayer, GameMatcher.Hidden));
            arrowsCamera = camera;
            arrowsCanvas = canvas;
            var canvasRect = canvas.GetComponent <RectTransform>().rect;

            firstDiagonalRadAngle  = Mathf.Atan(canvasRect.height / canvasRect.width);
            secondDiagonalRadAngle = Mathf.PI - firstDiagonalRadAngle;
            fourthDiagonalRadAngle = Mathf.PI + secondDiagonalRadAngle;
            halfCanvasWidth        = canvasRect.width * 0.5f;
            halfCanvasHeight       = canvasRect.height * 0.5f;
            arrowSprite            = arrow;
            arrows      = new Dictionary <int, Image>(playersCount - 1);
            teamsColors = colorManager.GetColors(playersCount + 1);
        }
Ejemplo n.º 2
0
        protected override void Awake()
        {
            base.Awake();

            joysticksManager = JoysticksManager.Instance();
            uiSoundsManager  = UiSoundsManager.Instance();
            colorManager     = TeamsColorManager.Instance();

            var colorsOptions = new List <Dropdown.OptionData>();
            var names         = Enum.GetNames(typeof(TeamsColorManager.ColorsMode));

            foreach (var optionName in names)
            {
                var prettifiedName = Regex.Replace(optionName, @"((?<=\p{Ll})\p{Lu})|((?!\A)\p{Lu}(?>\p{Ll}))", " $0");
                colorsOptions.Add(new Dropdown.OptionData(prettifiedName));
            }
            colorsDropdown.options = colorsOptions;
            colorsDropdown.SetValueWithoutNotify((int)colorManager.TeamsColorsMode);

            if (joysticksManager.MovementType != JoystickType.Fixed)
            {
                movementLocked.SetActive(false);
                movementUnlocked.SetActive(true);
            }
            else
            {
                movementLocked.SetActive(true);
                movementUnlocked.SetActive(false);
            }
            if (joysticksManager.AttackType != JoystickType.Fixed)
            {
                attackLocked.SetActive(false);
                attackUnlocked.SetActive(true);
            }
            else
            {
                attackLocked.SetActive(true);
                attackUnlocked.SetActive(false);
            }
        }
Ejemplo n.º 3
0
 public UpdateOutlineMaterialsSystem(Contexts contexts, int totalTeamsCount) : base(contexts.game)
 {
     gameContext = contexts.game;
     materials   = TeamsColorManager.Instance().GetOutlineMaterials(totalTeamsCount);
 }