[Interactions] Correctly display items now
This commit is contained in:
32
Assets/Scripts/Utils/AppleHillsUtils.cs
Normal file
32
Assets/Scripts/Utils/AppleHillsUtils.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Utils
|
||||
{
|
||||
/// <summary>
|
||||
/// Utility methods for working with SpriteRenderers.
|
||||
/// </summary>
|
||||
public static class AppleHillsUtils
|
||||
{
|
||||
/// <summary>
|
||||
/// Copies all relevant visual properties from one SpriteRenderer to another.
|
||||
/// </summary>
|
||||
/// <param name="from">The source SpriteRenderer.</param>
|
||||
/// <param name="to">The target SpriteRenderer.</param>
|
||||
public static void CopySpriteRendererProperties(SpriteRenderer from, SpriteRenderer to)
|
||||
{
|
||||
if (from == null || to == null) return;
|
||||
to.sprite = from.sprite;
|
||||
to.color = from.color;
|
||||
to.flipX = from.flipX;
|
||||
to.flipY = from.flipY;
|
||||
to.material = from.material;
|
||||
to.drawMode = from.drawMode;
|
||||
to.size = from.size;
|
||||
to.maskInteraction = from.maskInteraction;
|
||||
to.sortingLayerID = from.sortingLayerID;
|
||||
to.sortingOrder = from.sortingOrder;
|
||||
to.enabled = true;
|
||||
to.transform.localScale = from.transform.localScale;
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Utils/AppleHillsUtils.cs.meta
Normal file
3
Assets/Scripts/Utils/AppleHillsUtils.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1bf54e2eb908492588a62995b99bd74a
|
||||
timeCreated: 1757337202
|
||||
Reference in New Issue
Block a user