mirror of
https://github.com/boudji-ludwig-pett/cnam-geometry-dash.git
synced 2025-06-10 22:20:40 +02:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
470cff34e1 | |||
068c38a411 | |||
a96463f186
|
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
@ -49,6 +49,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: build-windows
|
name: build-windows
|
||||||
path: build/
|
path: build/
|
||||||
|
owerwrite: true
|
||||||
|
|
||||||
build-macos:
|
build-macos:
|
||||||
runs-on: "ubuntu-latest"
|
runs-on: "ubuntu-latest"
|
||||||
@ -81,6 +82,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: build-macos
|
name: build-macos
|
||||||
path: build/
|
path: build/
|
||||||
|
owerwrite: true
|
||||||
|
|
||||||
build-linux:
|
build-linux:
|
||||||
runs-on: "ubuntu-latest"
|
runs-on: "ubuntu-latest"
|
||||||
@ -113,6 +115,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: build-linux
|
name: build-linux
|
||||||
path: build/
|
path: build/
|
||||||
|
owerwrite: true
|
||||||
|
|
||||||
create-release:
|
create-release:
|
||||||
needs: [build-windows, build-macos, build-linux]
|
needs: [build-windows, build-macos, build-linux]
|
||||||
|
@ -99,8 +99,8 @@ public class LevelEditor : MonoBehaviour
|
|||||||
float xOff = -325f + idx * 125f;
|
float xOff = -325f + idx * 125f;
|
||||||
var bgRt = bg.GetComponent<RectTransform>();
|
var bgRt = bg.GetComponent<RectTransform>();
|
||||||
var icRt = icon.GetComponent<RectTransform>();
|
var icRt = icon.GetComponent<RectTransform>();
|
||||||
bgRt.anchoredPosition = new Vector2(xOff, bgRt.anchoredPosition.y - 110);
|
bgRt.anchoredPosition = new Vector2(xOff, bgRt.anchoredPosition.y - 70);
|
||||||
icRt.anchoredPosition = new Vector2(xOff, icRt.anchoredPosition.y - 110);
|
icRt.anchoredPosition = new Vector2(xOff, icRt.anchoredPosition.y - 70);
|
||||||
bg.GetComponent<Image>().sprite = Resources.Load<Sprite>("InGame/ButtonSkin/BlankSquare");
|
bg.GetComponent<Image>().sprite = Resources.Load<Sprite>("InGame/ButtonSkin/BlankSquare");
|
||||||
icon.GetComponent<Image>().sprite = prefab.GetComponent<SpriteRenderer>()?.sprite;
|
icon.GetComponent<Image>().sprite = prefab.GetComponent<SpriteRenderer>()?.sprite;
|
||||||
icRt.sizeDelta = prefab.name.ToLower().Contains("small")
|
icRt.sizeDelta = prefab.name.ToLower().Contains("small")
|
||||||
@ -211,14 +211,14 @@ public class LevelEditor : MonoBehaviour
|
|||||||
{
|
{
|
||||||
if (IsBlockedBySameTypeInSnapDirection())
|
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);
|
Destroy(currentBlock);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!SnapSpikeByRotation())
|
if (!SnapSpikeByRotation())
|
||||||
{
|
{
|
||||||
Debug.LogError("Impossible de poser un spike dans le vide !");
|
Debug.LogError("❌ Impossible de poser un spike dans le vide !");
|
||||||
Destroy(currentBlock);
|
Destroy(currentBlock);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -230,6 +230,25 @@ public class LevelEditor : MonoBehaviour
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
TrySnapToNearbyBlock();
|
TrySnapToNearbyBlock();
|
||||||
|
|
||||||
|
// 🔧 Réduction du collider du ObstacleKiller si c’est 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;
|
isPlacingBlock = false;
|
||||||
@ -444,7 +463,7 @@ public class LevelEditor : MonoBehaviour
|
|||||||
|
|
||||||
var col = currentBlock.GetComponent<Collider2D>();
|
var col = currentBlock.GetComponent<Collider2D>();
|
||||||
var b = col.bounds;
|
var b = col.bounds;
|
||||||
float snapDistance = 1f;
|
float snapDistance = 2f;
|
||||||
float verticalEps = 0.1f;
|
float verticalEps = 0.1f;
|
||||||
|
|
||||||
// === SNAP HORIZONTAL (droite)
|
// === SNAP HORIZONTAL (droite)
|
||||||
|
Reference in New Issue
Block a user