public static void WriteAbilityCastData(this NetworkWriter writer, AbilityCastData castData)
        {
            AbilityCastIdentifier identifier = new AbilityCastIdentifier(
                castData.Caster,
                castData.CastTime,
                castData.AbilityCast.AbilityID,
                castData.MultiCastID);

            //Identifier
            writer.WriteAbilityCastIdentifier(identifier);

            //Resources Impacts
            writer.WriteInt32(castData.BaseResourcesImpacts.Length);
            for (int i = 0; i < castData.BaseResourcesImpacts.Length; i++)
            {
                writer.WriteAbilityResourceImpactData(castData.BaseResourcesImpacts[i]);
            }

            //Vec3
            writer.WriteVector3(castData.BaseKnockback);
            writer.WriteVector3(castData.BaseRecoil);
            writer.WriteVector3(castData.CastDirection);
            writer.WriteVector3(castData.Origin);

            if (_storedAbilityCastData.ContainsKey(identifier))
            {
                _storedAbilityCastData[identifier] = castData;
            }
            else
            {
                _storedAbilityCastData.Add(identifier, castData);
            }
        }
        public static void WriteAbilityCastResult(this NetworkWriter writer, AbilityCastResult result)
        {
            //CastData
            writer.WriteAbilityCastData(result.CastData);

            //Main
            writer.WriteInt32((int)result.ResultType);
            writer.WriteGameObject(result.Victim.gameObject);
            writer.WriteVector3(result.Impact);
            writer.WriteVector3(result.KnockbackApplied);

            //Resources Changes
            AbilityResourceImpactData[] resourceChanges = result.ResourcesChanges;
            writer.WriteInt32(resourceChanges.Length);
            for (int i = 0; i < resourceChanges.Length; i++)
            {
                writer.WriteAbilityResourceImpactData(resourceChanges[i]);
            }
        }