From 1368035d8159d3b995af135172c85a538434e108 Mon Sep 17 00:00:00 2001 From: Rapandrasmus <78219215+Rapandrasmus@users.noreply.github.com> Date: Sat, 24 Jun 2023 13:57:19 +0200 Subject: [PATCH] Balloons have random positioning now --- Assets/Resources/Games/nightWalkAgb.prefab | 12 ++++++------ Assets/Scripts/Games/NightWalkAgb/AgbPlayYan.cs | 4 ++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Assets/Resources/Games/nightWalkAgb.prefab b/Assets/Resources/Games/nightWalkAgb.prefab index 3420e59ae..017103150 100644 --- a/Assets/Resources/Games/nightWalkAgb.prefab +++ b/Assets/Resources/Games/nightWalkAgb.prefab @@ -24,7 +24,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 202270967205101524} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -6.18, y: -0.7, z: 0} + m_LocalPosition: {x: -6.6, y: -0.7, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -296,7 +296,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1599624797399516083} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -6.45, y: -0.84, z: 0} + m_LocalPosition: {x: -6.6, y: -0.84, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -328,7 +328,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1625193486070694595} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -6.68, y: -0.56, z: 0} + m_LocalPosition: {x: -6.6, y: -0.56, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -767,7 +767,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4465275889429203320} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -6.13, y: -1.26, z: 0} + m_LocalPosition: {x: -6.6, y: -1.26, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -1011,7 +1011,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5930070133449403727} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -6.05, y: -0.98, z: 0} + m_LocalPosition: {x: -6.6, y: -0.98, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -1467,7 +1467,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8467067257209797344} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -6.32, y: -1.12, z: 0} + m_LocalPosition: {x: -6.6, y: -1.12, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: diff --git a/Assets/Scripts/Games/NightWalkAgb/AgbPlayYan.cs b/Assets/Scripts/Games/NightWalkAgb/AgbPlayYan.cs index faa79b108..4ba4ea380 100644 --- a/Assets/Scripts/Games/NightWalkAgb/AgbPlayYan.cs +++ b/Assets/Scripts/Games/NightWalkAgb/AgbPlayYan.cs @@ -26,6 +26,8 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk private Animator anim; private float fallStartY; private double playYanFallBeat; + [SerializeField] private float randomMinBalloonX = -0.45f; + [SerializeField] private float randomMaxBalloonX = 0.45f; private void Awake() { @@ -36,6 +38,8 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk foreach (var balloon in balloons) { balloon.Play("Idle", 0, UnityEngine.Random.Range(0f, 1f)); + Transform balloonTrans = balloon.transform.parent; + balloonTrans.localPosition = new Vector3(balloonTrans.localPosition.x + UnityEngine.Random.Range(randomMinBalloonX, randomMaxBalloonX), balloonTrans.localPosition.y); } }