From 1db62882414d64a6a7ffa183ad1cf0d8209d8bc9 Mon Sep 17 00:00:00 2001 From: MariusLarilahti Date: Mon, 30 Mar 2026 14:09:44 +0300 Subject: [PATCH 01/11] Added rudimentary displayment of interactSlots when placing furniture --- .../Taakka/ArmChair_Taakka_Furniture.prefab | 1 + .../Scripts/SoulHome/FurnitureHandling.cs | 27 +++++++++++++ .../MenuUi/Scripts/SoulHome/FurnitureSlot.cs | 9 ++++- Assets/MenuUi/Scripts/SoulHome/RoomData.cs | 10 +++++ .../Scripts/SoulHome/TowerController.cs | 39 ++++++++++++++++++- 5 files changed, 83 insertions(+), 3 deletions(-) diff --git a/Assets/MenuUi/Prefabs/Windows/SoulHome/Furniture Assets/Taakka/ArmChair_Taakka_Furniture.prefab b/Assets/MenuUi/Prefabs/Windows/SoulHome/Furniture Assets/Taakka/ArmChair_Taakka_Furniture.prefab index 1a2910bad2..d95a38d47b 100644 --- a/Assets/MenuUi/Prefabs/Windows/SoulHome/Furniture Assets/Taakka/ArmChair_Taakka_Furniture.prefab +++ b/Assets/MenuUi/Prefabs/Windows/SoulHome/Furniture Assets/Taakka/ArmChair_Taakka_Furniture.prefab @@ -157,6 +157,7 @@ MonoBehaviour: _trayFurnitureObject: {fileID: 6752174233831251881, guid: 1b28187fcb500d44994fdaf7a4ce0946, type: 3} cullCheckAmount: 0.1 + _hasInteractionSlot: 1 --- !u!210 &5631410605880800485 SortingGroup: m_ObjectHideFlags: 0 diff --git a/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs b/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs index 9dc94cb519..99ab409323 100644 --- a/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs +++ b/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs @@ -50,6 +50,33 @@ public enum Direction private FurnitureSlot _slot; private FurnitureSlot _tempSlot; + //!!!!!!!!!!!!!!!!!!! + [SerializeField] + private bool _hasInteractionSlot = false; + private Vector2Int _interactionOffset = new Vector2Int(0, 1); + public bool HasInteractionSlot => _hasInteractionSlot; + + public FurnitureSlot AssignedInteractionSlot { get; private set; } + + public void SetInteractionSlot(FurnitureSlot slot) + { + AssignedInteractionSlot = slot; + } + + public Vector2Int GetRotatedInteractionOffset() + { + // Rotates the offset based on the current temp direction + return _tempSpriteDirection switch + { + Direction.Front => _interactionOffset, + Direction.Right => new Vector2Int(_interactionOffset.y, -_interactionOffset.x), + Direction.Back => new Vector2Int(-_interactionOffset.x, -_interactionOffset.y), + Direction.Left => new Vector2Int(-_interactionOffset.y, _interactionOffset.x), + _ => _interactionOffset + }; + } + //!!!!!!!!!!!!!!! + public Furniture Furniture { get => _furniture; set => _furniture = value; } public Vector2 Position { get => _position; set => _position = value; } public FurnitureSlot Slot { get => _slot; diff --git a/Assets/MenuUi/Scripts/SoulHome/FurnitureSlot.cs b/Assets/MenuUi/Scripts/SoulHome/FurnitureSlot.cs index 9174dc7f37..63217ede4c 100644 --- a/Assets/MenuUi/Scripts/SoulHome/FurnitureSlot.cs +++ b/Assets/MenuUi/Scripts/SoulHome/FurnitureSlot.cs @@ -82,9 +82,14 @@ public void InitializeSlot(int row, int column, int id, FurnitureGrid furnitureG _slotValidityIndicator.sortingOrder = id*1000 + 901; } - public void SetValidity(bool validity) + public void SetValidity(bool validity, bool isInteractSlot = false) { - if (validity) + if (isInteractSlot) + { + + _slotValidityIndicator.color = new Color(1, 1, 0, 0.3f); //Yellow + } + else if (validity) { _slotValidityIndicator.color = new Color(0,1,0, 0.3f); } diff --git a/Assets/MenuUi/Scripts/SoulHome/RoomData.cs b/Assets/MenuUi/Scripts/SoulHome/RoomData.cs index 11323d5761..5b6f5e4fd7 100644 --- a/Assets/MenuUi/Scripts/SoulHome/RoomData.cs +++ b/Assets/MenuUi/Scripts/SoulHome/RoomData.cs @@ -1193,5 +1193,15 @@ public void ResetPosition(GameObject furniture, bool temp) } furniture.GetComponent().SetScale(); } + + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + public void AddToValidityList(FurnitureSlot slot) + { + if (slot != null && !_currentSlotValidity.Contains(slot)) + { + _currentSlotValidity.Add(slot); + } + } + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! } } diff --git a/Assets/MenuUi/Scripts/SoulHome/TowerController.cs b/Assets/MenuUi/Scripts/SoulHome/TowerController.cs index 4e29c6b305..496dc94138 100644 --- a/Assets/MenuUi/Scripts/SoulHome/TowerController.cs +++ b/Assets/MenuUi/Scripts/SoulHome/TowerController.cs @@ -664,6 +664,43 @@ public void PlaceFurniture(Vector2 hitPoint, bool hover) if (hit2.collider.gameObject.CompareTag("Room")) { check = hit2.collider.GetComponent().HandleFurniturePosition(hitArray, _selectedFurniture, hover, hitPoint, hitRoom); + + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + if (hover && _selectedFurniture != null) + { + FurnitureSlot hoveredSlot = null; + foreach (RaycastHit2D slotHit in hitArray) + { + if (slotHit.collider.CompareTag("FloorFurnitureSlot") || slotHit.collider.CompareTag("WallFurnitureSlot")) + { + hoveredSlot = slotHit.collider.GetComponent(); + break; + } + } + + if (hoveredSlot != null) + { + FurnitureHandling handling = _selectedFurniture.GetComponent(); + if (handling.HasInteractionSlot) + { + Vector2Int offset = handling.GetRotatedInteractionOffset(); + int targetCol = hoveredSlot.column + offset.x; + int targetRow = hoveredSlot.row + offset.y; + + RoomData room = hit2.collider.GetComponent(); + // keeps it inside room bounds and sets validity + if (targetCol >= 0 && targetCol < room.SlotColumns && targetRow >= 0 && targetRow < room.SlotRows) + { + FurnitureSlot interactSlot = room.Grid[targetCol, targetRow].FurnitureSlot; + interactSlot.SetValidity(true, true); + room.AddToValidityList(interactSlot); + } + } + } + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + } + + } } if (hover) @@ -792,7 +829,7 @@ public void ResetChanges() int roomId = furniture.GetComponent().TempSlot.roomId; _rooms.transform.GetChild(roomId).GetChild(0).GetComponent().FreeFurnitureSlots(furniture.GetComponent(), furniture.GetComponent().TempSlot); } - + furniture.GetComponent().ResetSlot(); furniture.GetComponent().ResetDirection(); } From c0a17fb829283723aedac140bb08aad1a94eeaf3 Mon Sep 17 00:00:00 2001 From: MariusLarilahti Date: Tue, 7 Apr 2026 09:58:27 +0300 Subject: [PATCH 02/11] Updated to handle different slot shapes and save slots for future use --- .../Scripts/SoulHome/FurnitureHandling.cs | 33 ++++- .../MenuUi/Scripts/SoulHome/FurnitureSlot.cs | 2 + .../Scripts/SoulHome/TowerController.cs | 123 +++++++++++++++--- 3 files changed, 135 insertions(+), 23 deletions(-) diff --git a/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs b/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs index 99ab409323..8f31823389 100644 --- a/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs +++ b/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs @@ -16,6 +16,11 @@ public enum Direction Right, Back } + public enum InteractionPattern + { + Surround, // All surrounding slots + FrontRow, // All slots along the "front" width + } [SerializeField] private string _name; @@ -56,13 +61,35 @@ public enum Direction private Vector2Int _interactionOffset = new Vector2Int(0, 1); public bool HasInteractionSlot => _hasInteractionSlot; - public FurnitureSlot AssignedInteractionSlot { get; private set; } + //public FurnitureSlot AssignedInteractionSlot { get; private set; } + + + //------------------------------------------------------------------------------------------------------------------------------------------------ + [SerializeField] public InteractionPattern Pattern = InteractionPattern.FrontRow; + public List AssignedInteractionSlots { get; private set; } = new List(); + + public void ClearInteractionSlots() + { + foreach (var slot in AssignedInteractionSlots) slot.IsReserved = false; + AssignedInteractionSlots.Clear(); + } - public void SetInteractionSlot(FurnitureSlot slot) + public void AddInteractionSlot(FurnitureSlot slot) { - AssignedInteractionSlot = slot; + if (!AssignedInteractionSlots.Contains(slot)) + { + slot.IsReserved = true; + AssignedInteractionSlots.Add(slot); + } } + //------------------------------------------------------------------------------------------------------------------------------------------------ + + //public void SetInteractionSlot(FurnitureSlot slot) + //{ + // AssignedInteractionSlot = slot; + //} + // WORK IN PROGRESS: DOESNT FUNCTION PROPERLY public Vector2Int GetRotatedInteractionOffset() { // Rotates the offset based on the current temp direction diff --git a/Assets/MenuUi/Scripts/SoulHome/FurnitureSlot.cs b/Assets/MenuUi/Scripts/SoulHome/FurnitureSlot.cs index 63217ede4c..410e682d55 100644 --- a/Assets/MenuUi/Scripts/SoulHome/FurnitureSlot.cs +++ b/Assets/MenuUi/Scripts/SoulHome/FurnitureSlot.cs @@ -27,6 +27,8 @@ public class FurnitureSlot : MonoBehaviour [SerializeField] private SpriteRenderer _slotValidityIndicator; + public bool IsReserved { get; set; } + public Furniture Furniture { get => furniture; set { diff --git a/Assets/MenuUi/Scripts/SoulHome/TowerController.cs b/Assets/MenuUi/Scripts/SoulHome/TowerController.cs index 496dc94138..24e43af628 100644 --- a/Assets/MenuUi/Scripts/SoulHome/TowerController.cs +++ b/Assets/MenuUi/Scripts/SoulHome/TowerController.cs @@ -9,6 +9,7 @@ using UnityEngine.InputSystem; using Altzone.Scripts.Model.Poco.Game; using Altzone.Scripts.Audio; +using static MenuUI.Scripts.SoulHome.FurnitureHandling; namespace MenuUI.Scripts.SoulHome { @@ -222,7 +223,7 @@ void Update() //Debug.Log("Touch: X: " + (prevp.x - lp.x)); if (touch.phase is UnityEngine.InputSystem.TouchPhase.Ended or UnityEngine.InputSystem.TouchPhase.Canceled) { - startScrollSlide = new Vector2(Mathf.Abs(prevp.x - lp.x) / scrollSpeed, 0); + startScrollSlide = new Vector2(Mathf.Abs(prevp.x - lp.x) / scrollSpeed, 0); currentScrollSlide = startScrollSlide; currentScrollSlideDirection = new Vector2(prevp.x - lp.x, 0); currentScrollSlideDirection.Normalize(); @@ -395,7 +396,7 @@ public bool FindRayPoint(Vector2 relPoint, ClickState click) } //_furnitureList.Add(furnitureObject); } - } + } if (hit2.collider.gameObject.CompareTag("Room")) { @@ -556,7 +557,7 @@ public void ZoomIn(GameObject room) { _soulHomeController.SetRoomName(selectedRoom); _camera.transform.position = new(room.transform.position.x, room.transform.position.y + room.GetComponent().size.y / 2,_camera.transform.position.z); - + outDelay = Time.time; _mainScreen.LeaveRoomButton.SetActive(true); @@ -666,40 +667,89 @@ public void PlaceFurniture(Vector2 hitPoint, bool hover) check = hit2.collider.GetComponent().HandleFurniturePosition(hitArray, _selectedFurniture, hover, hitPoint, hitRoom); //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + if (hover && _selectedFurniture != null) { - FurnitureSlot hoveredSlot = null; - foreach (RaycastHit2D slotHit in hitArray) + FurnitureHandling handling = _selectedFurniture.GetComponent(); + FurnitureSlot hoveredSlot = GetHoveredSlot(hitArray); + + if (hoveredSlot != null) { - if (slotHit.collider.CompareTag("FloorFurnitureSlot") || slotHit.collider.CompareTag("WallFurnitureSlot")) + //FurnitureHandling handling = _selectedFurniture.GetComponent(); + if (handling.HasInteractionSlot) { - hoveredSlot = slotHit.collider.GetComponent(); - break; + Vector2Int offset = handling.GetRotatedInteractionOffset(); + RoomData room = hit2.collider.GetComponent(); + + if (handling.Pattern == InteractionPattern.FrontRow) + { + for (int i = 0; i < size.x; i++) + { + HighlightSlot(room, hoveredSlot.column + offset.x + i, hoveredSlot.row + offset.y); + } + } + else if (handling.Pattern == InteractionPattern.Surround) + { + for (int x = -1; x <= size.x; x++) + { + for (int y = -1; y <= size.y; y++) + { + bool isBorder = (x == -1 || x == size.x || y == -1 || y == size.y); + + if (isBorder) + { + HighlightSlot(room, hoveredSlot.column + x, hoveredSlot.row + y); + } + } + } + } } } + } - if (hoveredSlot != null) + if (!hover && check && _selectedFurniture != null) + { + FurnitureHandling handling = _selectedFurniture.GetComponent(); + + if (handling.HasInteractionSlot) { - FurnitureHandling handling = _selectedFurniture.GetComponent(); - if (handling.HasInteractionSlot) + handling.ClearInteractionSlots(); + FurnitureSlot hoveredSlot = GetHoveredSlot(hitArray); + + if (hoveredSlot != null) { Vector2Int offset = handling.GetRotatedInteractionOffset(); - int targetCol = hoveredSlot.column + offset.x; - int targetRow = hoveredSlot.row + offset.y; RoomData room = hit2.collider.GetComponent(); - // keeps it inside room bounds and sets validity - if (targetCol >= 0 && targetCol < room.SlotColumns && targetRow >= 0 && targetRow < room.SlotRows) + + if (handling.Pattern == InteractionPattern.FrontRow) + { + for (int i = 0; i < size.x; i++) + { + SaveSlot(room, hoveredSlot.column + offset.x + i, hoveredSlot.row + offset.y, handling); + } + } + else if (handling.Pattern == InteractionPattern.Surround) { - FurnitureSlot interactSlot = room.Grid[targetCol, targetRow].FurnitureSlot; - interactSlot.SetValidity(true, true); - room.AddToValidityList(interactSlot); + for (int x = -1; x <= size.x; x++) + { + for (int y = -1; y <= size.y; y++) + { + bool isHorizontalBorder = (x == -1 || x == size.x); + bool isVerticalBorder = (y == -1 || y == size.y); + + if (isHorizontalBorder || isVerticalBorder) + { + SaveSlot(room, hoveredSlot.column + x, hoveredSlot.row + y, handling); + } + } + } } + } } - //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! } - + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! } } @@ -1028,5 +1078,38 @@ public float GetCameraXDistance() //Debug.Log(widthToEdge + ":" + cameraAngle + ":" + Mathf.Tan(cameraAngle * (Mathf.PI / 180)) + ":" + distanceMaxX); return distanceMaxX; } + + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + private FurnitureSlot GetHoveredSlot(RaycastHit2D[] hits) + { + foreach (RaycastHit2D hit in hits) + { + if (hit.collider.CompareTag("FloorFurnitureSlot") || hit.collider.CompareTag("WallFurnitureSlot")) + { + return hit.collider.GetComponent(); + } + } + return null; + } + + private void SaveSlot(RoomData room, int col, int row, FurnitureHandling handling) + { + if (col >= 0 && col < room.SlotColumns && row >= 0 && row < room.SlotRows) + { + FurnitureSlot slot = room.Grid[col, row].FurnitureSlot; + handling.AddInteractionSlot(slot); + } + } + + private void HighlightSlot(RoomData room, int col, int row) + { + if (col >= 0 && col < room.SlotColumns && row >= 0 && row < room.SlotRows) + { + FurnitureSlot interactSlot = room.Grid[col, row].FurnitureSlot; + interactSlot.SetValidity(true, true); + room.AddToValidityList(interactSlot); // prevents lingering yellows + } + } + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! } } From 7c48841bab4e67f979380e23240c479232ec7b46 Mon Sep 17 00:00:00 2001 From: MariusLarilahti Date: Mon, 13 Apr 2026 08:44:12 +0300 Subject: [PATCH 03/11] Added pathing and temporary interaction with furniture --- .../Taakka/ArmChair_Taakka_Furniture.prefab | 1 + .../CoffeeTable_Taakka_Furniture.prefab | 2 + .../Scripts/SoulHome/FurnitureHandling.cs | 22 +++++++ .../SoulHome/SoulHomeAvatarController.cs | 59 ++++++++++++++++++- 4 files changed, 81 insertions(+), 3 deletions(-) diff --git a/Assets/MenuUi/Prefabs/Windows/SoulHome/Furniture Assets/Taakka/ArmChair_Taakka_Furniture.prefab b/Assets/MenuUi/Prefabs/Windows/SoulHome/Furniture Assets/Taakka/ArmChair_Taakka_Furniture.prefab index d95a38d47b..cde00c4ec1 100644 --- a/Assets/MenuUi/Prefabs/Windows/SoulHome/Furniture Assets/Taakka/ArmChair_Taakka_Furniture.prefab +++ b/Assets/MenuUi/Prefabs/Windows/SoulHome/Furniture Assets/Taakka/ArmChair_Taakka_Furniture.prefab @@ -158,6 +158,7 @@ MonoBehaviour: type: 3} cullCheckAmount: 0.1 _hasInteractionSlot: 1 + Pattern: 1 --- !u!210 &5631410605880800485 SortingGroup: m_ObjectHideFlags: 0 diff --git a/Assets/MenuUi/Prefabs/Windows/SoulHome/Furniture Assets/Taakka/CoffeeTable_Taakka_Furniture.prefab b/Assets/MenuUi/Prefabs/Windows/SoulHome/Furniture Assets/Taakka/CoffeeTable_Taakka_Furniture.prefab index c2c3655680..bfdf957b73 100644 --- a/Assets/MenuUi/Prefabs/Windows/SoulHome/Furniture Assets/Taakka/CoffeeTable_Taakka_Furniture.prefab +++ b/Assets/MenuUi/Prefabs/Windows/SoulHome/Furniture Assets/Taakka/CoffeeTable_Taakka_Furniture.prefab @@ -157,6 +157,8 @@ MonoBehaviour: _trayFurnitureObject: {fileID: 6752174233831251881, guid: 51a482fa8b9398d41af78f689c11ef7c, type: 3} cullCheckAmount: 0.1 + _hasInteractionSlot: 1 + Pattern: 1 --- !u!210 &4009186818869656794 SortingGroup: m_ObjectHideFlags: 0 diff --git a/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs b/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs index 8f31823389..6cdee42345 100644 --- a/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs +++ b/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs @@ -7,6 +7,8 @@ namespace MenuUI.Scripts.SoulHome { + + public class FurnitureHandling : MonoBehaviour { public enum Direction @@ -82,6 +84,26 @@ public void AddInteractionSlot(FurnitureSlot slot) AssignedInteractionSlots.Add(slot); } } + + public FurnitureSlot GetClosestInteractionSlot(Vector3 npcPosition) + { + if (AssignedInteractionSlots == null || AssignedInteractionSlots.Count == 0) + return null; + + FurnitureSlot closest = null; + float minDistance = float.MaxValue; + + foreach (var slot in AssignedInteractionSlots) + { + float dist = Vector3.Distance(npcPosition, slot.transform.position); + if (dist < minDistance) + { + minDistance = dist; + closest = slot; + } + } + return closest; + } //------------------------------------------------------------------------------------------------------------------------------------------------ //public void SetInteractionSlot(FurnitureSlot slot) diff --git a/Assets/MenuUi/Scripts/SoulHome/SoulHomeAvatarController.cs b/Assets/MenuUi/Scripts/SoulHome/SoulHomeAvatarController.cs index 14f9f21251..d834472b2b 100644 --- a/Assets/MenuUi/Scripts/SoulHome/SoulHomeAvatarController.cs +++ b/Assets/MenuUi/Scripts/SoulHome/SoulHomeAvatarController.cs @@ -46,6 +46,8 @@ public class SoulHomeAvatarController : MonoBehaviour, ISoulHomeObjectClick private AvatarStatus _status; + private FurnitureHandling _targetFurniture; + private Transform _points; private RoomData _roomData; private List _travelPoints = new(); @@ -82,7 +84,7 @@ void Start() { //_animator.keepAnimatorStateOnDisable = true; _animator.writeDefaultValuesOnDisable = true; - + if (transform.parent.CompareTag("Room")) { @@ -176,10 +178,21 @@ private IEnumerator HandleIdle() while (elapsed < idleTime) { elapsed += Time.deltaTime; - yield return null; } + //Random chance to move towards furniture + if (Random.Range(0, 100) < 70) + { + FurnitureHandling[] items = _roomData.GetComponentsInChildren(); + if (items.Length > 0) + { + int randomIndex = Random.Range(0, items.Length); + MoveToFurniture(items[randomIndex].gameObject); + yield break; + } + } + SelectStatus(); } @@ -267,7 +280,8 @@ private IEnumerator MoveRoutine(bool changeRoom) } else { - SelectStatus(); + OnArrival(); // always ends in SelectStatus() + //SelectStatus(); } } @@ -733,6 +747,45 @@ public void HandleClick() StartCoroutine(InteractAnimation()); } + public void MoveToFurniture(GameObject furnitureObj) + { + _targetFurniture = furnitureObj.GetComponent(); + if (_targetFurniture == null) return; + + FurnitureSlot targetSlot = _targetFurniture.GetClosestInteractionSlot(transform.position); + if (targetSlot != null) + { + if (_statusCoroutine != null) StopCoroutine(_statusCoroutine); + _travelPoints.Clear(); + _status = AvatarStatus.Wander; + + Vector2Int targetGridPos = new Vector2Int(targetSlot.column, targetSlot.row); + HandleWander(targetGridPos); + } + else + { + _targetFurniture = null; + SelectStatus(); + } + } + + private void OnArrival() + { + + if (_targetFurniture != null) + { + Debug.Log($"NPC arrived at: {_targetFurniture.gameObject.name}"); + _targetFurniture = null; + + //Temporary until real furniture interaction is added + StartCoroutine(InteractAnimation()); + } + else + { + SelectStatus(); + } + } + #if UNITY_EDITOR private void OnDrawGizmos() From 2baba18561d8f50c0b8a218771f6cd909676db07 Mon Sep 17 00:00:00 2001 From: MariusLarilahti Date: Mon, 20 Apr 2026 11:41:38 +0300 Subject: [PATCH 04/11] Refactored to rotate properly --- .../Taakka/Floorlamp_Taakka_Furniture.prefab | 2 + .../Scripts/SoulHome/FurnitureHandling.cs | 18 +-- .../Scripts/SoulHome/TowerController.cs | 131 +++++++++++++----- 3 files changed, 106 insertions(+), 45 deletions(-) diff --git a/Assets/MenuUi/Prefabs/Windows/SoulHome/Furniture Assets/Taakka/Floorlamp_Taakka_Furniture.prefab b/Assets/MenuUi/Prefabs/Windows/SoulHome/Furniture Assets/Taakka/Floorlamp_Taakka_Furniture.prefab index 32166be919..0545aabb35 100644 --- a/Assets/MenuUi/Prefabs/Windows/SoulHome/Furniture Assets/Taakka/Floorlamp_Taakka_Furniture.prefab +++ b/Assets/MenuUi/Prefabs/Windows/SoulHome/Furniture Assets/Taakka/Floorlamp_Taakka_Furniture.prefab @@ -157,6 +157,8 @@ MonoBehaviour: _trayFurnitureObject: {fileID: 6752174233831251881, guid: 9a69f4ef2d7504345bd286ab4ffdb68c, type: 3} cullCheckAmount: 0.1 + _hasInteractionSlot: 1 + Pattern: 0 --- !u!210 &4891055075118862418 SortingGroup: m_ObjectHideFlags: 0 diff --git a/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs b/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs index 6cdee42345..91b5c3cecc 100644 --- a/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs +++ b/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs @@ -57,16 +57,11 @@ public enum InteractionPattern private FurnitureSlot _slot; private FurnitureSlot _tempSlot; - //!!!!!!!!!!!!!!!!!!! [SerializeField] private bool _hasInteractionSlot = false; private Vector2Int _interactionOffset = new Vector2Int(0, 1); public bool HasInteractionSlot => _hasInteractionSlot; - //public FurnitureSlot AssignedInteractionSlot { get; private set; } - - - //------------------------------------------------------------------------------------------------------------------------------------------------ [SerializeField] public InteractionPattern Pattern = InteractionPattern.FrontRow; public List AssignedInteractionSlots { get; private set; } = new List(); @@ -85,6 +80,7 @@ public void AddInteractionSlot(FurnitureSlot slot) } } + //Gets closest interaction slot for npc to path to public FurnitureSlot GetClosestInteractionSlot(Vector3 npcPosition) { if (AssignedInteractionSlots == null || AssignedInteractionSlots.Count == 0) @@ -104,27 +100,21 @@ public FurnitureSlot GetClosestInteractionSlot(Vector3 npcPosition) } return closest; } - //------------------------------------------------------------------------------------------------------------------------------------------------ - //public void SetInteractionSlot(FurnitureSlot slot) - //{ - // AssignedInteractionSlot = slot; - //} - // WORK IN PROGRESS: DOESNT FUNCTION PROPERLY public Vector2Int GetRotatedInteractionOffset() { // Rotates the offset based on the current temp direction return _tempSpriteDirection switch { Direction.Front => _interactionOffset, - Direction.Right => new Vector2Int(_interactionOffset.y, -_interactionOffset.x), + Direction.Right => new Vector2Int(-_interactionOffset.y, _interactionOffset.x), Direction.Back => new Vector2Int(-_interactionOffset.x, -_interactionOffset.y), - Direction.Left => new Vector2Int(-_interactionOffset.y, _interactionOffset.x), + Direction.Left => new Vector2Int(_interactionOffset.y + GetFurnitureSize().x - 1, -_interactionOffset.x), _ => _interactionOffset }; } - //!!!!!!!!!!!!!!! + public Furniture Furniture { get => _furniture; set => _furniture = value; } public Vector2 Position { get => _position; set => _position = value; } diff --git a/Assets/MenuUi/Scripts/SoulHome/TowerController.cs b/Assets/MenuUi/Scripts/SoulHome/TowerController.cs index 24e43af628..0758a8d8ef 100644 --- a/Assets/MenuUi/Scripts/SoulHome/TowerController.cs +++ b/Assets/MenuUi/Scripts/SoulHome/TowerController.cs @@ -666,8 +666,7 @@ public void PlaceFurniture(Vector2 hitPoint, bool hover) { check = hit2.collider.GetComponent().HandleFurniturePosition(hitArray, _selectedFurniture, hover, hitPoint, hitRoom); - //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - + //Displayment of interact slots during placement if (hover && _selectedFurniture != null) { FurnitureHandling handling = _selectedFurniture.GetComponent(); @@ -675,7 +674,6 @@ public void PlaceFurniture(Vector2 hitPoint, bool hover) if (hoveredSlot != null) { - //FurnitureHandling handling = _selectedFurniture.GetComponent(); if (handling.HasInteractionSlot) { Vector2Int offset = handling.GetRotatedInteractionOffset(); @@ -683,30 +681,68 @@ public void PlaceFurniture(Vector2 hitPoint, bool hover) if (handling.Pattern == InteractionPattern.FrontRow) { - for (int i = 0; i < size.x; i++) + bool isVertical = handling.TempSpriteDirection == Direction.Left || handling.TempSpriteDirection == Direction.Right; + + int length; + if (isVertical) { - HighlightSlot(room, hoveredSlot.column + offset.x + i, hoveredSlot.row + offset.y); + length = (int)size.y; } + else + { + length = (int)size.x; + } + + for (int i = 0; i < length; i++) + { + int targetCol; + int targetRow; + + if (isVertical) + { + targetCol = hoveredSlot.column + offset.x; + targetRow = hoveredSlot.row + offset.y - i; + } + else + { + targetCol = hoveredSlot.column + offset.x + i; + targetRow = hoveredSlot.row + offset.y; + } + HighlightSlot(room, targetCol, targetRow); + } + } else if (handling.Pattern == InteractionPattern.Surround) { - for (int x = -1; x <= size.x; x++) + bool isVertical = handling.TempSpriteDirection == Direction.Left || handling.TempSpriteDirection == Direction.Right; + + //get dimensions on based on rotation + int w = isVertical ? (int)size.y : (int)size.x; + int h = isVertical ? (int)size.x : (int)size.y; + + //Horizontal lines + for (int i = 0; i < w; i++) { - for (int y = -1; y <= size.y; y++) - { - bool isBorder = (x == -1 || x == size.x || y == -1 || y == size.y); + // One tile above the furniture + HighlightSlot(room, hoveredSlot.column + i, hoveredSlot.row + 1); + // One tile below the furniture + HighlightSlot(room, hoveredSlot.column + i, hoveredSlot.row - 2); + } - if (isBorder) - { - HighlightSlot(room, hoveredSlot.column + x, hoveredSlot.row + y); - } - } + //Vertical lines + for (int i = 0; i < h; i++) + { + // One tile to the left + HighlightSlot(room, hoveredSlot.column - 1, hoveredSlot.row + i - 1); + // One tile to the right + HighlightSlot(room, hoveredSlot.column + w, hoveredSlot.row + i - 1); } } } } } + //Saving of interact slots after placement if (!hover && check && _selectedFurniture != null) { FurnitureHandling handling = _selectedFurniture.GetComponent(); @@ -724,33 +760,66 @@ public void PlaceFurniture(Vector2 hitPoint, bool hover) if (handling.Pattern == InteractionPattern.FrontRow) { - for (int i = 0; i < size.x; i++) + bool isVertical = handling.TempSpriteDirection == Direction.Left || handling.TempSpriteDirection == Direction.Right; + + int length; + if (isVertical) + { + length = (int)size.y; + } + else { - SaveSlot(room, hoveredSlot.column + offset.x + i, hoveredSlot.row + offset.y, handling); + length = (int)size.x; + } + + for (int i = 0; i < length; i++) + { + int targetCol; + int targetRow; + + if (isVertical) + { + targetCol = hoveredSlot.column + offset.x; + targetRow = hoveredSlot.row + offset.y - i; + } + else + { + targetCol = hoveredSlot.column + offset.x + i; + targetRow = hoveredSlot.row + offset.y; + } + SaveSlot(room, targetCol, targetRow, handling); } } else if (handling.Pattern == InteractionPattern.Surround) { - for (int x = -1; x <= size.x; x++) + bool isVertical = handling.TempSpriteDirection == Direction.Left || handling.TempSpriteDirection == Direction.Right; + + //get dimensions on based on rotation + int w = isVertical ? (int)size.y : (int)size.x; + int h = isVertical ? (int)size.x : (int)size.y; + + //Horizontal lines + for (int i = 0; i < w; i++) { - for (int y = -1; y <= size.y; y++) - { - bool isHorizontalBorder = (x == -1 || x == size.x); - bool isVerticalBorder = (y == -1 || y == size.y); + // One tile above the furniture + SaveSlot(room, hoveredSlot.column + i, hoveredSlot.row + 1, handling); + // One tile below the furniture + SaveSlot(room, hoveredSlot.column + i, hoveredSlot.row - 2, handling); + } - if (isHorizontalBorder || isVerticalBorder) - { - SaveSlot(room, hoveredSlot.column + x, hoveredSlot.row + y, handling); - } - } + //Vertical lines + for (int i = 0; i < h; i++) + { + // One tile to the left + SaveSlot(room, hoveredSlot.column - 1, hoveredSlot.row + i - 1, handling); + // One tile to the right + SaveSlot(room, hoveredSlot.column + w, hoveredSlot.row + i - 1, handling); } } } } } - //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - } } if (hover) @@ -1079,7 +1148,6 @@ public float GetCameraXDistance() return distanceMaxX; } - //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! private FurnitureSlot GetHoveredSlot(RaycastHit2D[] hits) { foreach (RaycastHit2D hit in hits) @@ -1092,6 +1160,7 @@ private FurnitureSlot GetHoveredSlot(RaycastHit2D[] hits) return null; } + //Helper method for saving interctable slots private void SaveSlot(RoomData room, int col, int row, FurnitureHandling handling) { if (col >= 0 && col < room.SlotColumns && row >= 0 && row < room.SlotRows) @@ -1101,15 +1170,15 @@ private void SaveSlot(RoomData room, int col, int row, FurnitureHandling handlin } } + //Helper method for highlighting interctable slots private void HighlightSlot(RoomData room, int col, int row) { if (col >= 0 && col < room.SlotColumns && row >= 0 && row < room.SlotRows) { FurnitureSlot interactSlot = room.Grid[col, row].FurnitureSlot; interactSlot.SetValidity(true, true); - room.AddToValidityList(interactSlot); // prevents lingering yellows + room.AddToValidityList(interactSlot); } } - //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! } } From 45baad101bf160f2a9ee1e489783615990c062e9 Mon Sep 17 00:00:00 2001 From: MariusLarilahti Date: Wed, 22 Apr 2026 10:42:02 +0300 Subject: [PATCH 05/11] Fixed surround pattern rotation issues --- .../Taakka/Sofa_Taakka_Furniture.prefab | 2 ++ .../Scripts/SoulHome/FurnitureHandling.cs | 2 +- .../Scripts/SoulHome/TowerController.cs | 28 +++++++++---------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Assets/MenuUi/Prefabs/Windows/SoulHome/Furniture Assets/Taakka/Sofa_Taakka_Furniture.prefab b/Assets/MenuUi/Prefabs/Windows/SoulHome/Furniture Assets/Taakka/Sofa_Taakka_Furniture.prefab index ae2544ba08..a2f994cf1e 100644 --- a/Assets/MenuUi/Prefabs/Windows/SoulHome/Furniture Assets/Taakka/Sofa_Taakka_Furniture.prefab +++ b/Assets/MenuUi/Prefabs/Windows/SoulHome/Furniture Assets/Taakka/Sofa_Taakka_Furniture.prefab @@ -157,6 +157,8 @@ MonoBehaviour: _trayFurnitureObject: {fileID: 6752174233831251881, guid: 4e82351aae20cc84899b237b1cb3093a, type: 3} cullCheckAmount: 0.1 + _hasInteractionSlot: 1 + Pattern: 0 --- !u!210 &6881114897110281887 SortingGroup: m_ObjectHideFlags: 0 diff --git a/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs b/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs index 91b5c3cecc..73288f8e47 100644 --- a/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs +++ b/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs @@ -80,7 +80,7 @@ public void AddInteractionSlot(FurnitureSlot slot) } } - //Gets closest interaction slot for npc to path to + //Get closest interaction slot for npc to path to public FurnitureSlot GetClosestInteractionSlot(Vector3 npcPosition) { if (AssignedInteractionSlots == null || AssignedInteractionSlots.Count == 0) diff --git a/Assets/MenuUi/Scripts/SoulHome/TowerController.cs b/Assets/MenuUi/Scripts/SoulHome/TowerController.cs index 0758a8d8ef..c1cd59d785 100644 --- a/Assets/MenuUi/Scripts/SoulHome/TowerController.cs +++ b/Assets/MenuUi/Scripts/SoulHome/TowerController.cs @@ -723,19 +723,19 @@ public void PlaceFurniture(Vector2 hitPoint, bool hover) //Horizontal lines for (int i = 0; i < w; i++) { - // One tile above the furniture + //Below the furniture HighlightSlot(room, hoveredSlot.column + i, hoveredSlot.row + 1); - // One tile below the furniture - HighlightSlot(room, hoveredSlot.column + i, hoveredSlot.row - 2); + //Above the furniture + HighlightSlot(room, hoveredSlot.column + i, hoveredSlot.row - size.y); } //Vertical lines for (int i = 0; i < h; i++) { - // One tile to the left - HighlightSlot(room, hoveredSlot.column - 1, hoveredSlot.row + i - 1); - // One tile to the right - HighlightSlot(room, hoveredSlot.column + w, hoveredSlot.row + i - 1); + //To the left + HighlightSlot(room, hoveredSlot.column - 1, hoveredSlot.row + i - size.y + 1); + //to the right + HighlightSlot(room, hoveredSlot.column + w, hoveredSlot.row + i - size.y + 1); } } } @@ -801,19 +801,19 @@ public void PlaceFurniture(Vector2 hitPoint, bool hover) //Horizontal lines for (int i = 0; i < w; i++) { - // One tile above the furniture + //Below the furniture SaveSlot(room, hoveredSlot.column + i, hoveredSlot.row + 1, handling); - // One tile below the furniture - SaveSlot(room, hoveredSlot.column + i, hoveredSlot.row - 2, handling); + //Above the furniture + SaveSlot(room, hoveredSlot.column + i, hoveredSlot.row - size.y, handling); } //Vertical lines for (int i = 0; i < h; i++) { - // One tile to the left - SaveSlot(room, hoveredSlot.column - 1, hoveredSlot.row + i - 1, handling); - // One tile to the right - SaveSlot(room, hoveredSlot.column + w, hoveredSlot.row + i - 1, handling); + //To the left + SaveSlot(room, hoveredSlot.column - 1, hoveredSlot.row + i - size.y + 1, handling); + //to the right + SaveSlot(room, hoveredSlot.column + w, hoveredSlot.row + i - size.y + 1, handling); } } From 27e649a1b41b2f83a1f65aef1b85c1f5704bfe52 Mon Sep 17 00:00:00 2001 From: MariusLarilahti Date: Sun, 26 Apr 2026 17:28:03 +0300 Subject: [PATCH 06/11] removed magic number --- Assets/MenuUi/Scripts/SoulHome/SoulHomeAvatarController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/MenuUi/Scripts/SoulHome/SoulHomeAvatarController.cs b/Assets/MenuUi/Scripts/SoulHome/SoulHomeAvatarController.cs index d834472b2b..a0f660f2ca 100644 --- a/Assets/MenuUi/Scripts/SoulHome/SoulHomeAvatarController.cs +++ b/Assets/MenuUi/Scripts/SoulHome/SoulHomeAvatarController.cs @@ -25,6 +25,7 @@ public class SoulHomeAvatarController : MonoBehaviour, ISoulHomeObjectClick [SerializeField] private float _roomChangeCooldown = 20f; // Percentage chance of avatar changing rooms when moving [SerializeField] private float _roomChangeChance = 50f; + [SerializeField] private float _furnitureInteractChance = 50f; [SerializeField] private SortingGroup _sortingGroup; [SerializeField] @@ -182,7 +183,7 @@ private IEnumerator HandleIdle() } //Random chance to move towards furniture - if (Random.Range(0, 100) < 70) + if (Random.Range(0, 100) < _furnitureInteractChance) { FurnitureHandling[] items = _roomData.GetComponentsInChildren(); if (items.Length > 0) @@ -771,7 +772,6 @@ public void MoveToFurniture(GameObject furnitureObj) private void OnArrival() { - if (_targetFurniture != null) { Debug.Log($"NPC arrived at: {_targetFurniture.gameObject.name}"); From 4efcf1bf717c094f41cb93d8016bdab0315854e7 Mon Sep 17 00:00:00 2001 From: emry-beep Date: Wed, 6 May 2026 12:45:10 +0300 Subject: [PATCH 07/11] Huonekalusetti Sekavuustila on ladattu. Huonekalusetti Sekavuustila on ladattu. --- .../FurnitureSekavuustilaIkkuna2EmYr.png | 3 +++ .../FurnitureSekavuustilaIkkunaEmYr.png | 3 +++ .../FurnitureSekavuustilaKeinutuoli2EmYr.png | 3 +++ .../FurnitureSekavuustilaKeinutuoliEmYr.png | 3 +++ .../FurnitureSekavuustilaKello2EmYr.png | 3 +++ .../FurnitureSekavuustilaKelloEmYr.png | 3 +++ .../FurnitureSekavuustilaMattoEmYr.png | 3 +++ .../FurnitureSekavuustilaSohva2EmYr.png | 3 +++ .../FurnitureSekavuustilaSohvaEmYr.png | 3 +++ .../FurnitureSekavuustilaS\303\244nky2EmYr.png" | 3 +++ .../FurnitureSekavuustilaS\303\244nkyEmYr.png" | 3 +++ .../FurnitureSekavuustilaVaatekaappi2EmYr.png | 3 +++ .../FurnitureSekavuustilaVaatekaappiEmYr.png | 3 +++ .../JulisteIsoTaustaSekavuustilaEmYr.png | 3 +++ .../JulistePieniTaustaSekavuustilaEmYr.png | 3 +++ .../SpritesheetSekavuustilaHuonekalusettiEmYr.png | 3 +++ 16 files changed, 48 insertions(+) create mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaIkkuna2EmYr.png create mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaIkkunaEmYr.png create mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKeinutuoli2EmYr.png create mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKeinutuoliEmYr.png create mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKello2EmYr.png create mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKelloEmYr.png create mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaMattoEmYr.png create mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaSohva2EmYr.png create mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaSohvaEmYr.png create mode 100644 "Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaS\303\244nky2EmYr.png" create mode 100644 "Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaS\303\244nkyEmYr.png" create mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaVaatekaappi2EmYr.png create mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaVaatekaappiEmYr.png create mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/JulisteIsoTaustaSekavuustilaEmYr.png create mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/JulistePieniTaustaSekavuustilaEmYr.png create mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/SpritesheetSekavuustilaHuonekalusettiEmYr.png diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaIkkuna2EmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaIkkuna2EmYr.png new file mode 100644 index 0000000000..6cf50b598e --- /dev/null +++ b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaIkkuna2EmYr.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b9ec8ad1c298dd0bbb814b90530c804ceaee366559365f0263802c27124853b +size 122242 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaIkkunaEmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaIkkunaEmYr.png new file mode 100644 index 0000000000..6d046f58ae --- /dev/null +++ b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaIkkunaEmYr.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1dfec1db91eb556ab7c67889d17a921b41c44bef557011ac71527078e729520 +size 135135 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKeinutuoli2EmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKeinutuoli2EmYr.png new file mode 100644 index 0000000000..85c35c2059 --- /dev/null +++ b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKeinutuoli2EmYr.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7b2556045b0ead141dd5d003424900fc4295727cf22c2f2a2261e21511394a36 +size 77780 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKeinutuoliEmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKeinutuoliEmYr.png new file mode 100644 index 0000000000..eb83850544 --- /dev/null +++ b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKeinutuoliEmYr.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91f69a573a17512d6c77af5a36dcfac75c0c1bf0d829393bb89872f87ee82803 +size 84893 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKello2EmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKello2EmYr.png new file mode 100644 index 0000000000..3b3bda88eb --- /dev/null +++ b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKello2EmYr.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9ae0347439468f18ad45230ac6a90d658f0fd59b94731420f6758f94e226e3c +size 41576 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKelloEmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKelloEmYr.png new file mode 100644 index 0000000000..0e12f75415 --- /dev/null +++ b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKelloEmYr.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d901864200a084cc60686d896bd770095d2dfa343cd44097a52c44a45b2de3a +size 39971 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaMattoEmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaMattoEmYr.png new file mode 100644 index 0000000000..b40bd3a6e0 --- /dev/null +++ b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaMattoEmYr.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f2c5fe05f97b9a15a5faa41761bdb4035c7621e5b487a81c5b5d2a2f68fcc8f +size 797191 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaSohva2EmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaSohva2EmYr.png new file mode 100644 index 0000000000..20ac3391b5 --- /dev/null +++ b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaSohva2EmYr.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8471038f137d4ca5603ac8662c11a39303957a7f187187aff5d5cc101a3f1add +size 336114 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaSohvaEmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaSohvaEmYr.png new file mode 100644 index 0000000000..e35540d6f9 --- /dev/null +++ b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaSohvaEmYr.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b820ac4186f8a94fb67cf4423347e79bee1c91a8018b6386888d612daf6b0112 +size 233247 diff --git "a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaS\303\244nky2EmYr.png" "b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaS\303\244nky2EmYr.png" new file mode 100644 index 0000000000..283a99b4f7 --- /dev/null +++ "b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaS\303\244nky2EmYr.png" @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c7d881c2b866a5f573680080ccd5ec4e0204ebcd66efb142d4338f9bec32656 +size 195866 diff --git "a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaS\303\244nkyEmYr.png" "b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaS\303\244nkyEmYr.png" new file mode 100644 index 0000000000..dd1b470e50 --- /dev/null +++ "b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaS\303\244nkyEmYr.png" @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:314a61267b5becad661529bda9b1029a929ef6751cfc7c96fb79013383f57ec7 +size 273252 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaVaatekaappi2EmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaVaatekaappi2EmYr.png new file mode 100644 index 0000000000..691a1f83b2 --- /dev/null +++ b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaVaatekaappi2EmYr.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f6fdfa859025fd4b484b09604f99e61ab5939a2c6ac4697b5a0311fce6b24fe +size 256598 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaVaatekaappiEmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaVaatekaappiEmYr.png new file mode 100644 index 0000000000..32385e93d8 --- /dev/null +++ b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaVaatekaappiEmYr.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5fde7f6702be010d79f11fcccc413f282b127862814a2fc98a375923b29f4fe3 +size 441678 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/JulisteIsoTaustaSekavuustilaEmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/JulisteIsoTaustaSekavuustilaEmYr.png new file mode 100644 index 0000000000..5be014874d --- /dev/null +++ b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/JulisteIsoTaustaSekavuustilaEmYr.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2fc405fad455fa0bd566c7c5fc66ae2b7e3fb071abcad5ad785df91272c3bba0 +size 23450 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/JulistePieniTaustaSekavuustilaEmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/JulistePieniTaustaSekavuustilaEmYr.png new file mode 100644 index 0000000000..60f7f5e4ee --- /dev/null +++ b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/JulistePieniTaustaSekavuustilaEmYr.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9e97ce46eebdb38b5245693051e0521a486653198f6a2b75f68ab35e2a78800 +size 16439 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/SpritesheetSekavuustilaHuonekalusettiEmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/SpritesheetSekavuustilaHuonekalusettiEmYr.png new file mode 100644 index 0000000000..7a826331db --- /dev/null +++ b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/SpritesheetSekavuustilaHuonekalusettiEmYr.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b6bfb9b9ee82fcca7fba7ba0d31f287edd02f8ff65417cf49c948fb345d87dd +size 4992429 From 1cee2bc5a5074b3ac0af8767ca5d4974961c3dda Mon Sep 17 00:00:00 2001 From: emry-beep Date: Wed, 6 May 2026 13:43:33 +0300 Subject: [PATCH 08/11] Revert "Huonekalusetti Sekavuustila on ladattu." This reverts commit 4efcf1bf717c094f41cb93d8016bdab0315854e7. --- .../FurnitureSekavuustilaIkkuna2EmYr.png | 3 --- .../FurnitureSekavuustilaIkkunaEmYr.png | 3 --- .../FurnitureSekavuustilaKeinutuoli2EmYr.png | 3 --- .../FurnitureSekavuustilaKeinutuoliEmYr.png | 3 --- .../FurnitureSekavuustilaKello2EmYr.png | 3 --- .../FurnitureSekavuustilaKelloEmYr.png | 3 --- .../FurnitureSekavuustilaMattoEmYr.png | 3 --- .../FurnitureSekavuustilaSohva2EmYr.png | 3 --- .../FurnitureSekavuustilaSohvaEmYr.png | 3 --- .../FurnitureSekavuustilaS\303\244nky2EmYr.png" | 3 --- .../FurnitureSekavuustilaS\303\244nkyEmYr.png" | 3 --- .../FurnitureSekavuustilaVaatekaappi2EmYr.png | 3 --- .../FurnitureSekavuustilaVaatekaappiEmYr.png | 3 --- .../JulisteIsoTaustaSekavuustilaEmYr.png | 3 --- .../JulistePieniTaustaSekavuustilaEmYr.png | 3 --- .../SpritesheetSekavuustilaHuonekalusettiEmYr.png | 3 --- 16 files changed, 48 deletions(-) delete mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaIkkuna2EmYr.png delete mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaIkkunaEmYr.png delete mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKeinutuoli2EmYr.png delete mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKeinutuoliEmYr.png delete mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKello2EmYr.png delete mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKelloEmYr.png delete mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaMattoEmYr.png delete mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaSohva2EmYr.png delete mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaSohvaEmYr.png delete mode 100644 "Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaS\303\244nky2EmYr.png" delete mode 100644 "Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaS\303\244nkyEmYr.png" delete mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaVaatekaappi2EmYr.png delete mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaVaatekaappiEmYr.png delete mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/JulisteIsoTaustaSekavuustilaEmYr.png delete mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/JulistePieniTaustaSekavuustilaEmYr.png delete mode 100644 Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/SpritesheetSekavuustilaHuonekalusettiEmYr.png diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaIkkuna2EmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaIkkuna2EmYr.png deleted file mode 100644 index 6cf50b598e..0000000000 --- a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaIkkuna2EmYr.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3b9ec8ad1c298dd0bbb814b90530c804ceaee366559365f0263802c27124853b -size 122242 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaIkkunaEmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaIkkunaEmYr.png deleted file mode 100644 index 6d046f58ae..0000000000 --- a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaIkkunaEmYr.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a1dfec1db91eb556ab7c67889d17a921b41c44bef557011ac71527078e729520 -size 135135 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKeinutuoli2EmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKeinutuoli2EmYr.png deleted file mode 100644 index 85c35c2059..0000000000 --- a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKeinutuoli2EmYr.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7b2556045b0ead141dd5d003424900fc4295727cf22c2f2a2261e21511394a36 -size 77780 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKeinutuoliEmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKeinutuoliEmYr.png deleted file mode 100644 index eb83850544..0000000000 --- a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKeinutuoliEmYr.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:91f69a573a17512d6c77af5a36dcfac75c0c1bf0d829393bb89872f87ee82803 -size 84893 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKello2EmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKello2EmYr.png deleted file mode 100644 index 3b3bda88eb..0000000000 --- a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKello2EmYr.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c9ae0347439468f18ad45230ac6a90d658f0fd59b94731420f6758f94e226e3c -size 41576 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKelloEmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKelloEmYr.png deleted file mode 100644 index 0e12f75415..0000000000 --- a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaKelloEmYr.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3d901864200a084cc60686d896bd770095d2dfa343cd44097a52c44a45b2de3a -size 39971 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaMattoEmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaMattoEmYr.png deleted file mode 100644 index b40bd3a6e0..0000000000 --- a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaMattoEmYr.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7f2c5fe05f97b9a15a5faa41761bdb4035c7621e5b487a81c5b5d2a2f68fcc8f -size 797191 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaSohva2EmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaSohva2EmYr.png deleted file mode 100644 index 20ac3391b5..0000000000 --- a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaSohva2EmYr.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8471038f137d4ca5603ac8662c11a39303957a7f187187aff5d5cc101a3f1add -size 336114 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaSohvaEmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaSohvaEmYr.png deleted file mode 100644 index e35540d6f9..0000000000 --- a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaSohvaEmYr.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b820ac4186f8a94fb67cf4423347e79bee1c91a8018b6386888d612daf6b0112 -size 233247 diff --git "a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaS\303\244nky2EmYr.png" "b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaS\303\244nky2EmYr.png" deleted file mode 100644 index 283a99b4f7..0000000000 --- "a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaS\303\244nky2EmYr.png" +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9c7d881c2b866a5f573680080ccd5ec4e0204ebcd66efb142d4338f9bec32656 -size 195866 diff --git "a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaS\303\244nkyEmYr.png" "b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaS\303\244nkyEmYr.png" deleted file mode 100644 index dd1b470e50..0000000000 --- "a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaS\303\244nkyEmYr.png" +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:314a61267b5becad661529bda9b1029a929ef6751cfc7c96fb79013383f57ec7 -size 273252 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaVaatekaappi2EmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaVaatekaappi2EmYr.png deleted file mode 100644 index 691a1f83b2..0000000000 --- a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaVaatekaappi2EmYr.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0f6fdfa859025fd4b484b09604f99e61ab5939a2c6ac4697b5a0311fce6b24fe -size 256598 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaVaatekaappiEmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaVaatekaappiEmYr.png deleted file mode 100644 index 32385e93d8..0000000000 --- a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/FurnitureSekavuustilaVaatekaappiEmYr.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5fde7f6702be010d79f11fcccc413f282b127862814a2fc98a375923b29f4fe3 -size 441678 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/JulisteIsoTaustaSekavuustilaEmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/JulisteIsoTaustaSekavuustilaEmYr.png deleted file mode 100644 index 5be014874d..0000000000 --- a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/JulisteIsoTaustaSekavuustilaEmYr.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2fc405fad455fa0bd566c7c5fc66ae2b7e3fb071abcad5ad785df91272c3bba0 -size 23450 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/JulistePieniTaustaSekavuustilaEmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/JulistePieniTaustaSekavuustilaEmYr.png deleted file mode 100644 index 60f7f5e4ee..0000000000 --- a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/JulistePieniTaustaSekavuustilaEmYr.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c9e97ce46eebdb38b5245693051e0521a486653198f6a2b75f68ab35e2a78800 -size 16439 diff --git a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/SpritesheetSekavuustilaHuonekalusettiEmYr.png b/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/SpritesheetSekavuustilaHuonekalusettiEmYr.png deleted file mode 100644 index 7a826331db..0000000000 --- a/Assets/Altzone/Graphics/SoulFurnitureGraphics/huonekalusetti_sekavuustiladelirium_emmayr/SpritesheetSekavuustilaHuonekalusettiEmYr.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3b6bfb9b9ee82fcca7fba7ba0d31f287edd02f8ff65417cf49c948fb345d87dd -size 4992429 From f4e51e8da8f095383fe31ca2a9f862ec525ef9b9 Mon Sep 17 00:00:00 2001 From: MariusLarilahti Date: Wed, 13 May 2026 11:25:56 +0300 Subject: [PATCH 09/11] Added rudimentary interaction and custom editor for interaction slots --- .../Scripts/SoulHome/FurnitureHandling.cs | 47 ++++++++--- .../FurnitureInteractionCustomEditor.cs | 77 +++++++++++++++++++ .../FurnitureInteractionCustomEditor.cs.meta | 11 +++ .../MenuUi/Scripts/SoulHome/FurnitureSlot.cs | 3 + .../SoulHome/SoulHomeAvatarController.cs | 4 +- .../Scripts/SoulHome/TowerController.cs | 59 +++++++++++++- 6 files changed, 186 insertions(+), 15 deletions(-) create mode 100644 Assets/MenuUi/Scripts/SoulHome/FurnitureInteractionCustomEditor.cs create mode 100644 Assets/MenuUi/Scripts/SoulHome/FurnitureInteractionCustomEditor.cs.meta diff --git a/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs b/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs index 9510629486..7367a5ae92 100644 --- a/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs +++ b/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs @@ -1,7 +1,9 @@ using System.Collections; using System.Collections.Generic; using Altzone.Scripts.Model.Poco.Game; +using UnityEditor.Graphs; using UnityEngine; +using UnityEngine.InputSystem.XR; using UnityEngine.Rendering; using Debug = Prg.Debug; @@ -46,6 +48,7 @@ public enum InteractionPattern [SerializeField] private SortingGroup _sortingGroup; + private Furniture _furniture; [SerializeField] private GameObject _trayFurnitureObject; @@ -65,9 +68,17 @@ public enum InteractionPattern [SerializeField] public InteractionPattern Pattern = InteractionPattern.FrontRow; public List AssignedInteractionSlots { get; private set; } = new List(); + [HideInInspector] + public List customInteractionOffsets = new List(); + public void ClearInteractionSlots() { - foreach (var slot in AssignedInteractionSlots) slot.IsReserved = false; + foreach (var slot in AssignedInteractionSlots) + { + slot.IsReserved = false; + slot.InteractionOwner = null; + slot.SetValidity(true, false); + } AssignedInteractionSlots.Clear(); } @@ -115,21 +126,35 @@ public Vector2Int GetRotatedInteractionOffset() }; } - //move the avatar on top of the furniture for now and then places them back in their original position - public void StartInteract(SoulHomeAvatarController controller, GameObject go) + public void StartInteract(SoulHomeAvatarController controller) { - GameObject go2 = controller.gameObject; - go.SetActive(false); - go2.SetActive(true); - Instantiate(go2, this.transform); + StartCoroutine(InteractRoutine(controller)); } - //Called at the end of the npc's movement timer - public void EndInteract(GameObject go) + private IEnumerator InteractRoutine(SoulHomeAvatarController controller) { - go.SetActive(false); - } + GameObject original = controller.gameObject; + original.SetActive(false); + GameObject dummy = Instantiate(original); + dummy.SetActive(true); + + dummy.transform.SetParent(this.transform, true); + dummy.transform.localPosition = Vector3.zero; + + Animator dummyAnim = dummy.GetComponentInChildren(); + //dummyAnim.Play(""); + + //yield return new WaitForEndOfFrame(); // Wait for animator to update + //float animLength = dummyAnim.GetCurrentAnimatorStateInfo(0).length; + //yield return new WaitForSeconds(animLength); + + //Temporary + yield return new WaitForSeconds(10); + + Destroy(dummy); + original.SetActive(true); + } public Furniture Furniture { get => _furniture; set => _furniture = value; } public Vector2 Position { get => _position; set => _position = value; } diff --git a/Assets/MenuUi/Scripts/SoulHome/FurnitureInteractionCustomEditor.cs b/Assets/MenuUi/Scripts/SoulHome/FurnitureInteractionCustomEditor.cs new file mode 100644 index 0000000000..c0c08094dc --- /dev/null +++ b/Assets/MenuUi/Scripts/SoulHome/FurnitureInteractionCustomEditor.cs @@ -0,0 +1,77 @@ +using System.Collections; +using System.Collections.Generic; +using MenuUI.Scripts.SoulHome; +using UnityEditor; +using UnityEngine; + +[CustomEditor(typeof(FurnitureHandling))] +public class FurnitureInteractionCustomEditor : Editor +{ + public override void OnInspectorGUI() + { + DrawDefaultInspector(); + + FurnitureHandling script = (FurnitureHandling)target; + + + GUILayout.Space(15); + EditorGUILayout.HelpBox("GREEN = Furniture Body (Size)\nYELLOW = Interaction Slots", MessageType.Info); + + GUILayout.Label("Custom Interaction Pattern", EditorStyles.boldLabel); + + Vector3Int size = script.GetFurnitureSize(); + + if (size.x <= 0 || size.y <= 0) + { + EditorGUILayout.HelpBox($"Size is 0.", MessageType.Warning); + return; + } + + int gridSize = 15; + int offset = gridSize / 2; + + Vector2Int centeringShift = new Vector2Int(size.x / 2, -(size.y / 2)); + + for (int y = -offset; y <= offset; y++) + { + EditorGUILayout.BeginHorizontal(); + GUILayout.FlexibleSpace(); + + for (int x = -offset; x <= offset; x++) + { + + Vector2Int pos = new Vector2Int(x + centeringShift.x, y + centeringShift.y); + + bool isInteraction = script.customInteractionOffsets.Contains(pos); + + bool isFurnitureBody = (pos.x >= 0 && pos.x < size.x && pos.y <= 0 && pos.y > -size.y); + + if (isFurnitureBody) GUI.backgroundColor = Color.green; + else if (isInteraction) GUI.backgroundColor = Color.yellow; + else GUI.backgroundColor = Color.white; + + string buttonText = isFurnitureBody ? "O" : (isInteraction ? "X" : ""); + + if (GUILayout.Button(buttonText, GUILayout.Width(30), GUILayout.Height(30))) + { + if (!isFurnitureBody) + { + if (isInteraction) script.customInteractionOffsets.Remove(pos); + else script.customInteractionOffsets.Add(pos); + + EditorUtility.SetDirty(script); + } + } + GUI.backgroundColor = Color.white; + } + GUILayout.FlexibleSpace(); + EditorGUILayout.EndHorizontal(); + } + + if (GUILayout.Button("Clear Pattern")) + { + script.customInteractionOffsets.Clear(); + EditorUtility.SetDirty(script); + } + } +} diff --git a/Assets/MenuUi/Scripts/SoulHome/FurnitureInteractionCustomEditor.cs.meta b/Assets/MenuUi/Scripts/SoulHome/FurnitureInteractionCustomEditor.cs.meta new file mode 100644 index 0000000000..e159e6bb34 --- /dev/null +++ b/Assets/MenuUi/Scripts/SoulHome/FurnitureInteractionCustomEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0425e049265e0f24291294d300431efc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MenuUi/Scripts/SoulHome/FurnitureSlot.cs b/Assets/MenuUi/Scripts/SoulHome/FurnitureSlot.cs index 410e682d55..6e85c77009 100644 --- a/Assets/MenuUi/Scripts/SoulHome/FurnitureSlot.cs +++ b/Assets/MenuUi/Scripts/SoulHome/FurnitureSlot.cs @@ -29,6 +29,9 @@ public class FurnitureSlot : MonoBehaviour public bool IsReserved { get; set; } + public FurnitureHandling InteractionOwner; + public FurnitureHandling SlotOwner; + public Furniture Furniture { get => furniture; set { diff --git a/Assets/MenuUi/Scripts/SoulHome/SoulHomeAvatarController.cs b/Assets/MenuUi/Scripts/SoulHome/SoulHomeAvatarController.cs index 8ebdbff977..f3ddef6712 100644 --- a/Assets/MenuUi/Scripts/SoulHome/SoulHomeAvatarController.cs +++ b/Assets/MenuUi/Scripts/SoulHome/SoulHomeAvatarController.cs @@ -698,6 +698,8 @@ private IEnumerator InteractAnimation() SelectStatus(); } + + private List ValidateAnimations(List animationToValidate) { List validatedAnimation = new(); @@ -775,7 +777,7 @@ private void OnArrival() { if (_targetFurniture != null) { - _targetFurniture.StartInteract(this, this.gameObject); + _targetFurniture.StartInteract(this); Debug.Log($"NPC arrived at: {_targetFurniture.gameObject.name}"); _targetFurniture = null; diff --git a/Assets/MenuUi/Scripts/SoulHome/TowerController.cs b/Assets/MenuUi/Scripts/SoulHome/TowerController.cs index 7bf5dbaa38..4ec9a02ec3 100644 --- a/Assets/MenuUi/Scripts/SoulHome/TowerController.cs +++ b/Assets/MenuUi/Scripts/SoulHome/TowerController.cs @@ -10,6 +10,7 @@ using Altzone.Scripts.Model.Poco.Game; using Altzone.Scripts.Audio; using static MenuUI.Scripts.SoulHome.FurnitureHandling; +using UnityEditor.Graphs; namespace MenuUI.Scripts.SoulHome { @@ -650,8 +651,9 @@ public void PlaceFurniture(Vector2 hitPoint, bool hover) check = hit2.collider.GetComponent().HandleFurniturePosition(hitArray, _selectedFurniture, hover, hitPoint, hitRoom); //Displayment of interact slots during placement - if (hover && _selectedFurniture != null) + if ((hover || check) && _selectedFurniture != null) { + FurnitureHandling handling = _selectedFurniture.GetComponent(); FurnitureSlot hoveredSlot = GetHoveredSlot(hitArray); @@ -659,9 +661,23 @@ public void PlaceFurniture(Vector2 hitPoint, bool hover) { if (handling.HasInteractionSlot) { - Vector2Int offset = handling.GetRotatedInteractionOffset(); + //Vector2Int offset = handling.GetRotatedInteractionOffset(); RoomData room = hit2.collider.GetComponent(); + bool isVertical = handling.TempSpriteDirection == Direction.Left || handling.TempSpriteDirection == Direction.Right; + bool facingLeftOrBack = handling.TempSpriteDirection == Direction.Left || handling.TempSpriteDirection == Direction.Back; + + foreach (Vector2Int customOffset in handling.customInteractionOffsets) + { + Vector2Int rotatedOffset = RotateOffset(customOffset, isVertical, facingLeftOrBack); + + int targetCol = hoveredSlot.column + rotatedOffset.x; + int targetRow = hoveredSlot.row + rotatedOffset.y; + + HighlightSlot(room, targetCol, targetRow); + } + + /* if (handling.Pattern == InteractionPattern.FrontRow) { bool isVertical = handling.TempSpriteDirection == Direction.Left || handling.TempSpriteDirection == Direction.Right; @@ -721,8 +737,11 @@ public void PlaceFurniture(Vector2 hitPoint, bool hover) HighlightSlot(room, hoveredSlot.column + w, hoveredSlot.row + i - size.y + 1); } } + */ } } + + } //Saving of interact slots after placement @@ -1152,6 +1171,7 @@ private void SaveSlot(RoomData room, int col, int row, FurnitureHandling handlin { FurnitureSlot slot = room.Grid[col, row].FurnitureSlot; handling.AddInteractionSlot(slot); + slot.InteractionOwner = handling; } } @@ -1161,9 +1181,42 @@ private void HighlightSlot(RoomData room, int col, int row) if (col >= 0 && col < room.SlotColumns && row >= 0 && row < room.SlotRows) { FurnitureSlot interactSlot = room.Grid[col, row].FurnitureSlot; - interactSlot.SetValidity(true, true); + FurnitureHandling current = _selectedFurniture.GetComponent(); + + bool overlapsFurniture = interactSlot.SlotOwner != null && interactSlot.SlotOwner != current; + bool overlapsInteract = interactSlot.InteractionOwner != null && interactSlot.InteractionOwner != current; + + bool isValid = !overlapsFurniture && !overlapsInteract; + + + if (isValid) + { + interactSlot.SetValidity(isValid, true); + } + else if(!isValid) + { + interactSlot.SetValidity(false, false); + } room.AddToValidityList(interactSlot); } } + + private Vector2Int RotateOffset(Vector2Int offset, bool isVertical, bool facingLeftOrBack) + { + + //Front (Default) + if (!isVertical && !facingLeftOrBack) return new Vector2Int(offset.x, offset.y); + + //Right + if (isVertical && !facingLeftOrBack) return new Vector2Int(offset.y, -offset.x); + + //Back + if (!isVertical && facingLeftOrBack) return new Vector2Int(-offset.x, -offset.y); + + //Left + if (isVertical && facingLeftOrBack) return new Vector2Int(-offset.y, offset.x); + + return offset; + } } } From 1efd5b2a8e3beb2ca84ad9eda7b5ab223166a55f Mon Sep 17 00:00:00 2001 From: MariusLarilahti Date: Mon, 18 May 2026 13:14:28 +0300 Subject: [PATCH 10/11] Updated custom editor functionality WORK IN PROGRESS --- .../Scripts/SoulHome/FurnitureHandling.cs | 29 ++-- .../FurnitureInteractionCustomEditor.cs | 119 ++++++++++--- .../Scripts/SoulHome/TowerController.cs | 156 +++++++++--------- 3 files changed, 188 insertions(+), 116 deletions(-) diff --git a/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs b/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs index 7367a5ae92..9b880d386a 100644 --- a/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs +++ b/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs @@ -71,13 +71,26 @@ public enum InteractionPattern [HideInInspector] public List customInteractionOffsets = new List(); + public Vector2Int GetRotatedInteractionOffset() + { + // Rotates the offset based on the current temp direction + return _tempSpriteDirection switch + { + Direction.Front => _interactionOffset, + Direction.Right => new Vector2Int(-_interactionOffset.y, _interactionOffset.x), + Direction.Back => new Vector2Int(-_interactionOffset.x, -_interactionOffset.y), + Direction.Left => new Vector2Int(_interactionOffset.y + GetFurnitureSize().x - 1, -_interactionOffset.x), + _ => _interactionOffset + }; + } + public void ClearInteractionSlots() { foreach (var slot in AssignedInteractionSlots) { slot.IsReserved = false; slot.InteractionOwner = null; - slot.SetValidity(true, false); + slot.ClearValidity(); } AssignedInteractionSlots.Clear(); } @@ -112,20 +125,6 @@ public FurnitureSlot GetClosestInteractionSlot(Vector3 npcPosition) return closest; } - - public Vector2Int GetRotatedInteractionOffset() - { - // Rotates the offset based on the current temp direction - return _tempSpriteDirection switch - { - Direction.Front => _interactionOffset, - Direction.Right => new Vector2Int(-_interactionOffset.y, _interactionOffset.x), - Direction.Back => new Vector2Int(-_interactionOffset.x, -_interactionOffset.y), - Direction.Left => new Vector2Int(_interactionOffset.y + GetFurnitureSize().x - 1, -_interactionOffset.x), - _ => _interactionOffset - }; - } - public void StartInteract(SoulHomeAvatarController controller) { StartCoroutine(InteractRoutine(controller)); diff --git a/Assets/MenuUi/Scripts/SoulHome/FurnitureInteractionCustomEditor.cs b/Assets/MenuUi/Scripts/SoulHome/FurnitureInteractionCustomEditor.cs index c0c08094dc..e2cd97b0ee 100644 --- a/Assets/MenuUi/Scripts/SoulHome/FurnitureInteractionCustomEditor.cs +++ b/Assets/MenuUi/Scripts/SoulHome/FurnitureInteractionCustomEditor.cs @@ -1,25 +1,50 @@ -using System.Collections; +using System.Collections; using System.Collections.Generic; using MenuUI.Scripts.SoulHome; using UnityEditor; using UnityEngine; +using static UnityEditorInternal.VersionControl.ListControl; [CustomEditor(typeof(FurnitureHandling))] public class FurnitureInteractionCustomEditor : Editor { + static int width; + static int height; + + private FurnitureHandling.Direction selectedDirection = FurnitureHandling.Direction.Front; + + private const int GridSize = 10; + private const int CenterOffset = 3; public override void OnInspectorGUI() { DrawDefaultInspector(); FurnitureHandling script = (FurnitureHandling)target; + width = EditorGUILayout.IntField("Furniture width", width); + height = EditorGUILayout.IntField("Furniture width", height); GUILayout.Space(15); EditorGUILayout.HelpBox("GREEN = Furniture Body (Size)\nYELLOW = Interaction Slots", MessageType.Info); GUILayout.Label("Custom Interaction Pattern", EditorStyles.boldLabel); - Vector3Int size = script.GetFurnitureSize(); + selectedDirection = (FurnitureHandling.Direction)EditorGUILayout.EnumPopup("Editing State:", selectedDirection); + + Vector3Int size = new Vector3Int(); + + bool isVertical = (selectedDirection == FurnitureHandling.Direction.Right || selectedDirection == FurnitureHandling.Direction.Left); + if (!isVertical) + { + size.x = width; + size.y = height; + } + else + { + size.y = width; + size.x = height; + } + if (size.x <= 0 || size.y <= 0) { @@ -32,40 +57,87 @@ public override void OnInspectorGUI() Vector2Int centeringShift = new Vector2Int(size.x / 2, -(size.y / 2)); - for (int y = -offset; y <= offset; y++) + + switch (selectedDirection) { - EditorGUILayout.BeginHorizontal(); - GUILayout.FlexibleSpace(); + case FurnitureHandling.Direction.Front: + + for (int y = -offset; y <= offset; y++) + { + EditorGUILayout.BeginHorizontal(); + GUILayout.FlexibleSpace(); + + for (int x = -offset; x <= offset; x++) + { + + Vector2Int pos = new Vector2Int(x + centeringShift.x, y + centeringShift.y); - for (int x = -offset; x <= offset; x++) - { + bool isInteraction = script.customInteractionOffsets.Contains(pos); - Vector2Int pos = new Vector2Int(x + centeringShift.x, y + centeringShift.y); + bool isFurnitureBody = (pos.x >= 0 && pos.x < size.x && pos.y <= 0 && pos.y > -size.y); - bool isInteraction = script.customInteractionOffsets.Contains(pos); + if (isFurnitureBody) GUI.backgroundColor = Color.green; + else if (isInteraction) GUI.backgroundColor = Color.yellow; + else GUI.backgroundColor = Color.white; - bool isFurnitureBody = (pos.x >= 0 && pos.x < size.x && pos.y <= 0 && pos.y > -size.y); + string buttonText = isFurnitureBody ? "O" : (isInteraction ? "X" : ""); - if (isFurnitureBody) GUI.backgroundColor = Color.green; - else if (isInteraction) GUI.backgroundColor = Color.yellow; - else GUI.backgroundColor = Color.white; + if (GUILayout.Button(buttonText, GUILayout.Width(30), GUILayout.Height(30))) + { + if (!isFurnitureBody) + { + if (isInteraction) script.customInteractionOffsets.Remove(pos); + else script.customInteractionOffsets.Add(pos); - string buttonText = isFurnitureBody ? "O" : (isInteraction ? "X" : ""); + EditorUtility.SetDirty(script); + } + } + GUI.backgroundColor = Color.white; + } + GUILayout.FlexibleSpace(); + EditorGUILayout.EndHorizontal(); + } + break; - if (GUILayout.Button(buttonText, GUILayout.Width(30), GUILayout.Height(30))) + //Doesnt change anything yet!!! + case FurnitureHandling.Direction.Left: + + for (int y = -offset; y <= offset; y++) { - if (!isFurnitureBody) + EditorGUILayout.BeginHorizontal(); + GUILayout.FlexibleSpace(); + + for (int x = -offset; x <= offset; x++) { - if (isInteraction) script.customInteractionOffsets.Remove(pos); - else script.customInteractionOffsets.Add(pos); - EditorUtility.SetDirty(script); + Vector2Int pos = new Vector2Int(x + centeringShift.x, y + centeringShift.y); + + bool isInteraction = script.customInteractionOffsets.Contains(pos); + + bool isFurnitureBody = (pos.x >= 0 && pos.x < size.x && pos.y <= 0 && pos.y > -size.y); + + if (isFurnitureBody) GUI.backgroundColor = Color.green; + else if (isInteraction) GUI.backgroundColor = Color.yellow; + else GUI.backgroundColor = Color.white; + + string buttonText = isFurnitureBody ? "O" : (isInteraction ? "X" : ""); + + if (GUILayout.Button(buttonText, GUILayout.Width(30), GUILayout.Height(30))) + { + if (!isFurnitureBody) + { + if (isInteraction) script.customInteractionOffsets.Remove(pos); + else script.customInteractionOffsets.Add(pos); + + EditorUtility.SetDirty(script); + } + } + GUI.backgroundColor = Color.white; } + GUILayout.FlexibleSpace(); + EditorGUILayout.EndHorizontal(); } - GUI.backgroundColor = Color.white; - } - GUILayout.FlexibleSpace(); - EditorGUILayout.EndHorizontal(); + break; } if (GUILayout.Button("Clear Pattern")) @@ -75,3 +147,4 @@ public override void OnInspectorGUI() } } } + diff --git a/Assets/MenuUi/Scripts/SoulHome/TowerController.cs b/Assets/MenuUi/Scripts/SoulHome/TowerController.cs index 4ec9a02ec3..ac0b28fdd1 100644 --- a/Assets/MenuUi/Scripts/SoulHome/TowerController.cs +++ b/Assets/MenuUi/Scripts/SoulHome/TowerController.cs @@ -661,7 +661,7 @@ public void PlaceFurniture(Vector2 hitPoint, bool hover) { if (handling.HasInteractionSlot) { - //Vector2Int offset = handling.GetRotatedInteractionOffset(); + //List offsets = handling.GetRotatedCustomInteractionOffsets(); RoomData room = hit2.collider.GetComponent(); bool isVertical = handling.TempSpriteDirection == Direction.Left || handling.TempSpriteDirection == Direction.Right; @@ -745,83 +745,83 @@ public void PlaceFurniture(Vector2 hitPoint, bool hover) } //Saving of interact slots after placement - if (!hover && check && _selectedFurniture != null) - { - FurnitureHandling handling = _selectedFurniture.GetComponent(); - - if (handling.HasInteractionSlot) - { - handling.ClearInteractionSlots(); - FurnitureSlot hoveredSlot = GetHoveredSlot(hitArray); - - if (hoveredSlot != null) - { - Vector2Int offset = handling.GetRotatedInteractionOffset(); - - RoomData room = hit2.collider.GetComponent(); - - if (handling.Pattern == InteractionPattern.FrontRow) - { - bool isVertical = handling.TempSpriteDirection == Direction.Left || handling.TempSpriteDirection == Direction.Right; - - int length; - if (isVertical) - { - length = (int)size.y; - } - else - { - length = (int)size.x; - } - - for (int i = 0; i < length; i++) - { - int targetCol; - int targetRow; - - if (isVertical) - { - targetCol = hoveredSlot.column + offset.x; - targetRow = hoveredSlot.row + offset.y - i; - } - else - { - targetCol = hoveredSlot.column + offset.x + i; - targetRow = hoveredSlot.row + offset.y; - } - SaveSlot(room, targetCol, targetRow, handling); - } - } - else if (handling.Pattern == InteractionPattern.Surround) - { - bool isVertical = handling.TempSpriteDirection == Direction.Left || handling.TempSpriteDirection == Direction.Right; - - //get dimensions on based on rotation - int w = isVertical ? (int)size.y : (int)size.x; - int h = isVertical ? (int)size.x : (int)size.y; - - //Horizontal lines - for (int i = 0; i < w; i++) - { - //Below the furniture - SaveSlot(room, hoveredSlot.column + i, hoveredSlot.row + 1, handling); - //Above the furniture - SaveSlot(room, hoveredSlot.column + i, hoveredSlot.row - size.y, handling); - } - - //Vertical lines - for (int i = 0; i < h; i++) - { - //To the left - SaveSlot(room, hoveredSlot.column - 1, hoveredSlot.row + i - size.y + 1, handling); - //to the right - SaveSlot(room, hoveredSlot.column + w, hoveredSlot.row + i - size.y + 1, handling); - } - } - - } - } - } + //if (!hover && check && _selectedFurniture != null) + //{ + // FurnitureHandling handling = _selectedFurniture.GetComponent(); + + // if (handling.HasInteractionSlot) + // { + // handling.ClearInteractionSlots(); + // FurnitureSlot hoveredSlot = GetHoveredSlot(hitArray); + + // if (hoveredSlot != null) + // { + // Vector2Int offset = handling.GetRotatedInteractionOffset(); + + // RoomData room = hit2.collider.GetComponent(); + + // if (handling.Pattern == InteractionPattern.FrontRow) + // { + // bool isVertical = handling.TempSpriteDirection == Direction.Left || handling.TempSpriteDirection == Direction.Right; + + // int length; + // if (isVertical) + // { + // length = (int)size.y; + // } + // else + // { + // length = (int)size.x; + // } + + // for (int i = 0; i < length; i++) + // { + // int targetCol; + // int targetRow; + + // if (isVertical) + // { + // targetCol = hoveredSlot.column + offset.x; + // targetRow = hoveredSlot.row + offset.y - i; + // } + // else + // { + // targetCol = hoveredSlot.column + offset.x + i; + // targetRow = hoveredSlot.row + offset.y; + // } + // SaveSlot(room, targetCol, targetRow, handling); + // } + // } + // else if (handling.Pattern == InteractionPattern.Surround) + // { + // bool isVertical = handling.TempSpriteDirection == Direction.Left || handling.TempSpriteDirection == Direction.Right; + + // //get dimensions on based on rotation + // int w = isVertical ? (int)size.y : (int)size.x; + // int h = isVertical ? (int)size.x : (int)size.y; + + // //Horizontal lines + // for (int i = 0; i < w; i++) + // { + // //Below the furniture + // SaveSlot(room, hoveredSlot.column + i, hoveredSlot.row + 1, handling); + // //Above the furniture + // SaveSlot(room, hoveredSlot.column + i, hoveredSlot.row - size.y, handling); + // } + + // //Vertical lines + // for (int i = 0; i < h; i++) + // { + // //To the left + // SaveSlot(room, hoveredSlot.column - 1, hoveredSlot.row + i - size.y + 1, handling); + // //to the right + // SaveSlot(room, hoveredSlot.column + w, hoveredSlot.row + i - size.y + 1, handling); + // } + // } + + // } + // } + //} } } if (hover) From c4d5067147d4adc74fbcc35625582c4a9a5fca83 Mon Sep 17 00:00:00 2001 From: MariusLarilahti Date: Fri, 29 May 2026 10:56:46 +0300 Subject: [PATCH 11/11] Fixed and Updated custom editor for interactionSlots --- .../Scripts/SoulHome/FurnitureHandling.cs | 24 +- .../FurnitureInteractionCustomEditor.cs | 149 ++++-------- .../Scripts/SoulHome/TowerController.cs | 214 ++++++------------ 3 files changed, 120 insertions(+), 267 deletions(-) diff --git a/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs b/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs index 9b880d386a..54a2bc56cd 100644 --- a/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs +++ b/Assets/MenuUi/Scripts/SoulHome/FurnitureHandling.cs @@ -65,24 +65,18 @@ public enum InteractionPattern private Vector2Int _interactionOffset = new Vector2Int(0, 1); public bool HasInteractionSlot => _hasInteractionSlot; - [SerializeField] public InteractionPattern Pattern = InteractionPattern.FrontRow; + //[SerializeField] public InteractionPattern Pattern = InteractionPattern.FrontRow; public List AssignedInteractionSlots { get; private set; } = new List(); [HideInInspector] public List customInteractionOffsets = new List(); - public Vector2Int GetRotatedInteractionOffset() - { - // Rotates the offset based on the current temp direction - return _tempSpriteDirection switch - { - Direction.Front => _interactionOffset, - Direction.Right => new Vector2Int(-_interactionOffset.y, _interactionOffset.x), - Direction.Back => new Vector2Int(-_interactionOffset.x, -_interactionOffset.y), - Direction.Left => new Vector2Int(_interactionOffset.y + GetFurnitureSize().x - 1, -_interactionOffset.x), - _ => _interactionOffset - }; - } + [Header("Dimensions (Edit Mode Configurations)")] + [SerializeField] private int _width = 1; + [SerializeField] private int _height = 1; + + public int Width => _width; + public int Height => _height; public void ClearInteractionSlots() { @@ -231,6 +225,10 @@ void Start() public Vector3Int GetFurnitureSize() { + if (Furniture == null) + { + return new Vector3Int(_width, _height, 0); + } if (Furniture.IsRotated) return Furniture.GetFurnitureSizeRotated(); return Furniture.GetFurnitureNormalSize(); } diff --git a/Assets/MenuUi/Scripts/SoulHome/FurnitureInteractionCustomEditor.cs b/Assets/MenuUi/Scripts/SoulHome/FurnitureInteractionCustomEditor.cs index e2cd97b0ee..14bd7a61f0 100644 --- a/Assets/MenuUi/Scripts/SoulHome/FurnitureInteractionCustomEditor.cs +++ b/Assets/MenuUi/Scripts/SoulHome/FurnitureInteractionCustomEditor.cs @@ -1,150 +1,83 @@ -using System.Collections; -using System.Collections.Generic; -using MenuUI.Scripts.SoulHome; +using MenuUI.Scripts.SoulHome; using UnityEditor; using UnityEngine; -using static UnityEditorInternal.VersionControl.ListControl; [CustomEditor(typeof(FurnitureHandling))] public class FurnitureInteractionCustomEditor : Editor { - static int width; - static int height; + private SerializedProperty widthProp; + private SerializedProperty heightProp; - private FurnitureHandling.Direction selectedDirection = FurnitureHandling.Direction.Front; - - private const int GridSize = 10; - private const int CenterOffset = 3; + private void OnEnable() + { + widthProp = serializedObject.FindProperty("_width"); + heightProp = serializedObject.FindProperty("_height"); + } public override void OnInspectorGUI() { DrawDefaultInspector(); + serializedObject.Update(); FurnitureHandling script = (FurnitureHandling)target; - width = EditorGUILayout.IntField("Furniture width", width); - height = EditorGUILayout.IntField("Furniture width", height); + if (widthProp.intValue < 1) widthProp.intValue = 1; + if (heightProp.intValue < 1) heightProp.intValue = 1; GUILayout.Space(15); EditorGUILayout.HelpBox("GREEN = Furniture Body (Size)\nYELLOW = Interaction Slots", MessageType.Info); + GUILayout.Label("Custom Interaction Pattern (Front View)", EditorStyles.boldLabel); - GUILayout.Label("Custom Interaction Pattern", EditorStyles.boldLabel); - - selectedDirection = (FurnitureHandling.Direction)EditorGUILayout.EnumPopup("Editing State:", selectedDirection); - - Vector3Int size = new Vector3Int(); + int width = widthProp.intValue; + int height = heightProp.intValue; - bool isVertical = (selectedDirection == FurnitureHandling.Direction.Right || selectedDirection == FurnitureHandling.Direction.Left); - if (!isVertical) + if (width <= 0 || height <= 0) { - size.x = width; - size.y = height; - } - else - { - size.y = width; - size.x = height; - } - - - if (size.x <= 0 || size.y <= 0) - { - EditorGUILayout.HelpBox($"Size is 0.", MessageType.Warning); + EditorGUILayout.HelpBox($"Size is 0 or negative.", MessageType.Warning); return; } - int gridSize = 15; - int offset = gridSize / 2; - - Vector2Int centeringShift = new Vector2Int(size.x / 2, -(size.y / 2)); - - - switch (selectedDirection) + for (int y = 1; y >= -height; y--) { - case FurnitureHandling.Direction.Front: - - for (int y = -offset; y <= offset; y++) - { - EditorGUILayout.BeginHorizontal(); - GUILayout.FlexibleSpace(); + EditorGUILayout.BeginHorizontal(); + GUILayout.FlexibleSpace(); - for (int x = -offset; x <= offset; x++) - { + for (int x = -1; x <= width; x++) + { + Vector2Int pos = new Vector2Int(x, y); - Vector2Int pos = new Vector2Int(x + centeringShift.x, y + centeringShift.y); + bool isInteraction = script.customInteractionOffsets.Contains(pos); + bool isFurnitureBody = (x >= 0 && x < width && y <= 0 && y > -height); - bool isInteraction = script.customInteractionOffsets.Contains(pos); + if (isFurnitureBody) GUI.backgroundColor = Color.green; + else if (isInteraction) GUI.backgroundColor = Color.yellow; + else GUI.backgroundColor = Color.white; - bool isFurnitureBody = (pos.x >= 0 && pos.x < size.x && pos.y <= 0 && pos.y > -size.y); + string buttonText = isFurnitureBody ? "F" : (isInteraction ? "I" : ""); - if (isFurnitureBody) GUI.backgroundColor = Color.green; - else if (isInteraction) GUI.backgroundColor = Color.yellow; - else GUI.backgroundColor = Color.white; - - string buttonText = isFurnitureBody ? "O" : (isInteraction ? "X" : ""); - - if (GUILayout.Button(buttonText, GUILayout.Width(30), GUILayout.Height(30))) - { - if (!isFurnitureBody) - { - if (isInteraction) script.customInteractionOffsets.Remove(pos); - else script.customInteractionOffsets.Add(pos); - - EditorUtility.SetDirty(script); - } - } - GUI.backgroundColor = Color.white; - } - GUILayout.FlexibleSpace(); - EditorGUILayout.EndHorizontal(); - } - break; - - //Doesnt change anything yet!!! - case FurnitureHandling.Direction.Left: - - for (int y = -offset; y <= offset; y++) + if (GUILayout.Button(buttonText, GUILayout.Width(30), GUILayout.Height(30))) { - EditorGUILayout.BeginHorizontal(); - GUILayout.FlexibleSpace(); - - for (int x = -offset; x <= offset; x++) + if (!isFurnitureBody) { + Undo.RecordObject(script, "Modify Custom Interaction Slot"); + if (isInteraction) script.customInteractionOffsets.Remove(pos); + else script.customInteractionOffsets.Add(pos); - Vector2Int pos = new Vector2Int(x + centeringShift.x, y + centeringShift.y); - - bool isInteraction = script.customInteractionOffsets.Contains(pos); - - bool isFurnitureBody = (pos.x >= 0 && pos.x < size.x && pos.y <= 0 && pos.y > -size.y); - - if (isFurnitureBody) GUI.backgroundColor = Color.green; - else if (isInteraction) GUI.backgroundColor = Color.yellow; - else GUI.backgroundColor = Color.white; - - string buttonText = isFurnitureBody ? "O" : (isInteraction ? "X" : ""); - - if (GUILayout.Button(buttonText, GUILayout.Width(30), GUILayout.Height(30))) - { - if (!isFurnitureBody) - { - if (isInteraction) script.customInteractionOffsets.Remove(pos); - else script.customInteractionOffsets.Add(pos); - - EditorUtility.SetDirty(script); - } - } - GUI.backgroundColor = Color.white; + EditorUtility.SetDirty(script); } - GUILayout.FlexibleSpace(); - EditorGUILayout.EndHorizontal(); } - break; + GUI.backgroundColor = Color.white; + } + GUILayout.FlexibleSpace(); + EditorGUILayout.EndHorizontal(); } if (GUILayout.Button("Clear Pattern")) { + Undo.RecordObject(script, "Clear Interaction Pattern"); script.customInteractionOffsets.Clear(); EditorUtility.SetDirty(script); } + + serializedObject.ApplyModifiedProperties(); } } - diff --git a/Assets/MenuUi/Scripts/SoulHome/TowerController.cs b/Assets/MenuUi/Scripts/SoulHome/TowerController.cs index ac0b28fdd1..c0b5ecd1f0 100644 --- a/Assets/MenuUi/Scripts/SoulHome/TowerController.cs +++ b/Assets/MenuUi/Scripts/SoulHome/TowerController.cs @@ -646,6 +646,7 @@ public void PlaceFurniture(Vector2 hitPoint, bool hover) int prevRoomId = (_selectedFurniture.transform.parent != null && _selectedFurniture.transform.parent.GetComponent() != null) ? _selectedFurniture.transform.parent.GetComponent().roomId : -1; foreach (RaycastHit2D hit2 in hitArray) { + if (hit2.collider.gameObject.CompareTag("Room")) { check = hit2.collider.GetComponent().HandleFurniturePosition(hitArray, _selectedFurniture, hover, hitPoint, hitRoom); @@ -653,176 +654,97 @@ public void PlaceFurniture(Vector2 hitPoint, bool hover) //Displayment of interact slots during placement if ((hover || check) && _selectedFurniture != null) { - FurnitureHandling handling = _selectedFurniture.GetComponent(); FurnitureSlot hoveredSlot = GetHoveredSlot(hitArray); - if (hoveredSlot != null) + if (hoveredSlot != null && handling.HasInteractionSlot) { - if (handling.HasInteractionSlot) - { - //List offsets = handling.GetRotatedCustomInteractionOffsets(); - RoomData room = hit2.collider.GetComponent(); + RoomData room = hit2.collider.GetComponent(); - bool isVertical = handling.TempSpriteDirection == Direction.Left || handling.TempSpriteDirection == Direction.Right; - bool facingLeftOrBack = handling.TempSpriteDirection == Direction.Left || handling.TempSpriteDirection == Direction.Back; + int W = handling.Furniture.GetFurnitureNormalSize().x; + int H = handling.Furniture.GetFurnitureNormalSize().y; - foreach (Vector2Int customOffset in handling.customInteractionOffsets) + foreach (Vector2Int offset in handling.customInteractionOffsets) + { + Vector2Int rotatedOffset = offset; + switch (handling.TempSpriteDirection) { - Vector2Int rotatedOffset = RotateOffset(customOffset, isVertical, facingLeftOrBack); + case Direction.Front: + rotatedOffset = offset; + rotatedOffset.x = offset.x; + rotatedOffset.y = -offset.y - H + 1; + break; + + case Direction.Right: + rotatedOffset = new Vector2Int(offset.y + H - 1, -offset.x); + break; + + case Direction.Left: + rotatedOffset = new Vector2Int(-offset.y, offset.x - (W - 1)); + break; + } - int targetCol = hoveredSlot.column + rotatedOffset.x; - int targetRow = hoveredSlot.row + rotatedOffset.y; + int targetCol = hoveredSlot.column + rotatedOffset.x; + int targetRow = hoveredSlot.row + rotatedOffset.y; - HighlightSlot(room, targetCol, targetRow); - } + HighlightSlot(room, targetCol, targetRow); + } + } + } - /* - if (handling.Pattern == InteractionPattern.FrontRow) - { - bool isVertical = handling.TempSpriteDirection == Direction.Left || handling.TempSpriteDirection == Direction.Right; + //Save interaction slots on placement + if (!hover && check && _selectedFurniture != null) + { + FurnitureHandling handling = _selectedFurniture.GetComponent(); - int length; - if (isVertical) - { - length = (int)size.y; - } - else - { - length = (int)size.x; - } + if (handling.HasInteractionSlot) + { + handling.ClearInteractionSlots(); + FurnitureSlot hoveredSlot = GetHoveredSlot(hitArray); - for (int i = 0; i < length; i++) - { - int targetCol; - int targetRow; + if (hoveredSlot != null) + { + RoomData room = hit2.collider.GetComponent(); - if (isVertical) - { - targetCol = hoveredSlot.column + offset.x; - targetRow = hoveredSlot.row + offset.y - i; - } - else - { - targetCol = hoveredSlot.column + offset.x + i; - targetRow = hoveredSlot.row + offset.y; - } - HighlightSlot(room, targetCol, targetRow); - } + int W = handling.Furniture.GetFurnitureNormalSize().x; + int H = handling.Furniture.GetFurnitureNormalSize().y; - } - else if (handling.Pattern == InteractionPattern.Surround) + foreach (Vector2Int offset in handling.customInteractionOffsets) { - bool isVertical = handling.TempSpriteDirection == Direction.Left || handling.TempSpriteDirection == Direction.Right; + Vector2Int rotatedOffset = offset; - //get dimensions on based on rotation - int w = isVertical ? (int)size.y : (int)size.x; - int h = isVertical ? (int)size.x : (int)size.y; - - //Horizontal lines - for (int i = 0; i < w; i++) + switch (handling.TempSpriteDirection) { - //Below the furniture - HighlightSlot(room, hoveredSlot.column + i, hoveredSlot.row + 1); - //Above the furniture - HighlightSlot(room, hoveredSlot.column + i, hoveredSlot.row - size.y); + case Direction.Front: + rotatedOffset = offset; + rotatedOffset.x = offset.x; + rotatedOffset.y = -offset.y - H + 1; + break; + + case Direction.Right: + rotatedOffset = new Vector2Int(offset.y + H - 1, -offset.x); + break; + + case Direction.Back: + rotatedOffset = new Vector2Int(-offset.x + W - 1, -offset.y - (H - 1)); + break; + + case Direction.Left: + rotatedOffset = new Vector2Int(-offset.y, offset.x - (W - 1)); + break; } - //Vertical lines - for (int i = 0; i < h; i++) - { - //To the left - HighlightSlot(room, hoveredSlot.column - 1, hoveredSlot.row + i - size.y + 1); - //to the right - HighlightSlot(room, hoveredSlot.column + w, hoveredSlot.row + i - size.y + 1); - } + int targetCol = hoveredSlot.column + rotatedOffset.x; + int targetRow = hoveredSlot.row + rotatedOffset.y; + + HighlightSlot(room, targetCol, targetRow); + SaveSlot(room, targetCol, targetRow, handling); } - */ } } - - } - - //Saving of interact slots after placement - //if (!hover && check && _selectedFurniture != null) - //{ - // FurnitureHandling handling = _selectedFurniture.GetComponent(); - - // if (handling.HasInteractionSlot) - // { - // handling.ClearInteractionSlots(); - // FurnitureSlot hoveredSlot = GetHoveredSlot(hitArray); - - // if (hoveredSlot != null) - // { - // Vector2Int offset = handling.GetRotatedInteractionOffset(); - - // RoomData room = hit2.collider.GetComponent(); - - // if (handling.Pattern == InteractionPattern.FrontRow) - // { - // bool isVertical = handling.TempSpriteDirection == Direction.Left || handling.TempSpriteDirection == Direction.Right; - - // int length; - // if (isVertical) - // { - // length = (int)size.y; - // } - // else - // { - // length = (int)size.x; - // } - - // for (int i = 0; i < length; i++) - // { - // int targetCol; - // int targetRow; - - // if (isVertical) - // { - // targetCol = hoveredSlot.column + offset.x; - // targetRow = hoveredSlot.row + offset.y - i; - // } - // else - // { - // targetCol = hoveredSlot.column + offset.x + i; - // targetRow = hoveredSlot.row + offset.y; - // } - // SaveSlot(room, targetCol, targetRow, handling); - // } - // } - // else if (handling.Pattern == InteractionPattern.Surround) - // { - // bool isVertical = handling.TempSpriteDirection == Direction.Left || handling.TempSpriteDirection == Direction.Right; - - // //get dimensions on based on rotation - // int w = isVertical ? (int)size.y : (int)size.x; - // int h = isVertical ? (int)size.x : (int)size.y; - - // //Horizontal lines - // for (int i = 0; i < w; i++) - // { - // //Below the furniture - // SaveSlot(room, hoveredSlot.column + i, hoveredSlot.row + 1, handling); - // //Above the furniture - // SaveSlot(room, hoveredSlot.column + i, hoveredSlot.row - size.y, handling); - // } - - // //Vertical lines - // for (int i = 0; i < h; i++) - // { - // //To the left - // SaveSlot(room, hoveredSlot.column - 1, hoveredSlot.row + i - size.y + 1, handling); - // //to the right - // SaveSlot(room, hoveredSlot.column + w, hoveredSlot.row + i - size.y + 1, handling); - // } - // } - - // } - // } - //} } + } if (hover) {