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(); } }
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]); }
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); }
// Use this for initialization public void Highlight(Unit.ActionType _actionType) { highlighted = true; cardOutline.color = cardStripe.color = GameManager.instance.GetStyle(_actionType).effectColor; }