コード例 #1
0
    public void ChangeAttrByType(GameObject gameObject, AttrType attrType, float value)
    {
        CharacetStatus status = gameObject.GetComponent <CharacetStatus>();

        if (attrType == AttrType.HP)
        {
            status.HPChange((int)value);
        }
        else if (attrType == AttrType.HPRemain)
        {
            status.HPRemainChange((int)value);
        }
        else if (attrType == AttrType.MP)
        {
            status.MPChange((int)value);
        }
        else if (attrType == AttrType.MPRemain)
        {
            status.MPRemainChange((int)value);
        }
        else if (attrType == AttrType.EP)
        {
            status.EPChange((int)value);
        }
        else if (attrType == AttrType.EPRemain)
        {
            status.EPRemainChange((int)value);
        }
        else if (attrType == AttrType.HungerRemain)
        {
            status.HungerRemainChange((int)value);
        }
        else if (attrType == AttrType.AD)
        {
            status.ADChange((int)value);
        }
        else if (attrType == AttrType.AttackRate)
        {
            status.AttackRateChange((int)value);
        }
        else if (attrType == AttrType.MoveSpeed)
        {
            status.MoveSpeedChange((int)value);
        }
    }
コード例 #2
0
    public void ChangeAttrByType(GameObject gameObject, ApplyAttrEffect applyAttrEffect)
    {
        CharacetStatus status = gameObject.GetComponent <CharacetStatus>();

        if (applyAttrEffect.AT == AttrType.HP)
        {
            status.HPChange((int)applyAttrEffect.FixValue);
        }
        else if (applyAttrEffect.AT == AttrType.HPRemain)
        {
            status.HPRemainChange((int)applyAttrEffect.FixValue);
        }
        else if (applyAttrEffect.AT == AttrType.MP)
        {
            status.MPChange((int)applyAttrEffect.FixValue);
        }
        else if (applyAttrEffect.AT == AttrType.MPRemain)
        {
            status.MPRemainChange((int)applyAttrEffect.FixValue);
        }
        else if (applyAttrEffect.AT == AttrType.EP)
        {
            status.EPChange((int)applyAttrEffect.FixValue);
        }
        else if (applyAttrEffect.AT == AttrType.EPRemain)
        {
            status.EPRemainChange((int)applyAttrEffect.FixValue);
        }
        else if (applyAttrEffect.AT == AttrType.HungerRemain)
        {
            status.HungerRemainChange((int)applyAttrEffect.FixValue);
        }
        else if (applyAttrEffect.AT == AttrType.AD)
        {
            status.ADChange((int)applyAttrEffect.FixValue);
        }
        else if (applyAttrEffect.AT == AttrType.AttackRate)
        {
            status.AttackRateChange((int)applyAttrEffect.FixValue);
        }
    }