[Fix] Refactoring (Remove GameView) TEMP
This commit is contained in:
@@ -10,10 +10,6 @@ namespace Minesweeper.Presentation.Views
|
||||
{
|
||||
public sealed class CellView : MonoBehaviour, IPointerClickHandler, IPointerDownHandler, IPointerUpHandler
|
||||
{
|
||||
private const string ContentImagePath = "Content/Image";
|
||||
private const string ContentLabelPath = "Content/Text (TMP)";
|
||||
private const string ContentPath = "Content";
|
||||
|
||||
[SerializeField] private Button button;
|
||||
[SerializeField] private Image backgroundImage;
|
||||
[SerializeField] private RectTransform contentRoot;
|
||||
@@ -39,46 +35,6 @@ namespace Minesweeper.Presentation.Views
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public void AutoBind()
|
||||
{
|
||||
if (button == null)
|
||||
{
|
||||
button = GetComponent<Button>();
|
||||
}
|
||||
|
||||
if (backgroundImage == null)
|
||||
{
|
||||
backgroundImage = GetComponent<Image>();
|
||||
}
|
||||
|
||||
if (contentRoot == null)
|
||||
{
|
||||
var contentTransform = transform.Find(ContentPath);
|
||||
if (contentTransform != null)
|
||||
{
|
||||
contentRoot = contentTransform.GetComponent<RectTransform>();
|
||||
}
|
||||
}
|
||||
|
||||
if (contentImage == null)
|
||||
{
|
||||
var contentImageTransform = transform.Find(ContentImagePath);
|
||||
if (contentImageTransform != null)
|
||||
{
|
||||
contentImage = contentImageTransform.GetComponent<Image>();
|
||||
}
|
||||
}
|
||||
|
||||
if (label == null)
|
||||
{
|
||||
var labelTransform = transform.Find(ContentLabelPath);
|
||||
if (labelTransform != null)
|
||||
{
|
||||
label = labelTransform.GetComponent<TMP_Text>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Initialize(int x, int y)
|
||||
{
|
||||
this.x = x;
|
||||
|
||||
Reference in New Issue
Block a user