Skip to content

Commit

Permalink
Placed the main button correct
Browse files Browse the repository at this point in the history
  • Loading branch information
bas-boop committed Apr 24, 2024
1 parent a7ad0c1 commit 65fc9e1
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 26 deletions.
69 changes: 55 additions & 14 deletions Assets/Prefabs/Funcinal/UI/Canvas/MainCanvas.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,14 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 280917057395817349}
- {fileID: 3986810430439093946}
- {fileID: 359971216551116500}
- {fileID: 3452866101729781399}
m_Father: {fileID: 5675474643035180365}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: 100}
m_SizeDelta: {x: 100, y: 100}
m_AnchoredPosition: {x: 0, y: 250}
m_SizeDelta: {x: 1440, y: 500}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &2127110672818169545
GameObject:
Expand Down Expand Up @@ -138,7 +136,7 @@ Transform:
- {fileID: 5675474643035180365}
- {fileID: 2573004835948038205}
m_Father: {fileID: 0}
m_RootOrder: 1
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &4620262679029281397
GameObject:
Expand Down Expand Up @@ -172,12 +170,12 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 1
m_Children: []
m_Father: {fileID: 5837157590404868141}
m_Father: {fileID: 3452866101729781399}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: 175}
m_AnchoredPosition: {x: 0, y: 75}
m_SizeDelta: {x: 200, y: 200}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2302379034204909994
Expand Down Expand Up @@ -487,12 +485,12 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5837157590404868141}
m_Father: {fileID: 3452866101729781399}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: 175}
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 0, y: 25}
m_SizeDelta: {x: 350, y: 350}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3845564678020147217
Expand Down Expand Up @@ -601,6 +599,45 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!1 &8207825071808994439
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3452866101729781399}
m_Layer: 5
m_Name: Placement
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3452866101729781399
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8207825071808994439}
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:
- {fileID: 280917057395817349}
- {fileID: 3986810430439093946}
- {fileID: 359971216551116500}
m_Father: {fileID: 5837157590404868141}
m_RootOrder: -1
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: 0, y: 125}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &8990824061237540727
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -633,12 +670,12 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 1
m_Children: []
m_Father: {fileID: 5837157590404868141}
m_Father: {fileID: 3452866101729781399}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: 175}
m_AnchoredPosition: {x: 0, y: 75}
m_SizeDelta: {x: 200, y: 200}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6558310364993463697
Expand Down Expand Up @@ -1075,6 +1112,10 @@ PrefabInstance:
propertyPath: m_Name
value: Photobook
objectReference: {fileID: 0}
- target: {fileID: 6032113520376433366, guid: e76b816bb274b23418c92a7679ed15ba, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
Expand Down
20 changes: 10 additions & 10 deletions Assets/Scenes/Testing/All UI.unity
Original file line number Diff line number Diff line change
Expand Up @@ -1634,7 +1634,7 @@ PrefabInstance:
objectReference: {fileID: 223758744}
- target: {fileID: 8941643025792727764, guid: 33b1d199434d85d4c838b9e3000efc74, type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
Expand Down Expand Up @@ -2831,31 +2831,31 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 2422362989458044855, guid: 34b0e8de619297a4d86620a8c49645b8, type: 3}
propertyPath: m_LocalRotation.x
value: 0.23063144
value: 0.23063147
objectReference: {fileID: 0}
- target: {fileID: 2422362989458044855, guid: 34b0e8de619297a4d86620a8c49645b8, type: 3}
propertyPath: m_LocalRotation.y
value: 0.20796485
value: 0.20796488
objectReference: {fileID: 0}
- target: {fileID: 2422362989458044855, guid: 34b0e8de619297a4d86620a8c49645b8, type: 3}
propertyPath: m_LocalRotation.z
value: -0.050529443
value: -0.050529454
objectReference: {fileID: 0}
- target: {fileID: 3905940548920388439, guid: 34b0e8de619297a4d86620a8c49645b8, type: 3}
propertyPath: m_LocalRotation.w
value: 0.9492136
objectReference: {fileID: 0}
- target: {fileID: 3905940548920388439, guid: 34b0e8de619297a4d86620a8c49645b8, type: 3}
propertyPath: m_LocalRotation.x
value: 0.23063146
value: 0.23063147
objectReference: {fileID: 0}
- target: {fileID: 3905940548920388439, guid: 34b0e8de619297a4d86620a8c49645b8, type: 3}
propertyPath: m_LocalRotation.y
value: 0.20796487
value: 0.20796488
objectReference: {fileID: 0}
- target: {fileID: 3905940548920388439, guid: 34b0e8de619297a4d86620a8c49645b8, type: 3}
propertyPath: m_LocalRotation.z
value: -0.05052945
value: -0.050529454
objectReference: {fileID: 0}
- target: {fileID: 4070547984105785384, guid: 34b0e8de619297a4d86620a8c49645b8, type: 3}
propertyPath: m_LocalRotation.w
Expand Down Expand Up @@ -2883,15 +2883,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5688119187598977341, guid: 34b0e8de619297a4d86620a8c49645b8, type: 3}
propertyPath: m_LocalRotation.x
value: 0.18399276
value: 0.18399277
objectReference: {fileID: 0}
- target: {fileID: 5688119187598977341, guid: 34b0e8de619297a4d86620a8c49645b8, type: 3}
propertyPath: m_LocalRotation.y
value: 0.2101847
value: 0.21018477
objectReference: {fileID: 0}
- target: {fileID: 5688119187598977341, guid: 34b0e8de619297a4d86620a8c49645b8, type: 3}
propertyPath: m_LocalRotation.z
value: -0.04031129
value: -0.040311307
objectReference: {fileID: 0}
- target: {fileID: 6505507267890270945, guid: 34b0e8de619297a4d86620a8c49645b8, type: 3}
propertyPath: m_Name
Expand Down
4 changes: 2 additions & 2 deletions Assets/Scripts/UI/Canvas/AnimatedButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace UI.Canvas
[RequireComponent(typeof(RectTransform))]
public sealed class AnimatedButton : MonoBehaviour
{
private readonly Vector3 setPosition = new (0, 125, 0);
private readonly Vector3 resetPosition = new (0, 100, 0);

[SerializeField] private Vector2 direction;
[SerializeField] private float animationDuration;
Expand All @@ -24,7 +24,7 @@ public sealed class AnimatedButton : MonoBehaviour
/// </summary>
public void ForceReset()
{
_rect.localPosition = setPosition;
_rect.localPosition = resetPosition;
_isAtBeginPosition = true;
}

Expand Down

0 comments on commit 65fc9e1

Please sign in to comment.