Пример #1
0
    private void UpdateTicks()
    {
        if (currentTiers == null)
        {
            return;
        }

        PickupRepresentation[] representations = pickups.Pickups;
        foreach (PickupRepresentation rep in representations)
        {
            if (type == rep.type)
            {
                statImage.sprite = rep.image;
                break;
            }
        }

        int tier = currentTiers.GetTier(type);

        for (int i = 0; i < ticks.Length; i++)
        {
            bool isActive = (i + 1) <= tier;
            ticks[i].color = isActive? enabledColor : disabledColor;
        }
    }
Пример #2
0
    protected override void Apply(Transform Transform)
    {
        if (GameTime.Instance.GameSpeed <= 0)
        {
            return;
        }

        string toPrint     = " - PlayerPickup - \n";
        bool   shouldPrint = false;

        if (increments != null)
        {
            shouldPrint = true;
            foreach (PlayerStatType type in increments)
            {
                int  prev  = currentStats.GetTier(type);
                bool isMax = prev == StatTierList.MaxTier;
                currentStats.IncrementTier(type);
                currentStats.IncrementTier(type);
                int end = currentStats.GetTier(type);
                if (isMax)
                {
                    toPrint += "[+][" + type + "]" + prev + " -> " + end + "\n";
                }
            }
        }

        if (decrements != null)
        {
            foreach (PlayerStatType type in decrements)
            {
                int  prev  = currentStats.GetTier(type);
                bool isMin = prev == StatTierList.MaxTier;
                currentStats.DecrementTier(type);
                int end = currentStats.GetTier(type);
                toPrint += "[-][" + type + "]" + prev + " -> " + end + "\n";
            }
        }

        if (shouldPrint)
        {
            Debug.Log(toPrint);
        }
    }
 private bool IsMaxStat(PlayerStatType stat)
 {
     return(statTierList.GetTier(stat) >= StatTierList.MaxTier);
 }