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.

28 lines
591 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using Duality;
using Duality.Resources;
using Duality.Components.Physics;
namespace DualStickSpaceShooter
{
[RequiredComponent(typeof(Trigger))]
public class LevelGoal : Component, ICmpMessageListener
{
void ICmpMessageListener.OnMessage(GameMessage msg)
{
TriggerEnteredMessage entered = msg as TriggerEnteredMessage;
if (entered != null)
{
Ship ship = entered.GameObj.GetComponent<Ship>();
if (ship != null && ship.Owner != null)
{
ship.Owner.NotifyGoalReached();
}
}
}
}
}