3 Commits

2 changed files with 27 additions and 5 deletions

View File

@ -49,6 +49,7 @@ jobs:
with:
name: build-windows
path: build/
owerwrite: true
build-macos:
runs-on: "ubuntu-latest"
@ -81,6 +82,7 @@ jobs:
with:
name: build-macos
path: build/
owerwrite: true
build-linux:
runs-on: "ubuntu-latest"
@ -113,6 +115,7 @@ jobs:
with:
name: build-linux
path: build/
owerwrite: true
create-release:
needs: [build-windows, build-macos, build-linux]

View File

@ -99,8 +99,8 @@ public class LevelEditor : MonoBehaviour
float xOff = -325f + idx * 125f;
var bgRt = bg.GetComponent<RectTransform>();
var icRt = icon.GetComponent<RectTransform>();
bgRt.anchoredPosition = new Vector2(xOff, bgRt.anchoredPosition.y - 110);
icRt.anchoredPosition = new Vector2(xOff, icRt.anchoredPosition.y - 110);
bgRt.anchoredPosition = new Vector2(xOff, bgRt.anchoredPosition.y - 70);
icRt.anchoredPosition = new Vector2(xOff, icRt.anchoredPosition.y - 70);
bg.GetComponent<Image>().sprite = Resources.Load<Sprite>("InGame/ButtonSkin/BlankSquare");
icon.GetComponent<Image>().sprite = prefab.GetComponent<SpriteRenderer>()?.sprite;
icRt.sizeDelta = prefab.name.ToLower().Contains("small")
@ -211,14 +211,14 @@ public class LevelEditor : MonoBehaviour
{
if (IsBlockedBySameTypeInSnapDirection())
{
Debug.LogError("Impossible de poser un spike sur un autre spike !");
Debug.LogError("Impossible de poser un spike sur un autre spike !");
Destroy(currentBlock);
}
else
{
if (!SnapSpikeByRotation())
{
Debug.LogError("Impossible de poser un spike dans le vide !");
Debug.LogError("Impossible de poser un spike dans le vide !");
Destroy(currentBlock);
}
else
@ -230,6 +230,25 @@ public class LevelEditor : MonoBehaviour
else
{
TrySnapToNearbyBlock();
// 🔧 Réduction du collider du ObstacleKiller si cest un ObstacleBlock
if (name.Contains("obstacleblock"))
{
foreach (Transform child in currentBlock.transform)
{
if (child.name.ToLower().Contains("obstaclekiller"))
{
var col = child.GetComponent<BoxCollider2D>();
if (col != null)
{
Vector2 originalSize = col.size;
col.size = new Vector2(originalSize.x, 1f);
col.offset = new Vector2(col.offset.x, -0.5f);
Debug.Log($"✂️ Collider réduit pour {child.name} → {col.size}");
}
}
}
}
}
isPlacingBlock = false;
@ -444,7 +463,7 @@ public class LevelEditor : MonoBehaviour
var col = currentBlock.GetComponent<Collider2D>();
var b = col.bounds;
float snapDistance = 1f;
float snapDistance = 2f;
float verticalEps = 0.1f;
// === SNAP HORIZONTAL (droite)