Create All Needed Scripts
This commit is contained in:
16
Assets/Scripts/Views/GemView.cs
Normal file
16
Assets/Scripts/Views/GemView.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user