public void MakeMove(ActMissile obj, Character target, HitCallbackFly onTriggerEnter) { MoverBase mover = null; switch (obj.MoveType) { case EMoveType.TYPE_FIXDIRECTION: mover = new MoverFixDirection(obj, target, onTriggerEnter); break; case EMoveType.TYPE_FIXPOSITION: mover = new MoverFixPosition(obj, target, onTriggerEnter); break; case EMoveType.TYPE_CHASE: mover = new MoverChase(obj, target, onTriggerEnter); break; case EMoveType.TYPE_CHASEPARABOL: mover = new MoverChaseParabol(obj, target, onTriggerEnter); break; } if (mover != null) { mMovers.Add(mover); } }
public void Execute() { for (int i = 0; i < mRunItems.Count; i++) { ActItem item = mRunItems[i]; item.Loop(); if (item.Status == EActStatus.INITIAL || item.Status == EActStatus.SUCCESS) { mDelItems.Add(item); } } for (int i = 0; i < mDelItems.Count; i++) { ActItem item = mDelItems[i]; mRunItems.Remove(item); } mDelItems.Clear(); for (int i = 0; i < mMovers.Count; i++) { MoverBase mover = mMovers[i]; if (mover.IsDead()) { mDeleteMovers.Add(mover); } else { mover.Execute(); } } for (int i = 0; i < mDeleteMovers.Count; i++) { mMovers.Remove(mDeleteMovers[i]); } }
protected void OnHitCallback(MoverBase mover, Collider other, Character cc) { ActHelper.RunChildrenInNewTree(this, (tree) => { for (int i = 0; i < tree.Children.Count; i++) { tree.Children[i].ApplyHitPoint = other.ClosestPoint(mover.CacheTransform.position); tree.Children[i].ApplyHitDir = mover.CacheTransform.forward; tree.Children[i].AddInAttackList(cc); } if (PassBody == false) { mover.Release(); } }); }