void Update() { if (isBusy) { return; } if (Input.GetKeyDown(KeyCode.UpArrow)) { if (activeDisaster != null && activeDisaster.apartment == currentApartment && currentItem != null) { activeDisaster.Interact(this, currentItem); return; } if (activeDisasterSpawners.Count > 0) { DisasterSpawner spawner = activeDisasterSpawners.Find(ds => ds.broken && ds.apartment == currentApartment); if (spawner != null) { spawner.Fix(this); return; } } if (activeDoor != null) { activeDoor.Enter(this); return; } if (activeItems.Count > 0 && currentItem == null && activeItems[0].currentApartment == currentApartment) { PickUpItem(activeItems[0]); return; } } else if (Input.GetKeyDown(KeyCode.DownArrow)) { if (activeDoor != null && currentApartment != null) { activeDoor.Exit(this); return; } if (currentItem != null) { DropItem(currentItem); return; } } float deltaTime = Time.deltaTime; float distance = speed * deltaTime; float directionValue = 0f; if (Input.GetKey(KeyCode.LeftArrow)) { directionValue = -1f; } else if (Input.GetKey(KeyCode.RightArrow)) { directionValue = 1f; } Move(distance * directionValue); }