目录为:Assets/Scripts/Effect/目录下
BeAttackEffect.cs
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
//貌似只是实现了几个接口,但是具体细节在GameEntity部分
//技能受击效果
public class BeAttackEffect: IEffect
{
//构造函数
public BeAttackEffect()
{
projectID = EffectManager.Instance.GetLocalId ();
mType = IEffect.ESkillEffectType.eET_BeAttack;
}
public override void Update()
{
if (isDead)
{
return;
}
base.Update ();
}
public override void OnLoadComplete()
{
//GameEntity部分定义
//判断enTarget
Ientity enTarget;
EntityManager.AllEntitys.TryGetValue (enTargetKey, out enTarget);
if (enTarget != null && obj != null)
{
Transform hitPoint = enTarget.RealEntity.transform.FindChild ("hitpoint");
if (hitPoint != null)
{
GetTransform ().parent = hitPoint;
GetTransform ().localPosition = new Vector3 (0.0f, 0.0f, 0.0f);
}
}
if (skillID == 0)
{
return;
}
}
}