Пример #1
0
    static public Color GetColor(eBuffColorType buff_color_type)
    {
        switch (buff_color_type)
        {
        case eBuffColorType.Buff:
            return(BattleBase.Instance.color_container.GetColor("ui_buff"));

        case eBuffColorType.DeBuff:
            return(BattleBase.Instance.color_container.GetColor("ui_debuff"));

        case eBuffColorType.Shield:
            return(BattleBase.Instance.color_container.GetColor("ui_shield"));

        case eBuffColorType.Immune:
            return(BattleBase.Instance.color_container.GetColor("ui_immune"));

        case eBuffColorType.Aggro:
            return(BattleBase.Instance.color_container.GetColor("ui_aggro"));

        case eBuffColorType.Mana:
            return(BattleBase.Instance.color_container.GetColor("ui_mana"));

        case eBuffColorType.Stun:
            return(BattleBase.Instance.color_container.GetColor("ui_stun"));

        default:
            return(Color.white);
        }
    }
Пример #2
0
 public void Init(string icon_id, eBuffColorType buff_color_type, bool show_cool)
 {
     m_Icon.spriteName           = icon_id;
     m_Cool.fillAmount           = 0f;
     m_BackLine.color            = GetColor(buff_color_type);
     m_BackLine.fillAmount       = 1f;
     m_BackLineDanger.fillAmount = 1f;
     m_Cool.gameObject.SetActive(show_cool);
 }
Пример #3
0
    public void PushMessage(ICreature creature, string message, eBuffColorType color_type, eTextPushType push_type, float add_position = 0f)
    {
        if (creature.IsShowText == false)
        {
            return;
        }

        Transform     attach_transform = creature.Character.transform;
        float         scale            = attach_transform.GetComponent <Character>().Creature.Scale;
        TextAnimation ta = Message.Push(attach_transform, creature.TextOffset, message, push_type, scale, add_position);

        ta.Text.color = CharacterBuff.GetColor(color_type);
    }
Пример #4
0
    public Buff(BattleCreature creature, BattleSkill skill, SkillInfo.Action action_info, int value, float duration, ISkillBuff parent)
        : base(duration)
    {
        Parent          = parent;
        m_Creature      = creature;
        Skill           = skill;
        this.ActionInfo = action_info;
        switch (action_info.actionType)
        {
        case eActionType.dot_damage:
        case eActionType.dot_damage_mana:
        case eActionType.dot_heal:
        case eActionType.dot_heal_mana:
            this.Value = Mathf.RoundToInt(value / duration);
            break;

        default:
            this.Value = value;
            break;
        }
        this.StartTime = m_Creature.PlaybackTime;

        eBuffColorType buff_color = eBuffColorType.None;

        if (action_info.actionType == eActionType.shield && action_info.value > 0)
        {
            AffectValue    = value;
            AffectValueMax = value;

            buff_color = eBuffColorType.Shield;
        }
        else
        {
            AffectValue    = 1;
            AffectValueMax = 1;
        }

        if (skill != null && skill.Creature != null && IsMainBuff == true && skill.Info.ShowIcon == true)
        {
            if (buff_color != eBuffColorType.Shield)
            {
                buff_color = creature.IsTeam == skill.Creature.IsTeam ? eBuffColorType.Buff : eBuffColorType.DeBuff;
            }

            BuffContainer.Alloc();
            BuffContainer.Asset.Init(Skill.Info.IconID, buff_color, Duration > 0f);
            BuffContainer.Asset.OnUpdate(0f, 1f);
        }
    }
Пример #5
0
    public void PushMessagePosition(Transform attach_transform, ICreature creature, string message, eBuffColorType color_type, eTextPushType push_type, float add_position = 0f)
    {
        if (creature.IsShowText == false)
        {
            return;
        }

        TextAnimation ta = Message.Push(attach_transform, creature.TextOffset, message, push_type, 1f, add_position);

        ta.Text.color = CharacterBuff.GetColor(color_type);
    }