16 lines
481 B
C#
16 lines
481 B
C#
using Enums;
|
|
using Services;
|
|
using UnityEngine;
|
|
|
|
namespace Views {
|
|
public class GemView : MonoBehaviour {
|
|
private Gem gem;
|
|
public Gem Gem => this.gem;
|
|
|
|
public void UpdatePosition(Vector2Int positionBasedOnIndex) {
|
|
if (Vector2.Distance(this.transform.position, positionBasedOnIndex) > 0.01f) {
|
|
this.transform.position = Vector2.Lerp(this.transform.position, positionBasedOnIndex, 0.1f);
|
|
}
|
|
}
|
|
}
|
|
} |