예제 #1
0
    private void Toggle()
    {
        if (!bonuses.Any())
        {
            return;
        }

        if (selected)
        {
            dude.ApplyBonus(bonuses[current].GetBonus(), -1);
            bonuses.ForEach(d => d.dimmer.SetActive(false));
            bonuses[current].transform.localScale = Vector3.one;
        }
        else
        {
            var bonus = bonuses[current];
            bonuses.ForEach(d => d.dimmer.SetActive(true));
            bonus.dimmer.SetActive(false);
            bonus.transform.localScale = Vector3.one * 1.05f;
            dude.ApplyBonus(bonus.GetBonus());
            dude.SayNice();
        }

        selected = !selected;
        selectionArrow.gameObject.SetActive(!selected);
    }