45 lines
981 B
C#
45 lines
981 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class BackgroundBlock : BlockBase
|
|
{
|
|
public bool InRage { get; private set; }
|
|
public bool IsMovable { get; private set; }
|
|
|
|
public void SetData(int x, int y)
|
|
{
|
|
CurrentX = x;
|
|
CurrentY = y;
|
|
InRage = false;
|
|
IsMovable = false;
|
|
}
|
|
public void SetColor(E_TEAM team)
|
|
{
|
|
IsMovable = true;
|
|
InRage = true;
|
|
_backgroundImg.color = Constants.TEAM_BLOCK_COLOR[team];
|
|
}
|
|
|
|
public void ResetColor()
|
|
{
|
|
InRage = false;
|
|
IsMovable = false;
|
|
_backgroundImg.color = Color.white;
|
|
}
|
|
public void OnSelected()
|
|
{
|
|
if(IsMovable)
|
|
{
|
|
GameManager.Instance.CharacterMove(this);
|
|
}
|
|
//선택상태일 때 이동할 데이터
|
|
}
|
|
|
|
public void UpdatePosition(Vector3 pos)
|
|
{
|
|
GetComponent<RectTransform>().anchoredPosition = pos;
|
|
}
|
|
}
|