/// <summary> /// /// </summary> /// <param name="condition"></param> void SetCondition(PressurcePlateCondition condition) { switch (condition) { case PressurcePlateCondition.Always: AlwaysBox.Checked = true; break; case PressurcePlateCondition.OnEnter: OnEnterBox.Checked = true; break; case PressurcePlateCondition.OnLeave: OnLeaveBox.Checked = true; break; case PressurcePlateCondition.OnTeam: OnTeamBox.Checked = true; break; case PressurcePlateCondition.OnTeamEnter: OnTeamEnterBox.Checked = true; break; case PressurcePlateCondition.OnTeamLeave: OnTeamLeaveBox.Checked = true; break; case PressurcePlateCondition.OnMonster: OnMonsterBox.Checked = true; break; case PressurcePlateCondition.OnMonsterEnter: OnMonsterEnterBox.Checked = true; break; case PressurcePlateCondition.OnMonsterLeave: OnMonsterLeaveBox.Checked = true; break; case PressurcePlateCondition.OnItem: OnItemBox.Checked = true; break; case PressurcePlateCondition.OnItemAdded: OnItemAddedBox.Checked = true; break; case PressurcePlateCondition.OnItemRemoved: OnItemRemovedBox.Checked = true; break; case PressurcePlateCondition.OnEntity: OnEntityBox.Checked = true; break; case PressurcePlateCondition.OnEntityEnter: OnEntityEnterBox.Checked = true; break; case PressurcePlateCondition.OnEntityLeave: OnEntityLeaveBox.Checked = true; break; } }
/// <summary> /// Runs scripts /// </summary> /// <param name="condition">Condtion</param> void RunScript(PressurcePlateCondition condition) { // Not activated if (!IsEnabled) return; // Already used if (!Reusable && WasUsed) return; foreach (PressurePlateScript script in Scripts) { if ((script.Condition & condition) == condition) script.Run(); } WasUsed = true; }
/// <summary> /// Runs scripts /// </summary> /// <param name="condition">Condtion</param> void RunScript(PressurcePlateCondition condition) { // Not activated if (!IsEnabled) { return; } // Already used if (!Reusable && WasUsed) { return; } foreach (PressurePlateScript script in Scripts) { if ((script.Condition & condition) == condition) { script.Run(); } } WasUsed = true; }