Exemplo n.º 1
0
    public void LoadTab(Slot.Effect _effect)
    {
        //loadedAction = _action;
        if (value == 0 && immune == 0)
        {
            ShowTab();
        }
        value  = _effect.value;
        immune = _effect.immune;

        actionType = _effect.actionType;
        GameManager.EffectStyle style = GameManager.instance.GetStyle(actionType);
        sr.color    = style.effectColor;
        icon.sprite = style.effectSprite;
        showValue   = style.showValue;

        if (immune > 0)
        {
            sr.color  = Color.gray;
            showValue = false;
        }
        if (hidden)
        {
            return;
        }
        if (value <= 0 && immune <= 0)
        {
            HideTab();
        }
        else
        {
            valueText.text = value.ToString();
        }
    }
Exemplo n.º 2
0
 public EffectStyle GetStyle(Unit.ActionType _actionType)
 {
     for (int i = 0; i < effectStyles.Length; i++)
     {
         if (effectStyles[i].actionType == _actionType)
         {
             return(effectStyles[i]);
         }
     }
     print("No style found!");
     return(effectStyles[0]);
 }
Exemplo n.º 3
0
 public bool CheckImmune(Unit.ActionType actionType)
 {
     for (int i = 0; i < effects.Count; i++)
     {
         if (effects[i].actionType == actionType)
         {
             if (effects[i].immune > 0)
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Exemplo n.º 4
0
 // Use this for initialization
 public void Highlight(Unit.ActionType _actionType)
 {
     highlighted       = true;
     cardOutline.color = cardStripe.color = GameManager.instance.GetStyle(_actionType).effectColor;
 }