public override void OnWeaponEffects(IEffectsMessage effectsMessage) { if (effectsMessage is ProjectileEffectsMessage) { weaponGraphics.muzzleFlash.Play(); } }
public override void OnWeaponEffects(IEffectsMessage effectsMessage) { if (effectsMessage is MeleeEffectsMessage meleeEffectsMessage) { if (!meleeEffectsMessage.HitNormal.HasValue || !meleeEffectsMessage.HitPoint.HasValue) { return; } //Do hole (your mum's hole) GameObject weaponHitHole = bulletHolesPool.GetPooledObject(); weaponHitHole.transform.position = meleeEffectsMessage.HitPoint.Value; weaponHitHole.transform.rotation = Quaternion.LookRotation(meleeEffectsMessage.HitNormal.Value); } }
public static void Write(this NetworkWriter writer, IEffectsMessage effectsMessage) { writer.WriteByte((byte)effectsMessage.EffectsMessageType); effectsMessage.Serialize(writer); }