Beispiel #1
0
        private void _handleCollision()
        {
            if (_projectileAttributes.Hit)
            {
                return;
            }

            if (_mobModifierRpc == null)
            {
                _mobModifierRpc = MobModifierRpcServer.Instance;
                return;
            }

            if (_projectileAttributes.Target.HitSphere <=
                Vector3.Distance(_destination, transform.position))
            {
                return;
            }

            if (_projectileAttributes.ServerProjectile && !_projectileAttributes.Target.Dead)
            {
                _projectileAttributes.Target.Health -= _projectileAttributes.Damage;
                _mobModifierRpc.UpdateHealthSendRpc(_projectileAttributes.TargetNumber, _projectileAttributes.Target.Health);
            }
            _projectileAttributes.Hit = true;
            Destroy(gameObject, _projectileAttributes.DeathClipLength);
        }