void removeComponents(Entity e) { e.RemoveVelocity(); e.RemoveCollision(); e.RemoveMagnet(); e.RemoveTweenOnDeath(); e.RemoveHealth(); e.RemoveFollowTarget(); e.IsCollisionDeath(false); }
void navigateMissileOrDestroy(Entity e) { if (!hasFoundTarget(e.followTarget)) { e.isDestroyEntity = true; return; } else { e.AddVelocity(new Vector2()); setVelocityBasedOnTarget(e); e.RemoveFollowTarget(); } }
void navigateMissile(Entity e, HomeMissileComponent homeMissile) { FollowTargetComponent targetComponent = e.followTarget; // The target is not alive, so go find another one. if (targetComponent.target == null || !targetComponent.target.hasGameObject) { e.AddFindTarget(homeMissile.targetCollisionType); e.RemoveFollowTarget(); return; } setMissileVelocity(e, homeMissile, targetComponent); }