private void SetTransporterPosition(CarrierView carrierView, TransporterRemoteData transporterRemoteData) { float width = _path.rect.width; float unitDistance = width / Constants.WarehouseDistance; carrierView.RectTransform.anchoredPosition = new Vector2(width - transporterRemoteData.CurrentLocation * unitDistance, 0f); }
private void SetElevatorPosition(CarrierView carrierView, float location) { float height = _path.rect.height - carrierView.RectTransform.rect.height; float unitDistance = height / ElevatorHeight; var targetPos = new Vector2(0f, height - location * unitDistance + carrierView.RectTransform.rect.height); carrierView.RectTransform.anchoredPosition = targetPos; }
private void SetMinerPosition(CarrierView carrierView, MinerRemoteData minerRemoteData) { carrierView.RectTransform.anchoredPosition = new Vector2(_unitDistance * minerRemoteData.CurrentLocation, 0); }