protected virtual void PerformAbility(AbilityCastData castData) { if (castData.AbilityCast.Methods.CastOriginTiming == AbilityCastOriginTiming.PerformEntrance) { castData.FillOrigin(DetermineCastOrigin(castData.AbilityCast)); } OnPerformAbility.Invoke(master, castData); castData.OnResultEmitted.Subscribe(OnCastDataEmitResult); AbilityPerformer.PerformAbility(castData); OnAbilityPerformed.Invoke(master, castData); }
private void SyncCastAbility(SyncableVariable var, NetworkReader reader) { int hitboxCount = reader.ReadInt32(); for (int i = 0; i < hitboxCount; i++) { AbilityCastData castData = reader.ReadAbilityCastData(); if (castData.AbilityCast.Hitbox.UnlimitedLifeSpan == true || castData.AbilityCast.Hitbox.LifeSpan > 0) { AbilityHitbox hitBox = AbilityPerformer.HandleSpawnAbilityHitbox(castData); hitBox.ActivateVisualMode(); } OnPerformAbility.Invoke(master, castData); if (References.NetworkIdentity.isServer && References.NetworkIdentity.hasAuthority == false) { _nextAbilitiesCast.Add(castData); PinouNetworkManager.MainBehaviour.SetDirty(master.gameObject, SyncableVariable.EntityAbilityCast); } } }