diff --git a/TheStrongestSnail/Assets/Scenes/Scene_main.unity b/TheStrongestSnail/Assets/Scenes/Scene_main.unity index e8d2c82..97e99a1 100644 --- a/TheStrongestSnail/Assets/Scenes/Scene_main.unity +++ b/TheStrongestSnail/Assets/Scenes/Scene_main.unity @@ -730,82 +730,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 201697259} m_CullTransparentMesh: 1 ---- !u!1 &207774471 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 207774472} - - component: {fileID: 207774474} - - component: {fileID: 207774473} - m_Layer: 5 - m_Name: duizhao - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!224 &207774472 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 207774471} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 1769459764} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 2325, y: 0} - m_SizeDelta: {x: 7479.652, y: 2436} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &207774473 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 207774471} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 0.5529412} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 21300000, guid: 263d5b6b9a7228c4298f92ba8e135997, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!222 &207774474 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 207774471} - m_CullTransparentMesh: 1 --- !u!1 &215141885 GameObject: m_ObjectHideFlags: 0 @@ -1441,6 +1365,12 @@ MonoBehaviour: mainScene: {fileID: 1769459763} minX: -5315 maxX: 0 + targetPositions: + - 0 + - -2100 + - -3760 + - -5350 + mainBtnScript: {fileID: 0} --- !u!1 &278944241 GameObject: m_ObjectHideFlags: 0 @@ -1722,7 +1652,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: fa9fccadda7b7ac43b24c43fa954dcce, type: 3} m_Name: m_EditorClassIdentifier: - mainPanel: {fileID: 0} + mainPanel: {fileID: 1769459763} BTN_0: {fileID: 1937427102} BTN_1: {fileID: 1906759230} BTN_2: {fileID: 934652041} @@ -7314,7 +7244,6 @@ RectTransform: - {fileID: 1535452030} - {fileID: 500353810} - {fileID: 1434243873} - - {fileID: 207774472} m_Father: {fileID: 278122029} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/TheStrongestSnail/Assets/Scripts/Scene_main/mainBTN.cs b/TheStrongestSnail/Assets/Scripts/Scene_main/mainBTN.cs index ef1b8e8..5344e35 100644 --- a/TheStrongestSnail/Assets/Scripts/Scene_main/mainBTN.cs +++ b/TheStrongestSnail/Assets/Scripts/Scene_main/mainBTN.cs @@ -9,6 +9,7 @@ using UnityEngine.UI; public class mainBTN : MonoBehaviour { public GameObject mainPanel; + private RectTransform mainPanelRect; public GameObject BTN_0; public GameObject BTN_1; @@ -22,62 +23,61 @@ public class mainBTN : MonoBehaviour // Start is called before the first frame update void Start() { - BTN_0.GetComponent