File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed
samples/Unity.Match3/Assets/Scripts/FillStrategies
Match3.UnityPackage/Assets/Plugins/Match3/Runtime/Match3.App Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ public override IEnumerable<IJob> GetSolveJobs(IGameBoard<IUnityGridSlot> gameBo
35
35
ReturnItemToPool ( currentItem ) ;
36
36
}
37
37
38
- foreach ( var specialItemGridSlot in solvedData . GetSpecialItemGridSlots ( ) )
38
+ foreach ( var specialItemGridSlot in solvedData . GetSpecialItemGridSlots ( true ) )
39
39
{
40
40
var item = GetItemFromPool ( ) ;
41
41
item . SetWorldPosition ( GetWorldPosition ( specialItemGridSlot . GridPosition ) ) ;
Original file line number Diff line number Diff line change @@ -26,10 +26,15 @@ public IEnumerable<TGridSlot> GetSolvedGridSlots()
26
26
}
27
27
}
28
28
29
- public IEnumerable < TGridSlot > GetSpecialItemGridSlots ( )
29
+ public IEnumerable < TGridSlot > GetSpecialItemGridSlots ( bool excludeOccupied = false )
30
30
{
31
31
foreach ( var specialItemGridSlot in SpecialItemGridSlots )
32
32
{
33
+ if ( excludeOccupied && specialItemGridSlot . HasItem )
34
+ {
35
+ continue ;
36
+ }
37
+
33
38
yield return specialItemGridSlot ;
34
39
}
35
40
}
Original file line number Diff line number Diff line change @@ -26,10 +26,15 @@ public IEnumerable<TGridSlot> GetSolvedGridSlots()
26
26
}
27
27
}
28
28
29
- public IEnumerable < TGridSlot > GetSpecialItemGridSlots ( )
29
+ public IEnumerable < TGridSlot > GetSpecialItemGridSlots ( bool excludeOccupied = false )
30
30
{
31
31
foreach ( var specialItemGridSlot in SpecialItemGridSlots )
32
32
{
33
+ if ( excludeOccupied && specialItemGridSlot . HasItem )
34
+ {
35
+ continue ;
36
+ }
37
+
33
38
yield return specialItemGridSlot ;
34
39
}
35
40
}
You can’t perform that action at this time.
0 commit comments