You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.1 KiB
42 lines
1.1 KiB
using System.Runtime.CompilerServices;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class Cell : MonoBehaviour
|
|
{
|
|
public GameObject mask = null; //选中角色时在单元格上显示攻击范围
|
|
public int cost = 1; //走在单元格上消耗的行动点数
|
|
public int damage = 0; //单元格对站在上面的角色造成的伤害
|
|
bool occupied = false; //是否有角色占着单元格
|
|
public Character currentCharacter; //当前单元格上的角色
|
|
private void OnMouseDown()
|
|
{
|
|
//Debug.Log("This is a " + this.tag + "\nposition: " + transform.position.x + "," + transform.position.y);
|
|
}
|
|
|
|
public void SetOccupied(bool value)
|
|
{
|
|
occupied = value;
|
|
}
|
|
|
|
public bool GetOccupied()
|
|
{
|
|
return occupied;
|
|
}
|
|
|
|
public void SetMask(bool value)
|
|
{
|
|
mask.SetActive(value);
|
|
}
|
|
public void SetCurrentCharacter(Character character)
|
|
{
|
|
currentCharacter = character;
|
|
}
|
|
public Character GetCurrentCharacter()
|
|
{
|
|
return currentCharacter;
|
|
}
|
|
}
|