From 6189bc8807732a9afd72afc8ae29b39b8f115556 Mon Sep 17 00:00:00 2001 From: GL <2365963573@qq.com> Date: Wed, 27 Nov 2024 22:24:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=9C=97=E7=89=9B=E9=AA=91?= =?UTF-8?q?=E5=A3=ABUI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Scenes/RacingPanel.unity | 77 +- .../Assets/Scripts/RacingPanel/BetBtn.cs | 51 + .../Assets/Scripts/RacingPanel/BetBtn.cs.meta | 11 + .../Assets/Scripts/RacingPanel/RacingPanel.cs | 143 ++ .../Scripts/RacingPanel/RacingPanel.cs.meta | 11 + .../prefabs/GLPrefabs/BettingBtns.prefab | 2200 +++++++++++++++++ .../prefabs/GLPrefabs/BettingBtns.prefab.meta | 7 + 7 files changed, 2476 insertions(+), 24 deletions(-) create mode 100644 TheStrongestSnail/Assets/Scripts/RacingPanel/BetBtn.cs create mode 100644 TheStrongestSnail/Assets/Scripts/RacingPanel/BetBtn.cs.meta create mode 100644 TheStrongestSnail/Assets/Scripts/RacingPanel/RacingPanel.cs create mode 100644 TheStrongestSnail/Assets/Scripts/RacingPanel/RacingPanel.cs.meta create mode 100644 TheStrongestSnail/Assets/prefabs/GLPrefabs/BettingBtns.prefab create mode 100644 TheStrongestSnail/Assets/prefabs/GLPrefabs/BettingBtns.prefab.meta diff --git a/TheStrongestSnail/Assets/Scenes/RacingPanel.unity b/TheStrongestSnail/Assets/Scenes/RacingPanel.unity index c73ab52..53b50f3 100644 --- a/TheStrongestSnail/Assets/Scenes/RacingPanel.unity +++ b/TheStrongestSnail/Assets/Scenes/RacingPanel.unity @@ -271,7 +271,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 76, y: 10.223022} - m_SizeDelta: {x: -326.27603, y: -75.27033} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &15724800 MonoBehaviour: @@ -610,7 +610,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 55.7, y: 0.000002861023} - m_SizeDelta: {x: 70, y: 28} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &46327286 MonoBehaviour: @@ -3130,7 +3130,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 78.29999} - m_SizeDelta: {x: 84, y: 32} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &260803675 MonoBehaviour: @@ -5116,7 +5116,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &394840204 RectTransform: m_ObjectHideFlags: 0 @@ -5163,9 +5163,38 @@ MonoBehaviour: m_GameObject: {fileID: 394840203} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8ac9b3977dc52bf479932b58736e30cb, type: 3} + m_Script: {fileID: 11500000, guid: 24c99a049dd7420439581192697ef997, type: 3} m_Name: m_EditorClassIdentifier: + btnHelp: {fileID: 0} + btnPut: {fileID: 0} + btnFirst: {fileID: 0} + btnTask: {fileID: 0} + btnClose: {fileID: 0} + btnMei: {fileID: 1842293128} + btnPig: {fileID: 1936380315} + btnDu: {fileID: 1210943764} + btnGang: {fileID: 68346901} + btnBian: {fileID: 64044008} + btnChao: {fileID: 1654813682} + btnLei: {fileID: 1047739254} + btnMie: {fileID: 1842293128} + imgMei: {fileID: 698011691} + imgPig: {fileID: 988505458} + imgDu: {fileID: 887239059} + imgGang: {fileID: 1997931880} + imgBian: {fileID: 781828505} + imgChao: {fileID: 268503738} + imgLei: {fileID: 1223546705} + imgMie: {fileID: 1643329531} + imgMeiQ: {fileID: 1103898572} + imgPigQ: {fileID: 1098833081} + imgDuQ: {fileID: 601459103} + imgGangQ: {fileID: 990496901} + imgBianQ: {fileID: 1381749172} + imgChaoQ: {fileID: 1050191267} + imgLeiQ: {fileID: 356122228} + imgMieQ: {fileID: 2085566819} --- !u!1 &400264655 GameObject: m_ObjectHideFlags: 0 @@ -5204,7 +5233,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 78.29999} - m_SizeDelta: {x: 84, y: 32} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &400264657 MonoBehaviour: @@ -5579,7 +5608,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 78.29999} - m_SizeDelta: {x: 84, y: 32} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &426538940 MonoBehaviour: @@ -7577,7 +7606,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 78.29999} - m_SizeDelta: {x: 84, y: 32} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &668427515 MonoBehaviour: @@ -7877,7 +7906,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: -57, y: 10.223022} - m_SizeDelta: {x: -426.27603, y: -50.270332} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &691726532 MonoBehaviour: @@ -12460,7 +12489,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 55.7, y: 0.000002861023} - m_SizeDelta: {x: 70, y: 28} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1106311624 MonoBehaviour: @@ -12668,7 +12697,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -120.2, y: 0.00009918213} - m_SizeDelta: {x: 64, y: 77} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1109017569 MonoBehaviour: @@ -13380,7 +13409,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 78.29999} - m_SizeDelta: {x: 84, y: 32} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1153843291 MonoBehaviour: @@ -13870,7 +13899,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 55.7, y: 0.000002861023} - m_SizeDelta: {x: 70, y: 28} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1186497991 MonoBehaviour: @@ -14588,7 +14617,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 55.7, y: 0.000002861023} - m_SizeDelta: {x: 70, y: 28} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1235189132 MonoBehaviour: @@ -16194,7 +16223,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 55.7, y: 0.000002861023} - m_SizeDelta: {x: 70, y: 28} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1413792589 MonoBehaviour: @@ -16684,7 +16713,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 38.3, y: -3.9} - m_SizeDelta: {x: 240, y: 45} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1433070521 MonoBehaviour: @@ -16932,7 +16961,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 78.29999} - m_SizeDelta: {x: 84, y: 32} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1476546208 MonoBehaviour: @@ -17777,7 +17806,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 51.19999, y: -39.600098} - m_SizeDelta: {x: 302.89, y: 112} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 1} --- !u!114 &1536229429 MonoBehaviour: @@ -18172,7 +18201,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 55.7, y: 0.000002861023} - m_SizeDelta: {x: 70, y: 28} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1553476817 MonoBehaviour: @@ -20283,7 +20312,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 78.29999} - m_SizeDelta: {x: 84, y: 32} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1692645522 MonoBehaviour: @@ -20613,7 +20642,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 55.7, y: 0.000002861023} - m_SizeDelta: {x: 70, y: 28} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1702042053 MonoBehaviour: @@ -22615,7 +22644,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 78.29999} - m_SizeDelta: {x: 84, y: 32} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1898600950 MonoBehaviour: @@ -22756,7 +22785,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 157.70007, y: -158.03} - m_SizeDelta: {x: 200.94, y: 67.04} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 1} --- !u!114 &1927887917 MonoBehaviour: @@ -22938,7 +22967,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 55.7, y: 0.000002861023} - m_SizeDelta: {x: 70, y: 28} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1931260876 MonoBehaviour: diff --git a/TheStrongestSnail/Assets/Scripts/RacingPanel/BetBtn.cs b/TheStrongestSnail/Assets/Scripts/RacingPanel/BetBtn.cs new file mode 100644 index 0000000..53f0e92 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/RacingPanel/BetBtn.cs @@ -0,0 +1,51 @@ +using System.Collections; +using System.Collections.Generic; +using Unity.VisualScripting; +using UnityEngine; +using UnityEngine.UI; +public class BetBtn : MonoBehaviour +{ + public static BetBtn instance; + public GameObject BetList; + public Button NumBtn; + public Text BetText; + public float BetValue;//投注的值 + public float AllBetValue;//投注总值 + + public Button BetButton;//投注的按钮 + // Start is called before the first frame update + void Start() + { + instance = this; + BetList.SetActive(false); + NumBtn.onClick.AddListener(OnClickNumBtn); + BetValue = 50;//默认50 + SetBet(); + } + + // Update is called once per frame + void Update() + { + + } + void OnClickNumBtn() + { + BetList.SetActive(true); + + } + void SetBet() + { + // 获取所有的Button组件 + Button[] buttons = BetList.GetComponentsInChildren