Ejemplo n.º 1
0
    public float GetCritRate()
    {
        float result = 0;

        UpgradeClickCrit upgrade = FindUpgradeOfType(typeof(UpgradeClickCrit)) as UpgradeClickCrit;

        if (upgrade != null)
        {
            result += upgrade.GetClickCritRate();
        }

        return(result);
    }
Ejemplo n.º 2
0
    public bool IsHitACrit()
    {
        float critChance = 0;

        UpgradeClickCrit upgrade = FindUpgradeOfType(typeof(UpgradeClickCrit)) as UpgradeClickCrit;

        if (upgrade != null)
        {
            critChance += upgrade.GetClickCritChance();
        }

        return(UnityEngine.Random.Range(0, 100f) <= critChance);
    }