void ApplyStingDamage() { if (uLink.Network.isServer == false) { return; } Collider[] colliders = Physics.OverlapSphere(Position, damageRadius); foreach (Collider collider in colliders) { AgentHuman victim = collider.GetComponent <AgentHuman>(); if (victim == null) { continue; } Vector3 dir = Agent.Position - m_Transform.position; if (dir.sqrMagnitude > 0.1f * 0.1f) { dir.Normalize(); } else { dir = Agent.Forward * -1f; } victim.KnockDown(Agent, E_MeleeType.First, dir); } }
protected void Knockdown(E_MeleeType meleeType, uLink.NetworkViewID viewId, Vector3 direction) { #if !DEADZONE_CLIENT if (Owner.IsServer) { ServerAnticheat.ReportPotentialCheatAttempt("Knockdown", "should never be called on the server side", Owner.NetworkView.owner); return; } #endif if (Owner.BlackBoard.DontUpdate) { return; } uLink.NetworkView View = (viewId != uLink.NetworkViewID.unassigned) ? uLink.NetworkView.Find(viewId) : null; AgentHuman attacker = View ? View.GetComponent <AgentHuman>() : null; Owner.KnockDown(attacker, meleeType, direction); }