42 lines
1.4 KiB
C#
42 lines
1.4 KiB
C#
|
|
using Games.LogicObj;
|
|||
|
|
using GCGame.Table;
|
|||
|
|
using UnityEngine;
|
|||
|
|
/// <summary>
|
|||
|
|
/// 改变模型材质
|
|||
|
|
/// Effect.txt 表格扩展参数说明
|
|||
|
|
/// Param1 :EffectParam.txt中id值 身体材质相关配置
|
|||
|
|
/// Param2 :EffectParam.txt中id值 右武器材质相关配置
|
|||
|
|
/// Param3 :EffectParam.txt中id值 左武器材质相关配置
|
|||
|
|
/// EffectParam.txt 表格扩展参数说明
|
|||
|
|
/// Param1 : 材质名称
|
|||
|
|
/// </summary>
|
|||
|
|
public class Impact_AddMat : ImpactEffectBase
|
|||
|
|
{
|
|||
|
|
private Material _addMaterial;
|
|||
|
|
public override EffectLogic.EffectType ImpactEffectType
|
|||
|
|
{
|
|||
|
|
get { return EffectLogic.EffectType.TYPE_ADDMAT; }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public override void StartEffect()
|
|||
|
|
{
|
|||
|
|
base.StartEffect();
|
|||
|
|
if (objCharacter != null && Data != null)
|
|||
|
|
{
|
|||
|
|
var paramid = Data.GetParamValuebyIndex(bodyPart);
|
|||
|
|
var param = TableManager.GetEffectParamByID(paramid, 0);
|
|||
|
|
if (param != null && _addMaterial == null)
|
|||
|
|
{
|
|||
|
|
_addMaterial = CommonUtility.LoadSharedMaterial(param.GetParamValuebyIndex(0));
|
|||
|
|
objCharacter.AddMaterial(_addMaterial, BodyToModelPart(bodyPart));
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public override void StopEffect()
|
|||
|
|
{
|
|||
|
|
base.StopEffect();
|
|||
|
|
if (_addMaterial != null)
|
|||
|
|
objCharacter.RemoveAddMaterial(_addMaterial, BodyToModelPart(bodyPart));
|
|||
|
|
}
|
|||
|
|
}
|