using CoreGame; using GAS.Runtime; namespace CoreGame.Render { public class Trigger_ChangeGunSkillEnd : TriggerBase { public override void OnEvent(TriggerSpec self, int eventId, object param1) { OnTrigger(self, eventId, param1); } public override void Init(TriggerSpec self) { self.tagChangedHandle = (tag, count) => { if (count > 0) // remove return; OnEvent(self, 0, null); }; self.owner.abilitySystem.GameplayTagCountContainer.RegisterGameplayTagEvent(GTagLib.Solt_ChangeGunSkill, EGameplayTagEventType.NewOrRemoved, self.tagChangedHandle); } public override void UnInit(TriggerSpec self) { self.owner.abilitySystem.GameplayTagCountContainer.UnregisterGameplayTagEvent(GTagLib.Solt_ChangeGunSkill, EGameplayTagEventType.NewOrRemoved, self.tagChangedHandle); } } }