public override void Init(ActorMono src, ActorMono target, DBBulletTrace.BulletInfo bulletInfo, SkillAttackInstance inst) { base.Init(src, target, bulletInfo, inst); if (target == null || target.BindActor == null) { Debug.LogError("Target is lost"); DestroySelf(); return; } if (bulletInfo == null) { Debug.LogError("BulletInfo is null"); DestroySelf(); return; } m_BulletInfo = bulletInfo; mTarget = target; }
public void Init(SkillAttackInstance inst) { attackInst = inst; }
public override void Init(ActorMono src, ActorMono target, DBBulletTrace.BulletInfo bulletInfo, SkillAttackInstance inst) { base.Init(src, target, bulletInfo, inst); if (target == null || target.BindActor == null) { Debug.LogError("Target is lost"); DestroySelf(); return; } if (bulletInfo == null) { Debug.LogError("BulletInfo is null"); DestroySelf(); return; } m_BulletInfo = bulletInfo; mTarget = target; mTargetStartPos = TargetPos; mTraceSpeed = bulletInfo.FlySpeed; float move_per_frame = mTraceSpeed * 0.0333f; mSqrReachRange = move_per_frame * move_per_frame; Vector3 dir = mTargetStartPos - cacheTrans.position; dir.Normalize(); mTransDir = dir * mTraceSpeed; }
public override void Init(xc.ActorMono begin_actor, xc.ActorMono end_actor, DBBulletTrace.BulletInfo bulletInfo, SkillAttackInstance inst) { base.Init(begin_actor, end_actor, bulletInfo, inst); mInitPoint = true; if (begin_actor == null || begin_actor.BindActor == null || end_actor == null || end_actor.BindActor == null) { GameDebug.LogError("[StretchComponent]Target is lost"); DestroySelf(); return; } if (bulletInfo == null) { GameDebug.LogError("[StretchComponent]BulletInfo is null"); DestroySelf(); return; } m_BulletInfo = bulletInfo; m_BeginTrans = begin_actor.BindActor.Trans; m_EndTrans = end_actor.BindActor.Trans; mTarget = end_actor; m_TargetHeight = end_actor.BindActor.Height; MoveSpeed = bulletInfo.FlySpeed; // 先设置方向 Vector3 vec = TargetPos - BeginPos; cacheTrans.position = BeginPos + vec * 0.1f; cacheTrans.rotation = Quaternion.LookRotation(vec); SetStretch(1, vec.magnitude * 0.1f); arrowReached = false; }
public virtual void Init(xc.ActorMono s, xc.ActorMono d, DBBulletTrace.BulletInfo bulletInfo, SkillAttackInstance attackInst) { mSkillAttackInst = attackInst; }