public void ReloadShipController(GameObject provider, bool isRequired) { if (isRequired) { var newProvider = _providersPool.Pop(); var newModel = new ShipModel(new ShipData() { Provider = newProvider, Speed = _data.Speed, Acceleration = _data.Acceleration, HP = _data.HP, Force = _data.Force }); var moveImplementation = new AccelerationMove(newProvider.transform, newModel.Speed, newModel.Acceleration); var rotationImplementation = new RotationShip(newProvider.transform); GetShip.ReloadShip(moveImplementation, rotationImplementation, newModel); newProvider.GetComponent <IView>().ProviderDestroyed += GetShip.WatchToProviderDestroyed; } else { provider.GetComponent <IView>().ProviderDestroyed -= GetShip.WatchToProviderDestroyed; _providersPool.Push(provider); } }
public void Release() { BaseClient = default; Command = default; Payload = default; UId = default; internalOffset = default; pool.Push(this); }
public void RemoveWayPoint(Vector2 position) { for (int i = 0; i < _wayPoints.Count; i++) { if (_wayPoints[i].transform.position == new Vector3(position.x, position.y, 0)) { _pool.Push(_wayPoints[i]); _wayPoints.RemoveAt(i); } } }
public void Release() { using (semaphore.Wait()) { if (!manualReset.IsSet) { manualReset.Set(); } alreadyDeserialized = false; Timeouted = false; Serializable = null; pool.Push(this); } }
public void Dispose() { _cache.Push(this.Value); }
private void SendCompleted(object sender, SocketAsyncEventArgs e) { e.RemoteEndPoint = null; sendArgsPool.Push(e); }
private void SendCompleted(object sender, SocketAsyncEventArgs e) { sendArgsPool.Push(e); }
public void Release() { SenderId = 0; OnRelease(); pool.Push(this); }