/// <summary> /// output some text, show/hide a dialogue, and change the color of the region /// </summary> void doSomething(TriggerRegion region, RigidBody otherBody, TriggerReportFlags flags, CollisionReportInfo info) { if (flags.HasFlag(TriggerReportFlags.Enter)) { Console.WriteLine(otherBody.GetName() + " has entered trigger area \"" + region.Name + "\""); // cycle through the balloon colors region.CycleToNextColor(); } else { Console.WriteLine(otherBody.GetName() + " has left trigger area \"" + region.Name + "\""); region.CycleToNextColor(); } }
public static bool IsLeaveFlag(TriggerReportFlags flag) { return flag.HasFlag(TriggerReportFlags.Leave); }
public static bool IsEnterFlag(TriggerReportFlags flag) { return flag.HasFlag(TriggerReportFlags.Enter); }