BasicFantasy/Assets/Scripts/Block/BackgroundBlock.cs

45 lines
981 B
C#
Raw Permalink Normal View History

2023-09-28 18:21:45 +09:00
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);
}
//<2F><><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD> <20><> <20>̵<EFBFBD><CCB5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}
public void UpdatePosition(Vector3 pos)
{
GetComponent<RectTransform>().anchoredPosition = pos;
}
}