diff --git a/Assets/Resources/1/Warrior/Tracking_Bomb/Textures/Bomb Emission.psd b/Assets/Resources/1/Warrior/Tracking_Bomb/Textures/Bomb Emission.psd index acdaab75..67bc36df 100644 Binary files a/Assets/Resources/1/Warrior/Tracking_Bomb/Textures/Bomb Emission.psd and b/Assets/Resources/1/Warrior/Tracking_Bomb/Textures/Bomb Emission.psd differ diff --git a/Assets/Resources/1/Warrior/Tracking_Bomb/Textures/Bomb.psd b/Assets/Resources/1/Warrior/Tracking_Bomb/Textures/Bomb.psd index f7c04c79..bbe6d02d 100644 Binary files a/Assets/Resources/1/Warrior/Tracking_Bomb/Textures/Bomb.psd and b/Assets/Resources/1/Warrior/Tracking_Bomb/Textures/Bomb.psd differ diff --git a/Assets/Resources/1/Warrior/Tracking_Bomb/Textures/FX Spark Glow.psd b/Assets/Resources/1/Warrior/Tracking_Bomb/Textures/FX Spark Glow.psd index 7c9d9702..95e6dacb 100644 Binary files a/Assets/Resources/1/Warrior/Tracking_Bomb/Textures/FX Spark Glow.psd and b/Assets/Resources/1/Warrior/Tracking_Bomb/Textures/FX Spark Glow.psd differ diff --git a/Assets/Resources/1/Warrior/Tracking_Bomb/Textures/FX Spark.psd b/Assets/Resources/1/Warrior/Tracking_Bomb/Textures/FX Spark.psd index cb789703..964dbf81 100644 Binary files a/Assets/Resources/1/Warrior/Tracking_Bomb/Textures/FX Spark.psd and b/Assets/Resources/1/Warrior/Tracking_Bomb/Textures/FX Spark.psd differ diff --git a/Assets/Scenes/Level 1.unity b/Assets/Scenes/Level 1.unity index 505a911c..bf147687 100644 --- a/Assets/Scenes/Level 1.unity +++ b/Assets/Scenes/Level 1.unity @@ -233,7 +233,6 @@ GameObject: m_Component: - component: {fileID: 963194228} - component: {fileID: 963194227} - - component: {fileID: 963194229} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera @@ -298,23 +297,6 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 60, y: 0, z: 0} ---- !u!114 &963194229 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 963194225} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8b9a305e18de0c04dbd257a21cd47087, type: 3} - m_Name: - m_EditorClassIdentifier: - sharedProfile: {fileID: 11400000, guid: 2de9544b84ed15540888b484d269757d, type: 2} - isGlobal: 1 - blendDistance: 0 - weight: 1 - priority: 0 --- !u!1 &1475618468 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/HexFiled/PaintedController.cs b/Assets/Scripts/HexFiled/PaintedController.cs index c8bb829f..3988ea02 100644 --- a/Assets/Scripts/HexFiled/PaintedController.cs +++ b/Assets/Scripts/HexFiled/PaintedController.cs @@ -46,26 +46,24 @@ namespace HexFiled var closeDirection = direction.MinusSixtyDeg(); - var path = Round( - UnitCurrentCell[cell.Color].previos.GetNeighbor(closeDirection), - UnitCurrentCell[cell.Color].previos.GetNeighbor(openDirection) - ); + if (TryPaintHexList(Round( + UnitCurrentCell[cell.Color].previos.GetNeighbor(closeDirection), + UnitCurrentCell[cell.Color].previos.GetNeighbor(openDirection)), + cell.Color)) + { + TryPaintHexList(Round( + UnitCurrentCell[cell.Color].previos.GetNeighbor(openDirection), + UnitCurrentCell[cell.Color].previos.GetNeighbor(closeDirection)), + cell.Color); + } - if (!path.hasPath) + cell.GetListNeighbours().ForEach(x => { - path.field.ForEach(x => x.PaintHex(cell.Color)); - } - else - { - path = Round( - UnitCurrentCell[cell.Color].previos.GetNeighbor(openDirection), - UnitCurrentCell[cell.Color].previos.GetNeighbor(closeDirection) - ); - if (!path.hasPath) + if (x.Color == UnitColor.GREY) { - path.field.ForEach(x => x.PaintHex(cell.Color)); + TryPaintHexList(Round(x, null), cell.Color); } - } + }); } if (item.Value.Count > 0 && item.Key != UnitColor.GREY && item.Key != cell.Color) @@ -84,6 +82,16 @@ namespace HexFiled } + private bool TryPaintHexList((bool hasPath, List field) path, UnitColor color) + { + if (!path.hasPath) + { + path.field.ForEach(y => y.PaintHex(color)); + } + + return path.hasPath; + } + private Dictionary> DifferentHexByColor(List cellsList) { Dictionary> resultDict = new Dictionary>(); @@ -103,7 +111,7 @@ namespace HexFiled private (bool hasPath, List field) Round(HexCell start, HexCell end) { - if (start.Color == _cell.Color || end.Color == _cell.Color) + if (start == null || start.Color == _cell.Color) { return (true, null); } @@ -118,7 +126,7 @@ namespace HexFiled while (stackIterators.Count >= 0) { - if (currentCell == end) + if (end != null && currentCell == end) return (true, closedList); List openList = new List();