public void Shoot(Vector3 inPosition, Vector3 inDirection, LayerMask inLayerMask, string by) { var bullet = ObjectPool.GetObject <BulletView>(); if (bullet == null) { GameExceptions.Exception($"Pool is Empty! increase the size of the buffer."); } AudioSystem.Play(AudioLabel.Shoot); bullet.Launch(inPosition, inDirection, inLayerMask, by); bullet.onDspawn += OnDespawnBullet; _bulletsInScene.Add(bullet); }
private static void SendRequest(RequestHelper request, Action <string> onCompleted, Action <string> onFailed) { if (!_isInitialized) { GameExceptions.Exception($"RestClient must be initialized to send request."); } Proyecto26.RestClient.Request(request) .Then(response => { onCompleted?.Invoke(response.Text); Proyecto26.RestClient.ClearDefaultHeaders(); }) .Catch(err => onFailed?.Invoke(err.Message)); }