示例#1
0
 public void SquareInteracted(MapSquare square)
 {
     target.interactable = MapSquare.Interactable.Passive;
     GameMaster.Instance.MapSquareInteracted(square);
 }
示例#2
0
        public virtual bool CanMove(Tools.Direction direction)
        {
            MapSquare targetSquare = mapSquare.GetNeighbour(direction);

            return(targetSquare != null && targetSquare.CanEnterSquare(this, direction));
        }
示例#3
0
 public virtual void Input(MapSquare squareInput)
 {
 }
示例#4
0
 public override void Input(MapSquare squareInput)
 {
     unit.Turn(unit.mapSquare.GetNeighbourDirection(squareInput));
 }
示例#5
0
        public KeyValuePair <Tools.Direction, MapSquare> CheckNeighbourState(MapSquare origin, MapSquare other)
        {
            // If squares are not neighbours or they are the same one, return a none value.
            float distance = Vector3.Distance(origin.transform.position, other.transform.position);

            if (distance > 1.7f || distance < 0.9f)
            {
                return(new KeyValuePair <Tools.Direction, MapSquare>(Tools.Direction.None, other));
            }

            Tools.Direction dir = Tools.GetDirection(origin, other);
            return(new KeyValuePair <Tools.Direction, MapSquare>(dir, other));
        }