Skip to content

Commit c263804

Browse files
committed
Add radial animation
1 parent 9adb489 commit c263804

3 files changed

Lines changed: 105 additions & 12 deletions

File tree

Assets/Scenes/MainMenu.unity

Lines changed: 69 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ GameObject:
185185
serializedVersion: 6
186186
m_Component:
187187
- component: {fileID: 178864957}
188+
- component: {fileID: 178864958}
188189
m_Layer: 5
189190
m_Name: Radial
190191
m_TagString: Untagged
@@ -204,17 +205,34 @@ RectTransform:
204205
m_LocalScale: {x: 1, y: 1, z: 1}
205206
m_ConstrainProportionsScale: 0
206207
m_Children:
207-
- {fileID: 728604727}
208-
- {fileID: 362904401}
209-
- {fileID: 312820129}
208+
- {fileID: 1972401330}
210209
m_Father: {fileID: 423590114}
211210
m_RootOrder: -1
212211
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
213212
m_AnchorMin: {x: 0, y: 0}
214213
m_AnchorMax: {x: 0, y: 0}
215214
m_AnchoredPosition: {x: 0, y: 0}
216-
m_SizeDelta: {x: 110, y: 110}
217-
m_Pivot: {x: 0, y: 0}
215+
m_SizeDelta: {x: 110.00003, y: 110}
216+
m_Pivot: {x: 0.5, y: 0.5}
217+
--- !u!114 &178864958
218+
MonoBehaviour:
219+
m_ObjectHideFlags: 0
220+
m_CorrespondingSourceObject: {fileID: 0}
221+
m_PrefabInstance: {fileID: 0}
222+
m_PrefabAsset: {fileID: 0}
223+
m_GameObject: {fileID: 178864956}
224+
m_Enabled: 1
225+
m_EditorHideFlags: 0
226+
m_Script: {fileID: 11500000, guid: dd4afcd218cbfce44ba8e6a419a43ecf, type: 3}
227+
m_Name:
228+
m_EditorClassIdentifier:
229+
radialRt: {fileID: 1972401330}
230+
line: {fileID: 2011264733}
231+
tweenData:
232+
ease: 12
233+
duration: 2
234+
radialTime: 0.3
235+
lineTime: 0.3
218236
--- !u!1 &206537138
219237
GameObject:
220238
m_ObjectHideFlags: 0
@@ -514,12 +532,12 @@ RectTransform:
514532
m_PrefabInstance: {fileID: 0}
515533
m_PrefabAsset: {fileID: 0}
516534
m_GameObject: {fileID: 312820128}
517-
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
535+
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
518536
m_LocalPosition: {x: 0, y: 0, z: 0}
519537
m_LocalScale: {x: 1, y: 1, z: 1}
520538
m_ConstrainProportionsScale: 0
521539
m_Children: []
522-
m_Father: {fileID: 178864957}
540+
m_Father: {fileID: 1972401330}
523541
m_RootOrder: -1
524542
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
525543
m_AnchorMin: {x: 0.5, y: 0.5}
@@ -605,14 +623,14 @@ RectTransform:
605623
m_PrefabInstance: {fileID: 0}
606624
m_PrefabAsset: {fileID: 0}
607625
m_GameObject: {fileID: 362904400}
608-
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
626+
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
609627
m_LocalPosition: {x: 0, y: 0, z: 0}
610628
m_LocalScale: {x: 1, y: 1, z: 1}
611629
m_ConstrainProportionsScale: 0
612630
m_Children:
613631
- {fileID: 2000422524}
614632
- {fileID: 2011264733}
615-
m_Father: {fileID: 178864957}
633+
m_Father: {fileID: 1972401330}
616634
m_RootOrder: -1
617635
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
618636
m_AnchorMin: {x: 0.5, y: 0.5}
@@ -761,7 +779,7 @@ MonoBehaviour:
761779
m_VolumeTrigger: {fileID: 0}
762780
m_VolumeFrameworkUpdateModeOption: 2
763781
m_RenderPostProcessing: 1
764-
m_Antialiasing: 0
782+
m_Antialiasing: 1
765783
m_AntialiasingQuality: 2
766784
m_StopNaN: 0
767785
m_Dithering: 0
@@ -1152,12 +1170,12 @@ RectTransform:
11521170
m_PrefabInstance: {fileID: 0}
11531171
m_PrefabAsset: {fileID: 0}
11541172
m_GameObject: {fileID: 728604726}
1155-
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
1173+
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
11561174
m_LocalPosition: {x: 0, y: 0, z: 0}
11571175
m_LocalScale: {x: 1, y: 1, z: 1}
11581176
m_ConstrainProportionsScale: 0
11591177
m_Children: []
1160-
m_Father: {fileID: 178864957}
1178+
m_Father: {fileID: 1972401330}
11611179
m_RootOrder: -1
11621180
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
11631181
m_AnchorMin: {x: 0.5, y: 0.5}
@@ -2727,6 +2745,45 @@ MonoBehaviour:
27272745
m_Script: {fileID: 11500000, guid: 6789e9a70583ea646b8caf1fb1749987, type: 3}
27282746
m_Name:
27292747
m_EditorClassIdentifier:
2748+
--- !u!1 &1972401329
2749+
GameObject:
2750+
m_ObjectHideFlags: 0
2751+
m_CorrespondingSourceObject: {fileID: 0}
2752+
m_PrefabInstance: {fileID: 0}
2753+
m_PrefabAsset: {fileID: 0}
2754+
serializedVersion: 6
2755+
m_Component:
2756+
- component: {fileID: 1972401330}
2757+
m_Layer: 5
2758+
m_Name: RadialCircle
2759+
m_TagString: Untagged
2760+
m_Icon: {fileID: 0}
2761+
m_NavMeshLayer: 0
2762+
m_StaticEditorFlags: 0
2763+
m_IsActive: 1
2764+
--- !u!224 &1972401330
2765+
RectTransform:
2766+
m_ObjectHideFlags: 0
2767+
m_CorrespondingSourceObject: {fileID: 0}
2768+
m_PrefabInstance: {fileID: 0}
2769+
m_PrefabAsset: {fileID: 0}
2770+
m_GameObject: {fileID: 1972401329}
2771+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
2772+
m_LocalPosition: {x: 0, y: 0, z: 0}
2773+
m_LocalScale: {x: 1, y: 1, z: 1}
2774+
m_ConstrainProportionsScale: 0
2775+
m_Children:
2776+
- {fileID: 728604727}
2777+
- {fileID: 362904401}
2778+
- {fileID: 312820129}
2779+
m_Father: {fileID: 178864957}
2780+
m_RootOrder: -1
2781+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
2782+
m_AnchorMin: {x: 0.5, y: 0.5}
2783+
m_AnchorMax: {x: 0.5, y: 0.5}
2784+
m_AnchoredPosition: {x: 0, y: 0}
2785+
m_SizeDelta: {x: 100, y: 100}
2786+
m_Pivot: {x: 0.5, y: 0.5}
27302787
--- !u!1 &1988302271
27312788
GameObject:
27322789
m_ObjectHideFlags: 0
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using DG.Tweening;
2+
using System.Collections;
3+
using System.Collections.Generic;
4+
using UnityEngine;
5+
6+
public class RadialAnimation : MonoBehaviour
7+
{
8+
[SerializeField]
9+
private RectTransform radialRt;
10+
[SerializeField]
11+
private RectTransform line;
12+
[SerializeField]
13+
private TweenData tweenData;
14+
15+
[SerializeField]
16+
private float radialTime;
17+
[SerializeField]
18+
private float lineTime;
19+
20+
private void Update()
21+
{
22+
radialRt.transform.rotation = Quaternion.Euler(0, Time.time * radialTime * 360, 0);
23+
line.transform.localRotation = Quaternion.Euler(0, 0, Time.time * lineTime * 360);;
24+
}
25+
}

Assets/Scripts/Animations/RadialAnimation.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)