Exemple #1
0
    IEnumerator SetFormationLate(float latency, FormationStats.Formations formation)
    {
        yield return(new WaitForSeconds(latency));

        squad.CurrentFormation = formation;

        float cooldown = 0;

        switch (formation)
        {
        case FormationStats.Formations.RANKS:
            cooldown = reformOptions.CooldownAfterReformToRanks;
            break;

        case FormationStats.Formations.PHALANX:
            cooldown = reformOptions.CooldownAfterReformToPhalanx;
            break;

        case FormationStats.Formations.RISEDSHIELDS:
            cooldown = reformOptions.CooldownAfterReformToShields;
            break;
        }

        formationChangedCoroutine = StartCoroutine(ColldownAfterReform(cooldown));
    }
Exemple #2
0
    void SetImage(FormationStats.Formations formation)
    {
        switch (formation)
        {
        case FormationStats.Formations.RANKS:
            currentFormationButton.sprite = imageRanks.sprite;
            break;

        case FormationStats.Formations.PHALANX:
            currentFormationButton.sprite = imagePhalanx.sprite;
            break;

        case FormationStats.Formations.RISEDSHIELDS:
            currentFormationButton.sprite = imageShields.sprite;
            break;
        }
    }
Exemple #3
0
        public static string GetNamelocalize(this FormationStats.Formations formation)
        {
            string res = string.Empty;

            switch (formation)
            {
            case FormationStats.Formations.RANKS:
                res = LocalizedStrings.formation_ranks_name;
                break;

            case FormationStats.Formations.PHALANX:
                res = LocalizedStrings.formation_phalanx_name;
                break;

            case FormationStats.Formations.RISEDSHIELDS:
                res = LocalizedStrings.formation_shields_name;
                break;
            }

            return(res);
        }
Exemple #4
0
    public Sprite GetIcon(FormationStats.Formations formation)
    {
        Sprite res = null;

        switch (formation)
        {
        case FormationStats.Formations.RANKS:
            res = imageRanks.sprite;
            break;

        case FormationStats.Formations.PHALANX:
            res = imagePhalanx.sprite;
            break;

        case FormationStats.Formations.RISEDSHIELDS:
            res = imageShields.sprite;
            break;

        default:
            break;
        }
        return(res);
    }
Exemple #5
0
    public void OnDrag(PointerEventData eventData)
    {
        if (mouseDown && canUse && enable)
        {
            SetButtonsEnabled(true);

            int   count = Input.touchCount;
            Touch touch = new Touch();
            if (count > 0)
            {
                foreach (var item in Input.touches)
                {
                    if (item.fingerId == touchId)
                    {
                        touch = item;
                        break;
                    }
                }
            }
            else
            {
                touch.position = Input.mousePosition;
            }

            GetEndPos(touch);
            if (OutOfButton(startP, endP))
            {
                angle = GetAngle(startP, endP);
                FormationStats.Formations f = GetFormation(angle);
                SetImage(f);
            }
            else
            {
                SetImage(playerSquad.CurrentFormation);
            }
        }
    }