2
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
900 B
C#

using UnityEngine;
namespace Game
{
public class ClipSubEntity : TimelineClipBase
{
private SubEntityClip _mRealAsset;
public override void OnEnter()
{
_mRealAsset = Asset as SubEntityClip;
var template = _mRealAsset.template;
var castDir = Owner.skill.CastDir;
castDir = new Vector3(castDir.x, 0, castDir.z);//忽略y
var rot = Quaternion.FromToRotation(Vector3.right, castDir);
var index = template.index;
var dir = rot * template.direction;
var pos = Owner.Pos() + rot * template.pos;
pos = new Vector3(pos.x, 0.25f, pos.z);
Util.CreateSubEntity(index, Owner.ID(), 0, dir, pos);
}
public override void OnStay()
{
}
public override void OnLeave()
{
}
}
}