Beispiel #1
0
 public void RemoveColoredArea(ColoredArea coloredArea)
 {
     if (listColoredAreas.Exists(p => p == coloredArea))
     {
         listColoredAreas.Remove(coloredArea);
     }
 }
Beispiel #2
0
 public void SetColoredArea(ColoredArea coloredArea)
 {
     if (!listColoredAreas.Exists(p => p == coloredArea))
     {
         listColoredAreas.Add(coloredArea);
     }
 }
Beispiel #3
0
 public void ShowMovment()
 {
     if (movmentIsActive)
     {
         return;
     }
     colored = new ColoredArea(transform.position, MovmentRange, MovmentColor, TypeShape.Diamond);
     gameManagment.SetColoredArea(colored);
     movmentIsActive = true;
 }
Beispiel #4
0
    void ColorCellArea(ColoredArea coloredArea, Vector3Int cell, Tilemap tileMap)
    {
        if (coloredArea != null)
        {
            var initCell = tileMap.WorldToCell(coloredArea.InitialPosition);

            if (IsInRange(coloredArea.Range, initCell, cell, coloredArea.Shape))
            {
                tileMap.SetColor(cell, coloredArea.ColorArea);
            }
        }
    }