// ***********************************************************************
// Assembly : Game
// Author : Kimch
// Created : 2021-03-25
// Description :
// Last Modified By :
// Last Modified On :
// ***********************************************************************
//
//
// ***********************************************************************
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace G
{
///
/// 角色buff逻辑
///
public class Cha_Buff : MonoBehaviour
{
public class BuffInfo
{
public int id;
public int[] args;
}
#region Field
///
///
///
EntityMainPlayer _scriptCha;
#endregion
#region Method
///
/// 增加buff
///
///
///
public void AddBuff(int id, int[] args)
{
var buff = ItemProxy.Instance.GetStaticItem(id);
if (buff != null)
{
if (buff.kind == 1)
{
_scriptCha.AttributeUp(buff.kindArgs[0], buff.kindArgs[1], 0);
}
else if (buff.kind == 2)
{
_scriptCha.AttributeUp(buff.kindArgs[0], 0, buff.kindArgs[1]);
}
else if (buff.kind == 3)//
{
var sf = buff.kindArgs[0];
if (sf == 1)
{
_scriptCha.HpUp(buff.kindArgs[1], 0);
}
}
//特殊类型百分比
else if (buff.kind == 4)//
{
var sf = buff.kindArgs[0];
if (sf == 1)
{
_scriptCha.HpUp(0, buff.kindArgs[1]);
}
}
}
}
#endregion
#region Unity
private void Awake()
{
_scriptCha = GetComponent();
}
#endregion
}
}