예제 #1
0
 void removeComponents(Entity e)
 {
     e.RemoveVelocity();
     e.RemoveCollision();
     e.RemoveMagnet();
     e.RemoveTweenOnDeath();
     e.RemoveHealth();
     e.RemoveFollowTarget();
     e.IsCollisionDeath(false);
 }
예제 #2
0
 void navigateMissileOrDestroy(Entity e)
 {
     if (!hasFoundTarget(e.followTarget)) {
         e.isDestroyEntity = true;
         return;
     }
     else {
         e.AddVelocity(new Vector2());
         setVelocityBasedOnTarget(e);
         e.RemoveFollowTarget();
     }
 }
예제 #3
0
    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);
    }