Angepasste Garage, verbessertes Icon Asset system, range der türme vorschau beim ziehen

This commit is contained in:
PBM2H25BEB committed 2026-11-05 07:52:47 +01:00
1 parent 5486444dde
commit 5af8655c97
59 files changed
+12079 -457

No files matched your search

@@ -17,6 +17,7 @@ namespace DepthsOfGreed.HandbookUI
public event System.Action<int> PriorityChanged;
[Header("Authored scene references")]
public GameObject basementView;
public BasementRoomView roomView;
public GameObject handbookRoot;
public CanvasGroup handbookVisibility;
public HandbookController handbook;
@@ -61,7 +62,7 @@ namespace DepthsOfGreed.HandbookUI
{
signScale = liftSign.localScale;
truckScale = truck.localScale;
basementView.SetActive(false);
if(roomView)roomView.SetVisible(false);else basementView.SetActive(false);
doorGroup.gameObject.SetActive(false);
liftButton.onClick.AddListener(UseLift);
for (int i = 0; i < connectionButtons.Length; i++)
@@ -105,7 +106,7 @@ namespace DepthsOfGreed.HandbookUI
yield return Doors(true);
if (handbook) handbook.Close();
IsInBasement = !IsInBasement;
basementView.SetActive(IsInBasement);
if(roomView)roomView.SetVisible(IsInBasement);else basementView.SetActive(IsInBasement);
// Hide only the presentation. The backend on HandbookRoot must keep updating.
handbookVisibility.alpha = IsInBasement ? 0f : 1f;
handbookVisibility.interactable = !IsInBasement;
@@ -181,22 +182,21 @@ namespace DepthsOfGreed.HandbookUI
}
private void Update()
{
if (!IsInBasement) return;
if (Time.unscaledTime > nextRefresh) { nextRefresh = Time.unscaledTime + 0.25f; RefreshConnections(); }
if (HasSupplyBackend) { RenderBackendTruck(); return; }
if (!animateTruckPreview) { truckStatus.text = "LKW bereit"; return; }
if (Time.unscaledTime < truckPauseUntil) return;
if (Time.time < truckPauseUntil) return;
float destination = unloading ? unloadingPosition : loadingPositions[previewKind];
var p = truck.anchoredPosition;
float direction = destination - p.x;
if (Mathf.Abs(direction) > 0.1f)
truck.localScale = new Vector3(Mathf.Abs(truckScale.x) * Mathf.Sign(direction), truckScale.y, truckScale.z);
p.x = Mathf.MoveTowards(p.x, destination, Mathf.Max(0, truckSpeed) * Time.unscaledDeltaTime); truck.anchoredPosition = p;
p.x = Mathf.MoveTowards(p.x, destination, Mathf.Max(0, truckSpeed) * Time.deltaTime); truck.anchoredPosition = p;
truckStatus.text = (unloading ? "Zur Verteilerstation" : "Zum Behälter: " + kinds[previewKind]);
if (Mathf.Abs(p.x - destination) < 0.1f)
{
truckStatus.text = (unloading ? "Abladen" : "Beladen: " + kinds[previewKind]);
truckPauseUntil = Time.unscaledTime + loadingPause;
truckPauseUntil = Time.time + loadingPause;
if (unloading) previewKind = Priority >= 0 ? Priority : (previewKind + 1) % 3;
unloading = !unloading;
}