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); } }