From 335d1c528e99bc47d65d7fe29dfd7c0e37f65c5a Mon Sep 17 00:00:00 2001 From: fdavin <fransdavin19@gmail.com> Date: Sat, 15 Apr 2023 10:09:03 +0700 Subject: [PATCH] feat: chargebar --- Assets/BowShooting.cs | 6 +++--- Assets/Scenes/Level_01.unity | 31 ++++++++++++++++--------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Assets/BowShooting.cs b/Assets/BowShooting.cs index 12dbb2e..3039718 100644 --- a/Assets/BowShooting.cs +++ b/Assets/BowShooting.cs @@ -5,7 +5,7 @@ using UnityEngine.UI; using TMPro; public class BowShooting : MonoBehaviour { - public TMP_Text firePowerText; + public Slider firePowerSlider; public Bow bow; public float maxPower; private float firePowerSpeed; @@ -44,11 +44,11 @@ public class BowShooting : MonoBehaviour if (fire) { - firePowerText.text = "Fire Power: " + firePowerSpeed.ToString("F0"); + firePowerSlider.value = firePowerSpeed; } else { - firePowerText.text = "Fire Power: 0"; + firePowerSlider.value = 5; } } } diff --git a/Assets/Scenes/Level_01.unity b/Assets/Scenes/Level_01.unity index cc9dfd4..df8d391 100644 --- a/Assets/Scenes/Level_01.unity +++ b/Assets/Scenes/Level_01.unity @@ -509,7 +509,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 624092168} - m_RootOrder: 8 + m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &65180355 MonoBehaviour: @@ -968,7 +968,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 919132149155446097, guid: abb0f8985aeba6042ab01fe6fafae663, type: 3} propertyPath: m_IsActive - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 919132149155446097, guid: abb0f8985aeba6042ab01fe6fafae663, type: 3} propertyPath: m_TagString @@ -1613,7 +1613,7 @@ PrefabInstance: m_Modifications: - target: {fileID: -8679921383154817045, guid: c9a73f42c15ac4f48a92c5f435471f7f, type: 3} propertyPath: m_RootOrder - value: 5 + value: 6 objectReference: {fileID: 0} - target: {fileID: -8679921383154817045, guid: c9a73f42c15ac4f48a92c5f435471f7f, type: 3} propertyPath: m_LocalScale.x @@ -2514,7 +2514,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 624092168} - m_RootOrder: 7 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &450320207 MonoBehaviour: @@ -8445,6 +8445,7 @@ MonoBehaviour: - {fileID: 1528693926709559163} - {fileID: 47640732} - {fileID: 1318841538} + oneHit: 0 --- !u!82 &624092164 AudioSource: m_ObjectHideFlags: 0 @@ -9276,14 +9277,14 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 703166366} - m_LocalRotation: {x: 0.000000029802322, y: 0.47787175, z: 0.0000000037252903, w: 0.8784297} - m_LocalPosition: {x: 2.4000003, y: -0.19999978, z: -0.00000014901161} + m_LocalRotation: {x: 0.21632987, y: 0.4631539, z: -0.11768496, w: 0.85137546} + m_LocalPosition: {x: 2.4000003, y: -0.19999978, z: -0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 118742021} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 57.093, z: 0} + m_LocalEulerAnglesHint: {x: 28.514, y: 57.093, z: 0} --- !u!1001 &712265981 PrefabInstance: m_ObjectHideFlags: 0 @@ -10250,7 +10251,7 @@ PrefabInstance: m_Modifications: - target: {fileID: 100002, guid: f1d84cc28597f5641a3d9cbc4df7e306, type: 3} propertyPath: m_IsActive - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 100002, guid: f1d84cc28597f5641a3d9cbc4df7e306, type: 3} propertyPath: m_TagString @@ -10258,7 +10259,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 100006, guid: f1d84cc28597f5641a3d9cbc4df7e306, type: 3} propertyPath: m_IsActive - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 100006, guid: f1d84cc28597f5641a3d9cbc4df7e306, type: 3} propertyPath: m_TagString @@ -16504,7 +16505,7 @@ PrefabInstance: m_Modifications: - target: {fileID: -8679921383154817045, guid: abd916789bc97d749bbd99ecea64cc61, type: 3} propertyPath: m_RootOrder - value: 4 + value: 5 objectReference: {fileID: 0} - target: {fileID: -8679921383154817045, guid: abd916789bc97d749bbd99ecea64cc61, type: 3} propertyPath: m_LocalScale.x @@ -16795,13 +16796,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1493232821} - m_LocalRotation: {x: 0.000680983, y: -0, z: -0, w: 0.99999976} - m_LocalPosition: {x: 0.499, y: 0.339, z: 0.493} - m_LocalScale: {x: 1.0000001, y: 1.0000001, z: 0.99999994} + m_LocalRotation: {x: -0.5644271, y: -0.40523633, z: -0.4191635, w: -0.5843865} + m_LocalPosition: {x: 4.745663, y: -1.0841857, z: 0.2080375} + m_LocalScale: {x: 10, y: 10, z: 10} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 624092168} - m_RootOrder: 6 + m_Father: {fileID: 118742021} + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &1493232823 MonoBehaviour: -- GitLab