diff --git a/Assets/SequenceExamples/Prefabs/SearchElement.prefab b/Assets/SequenceExamples/Prefabs/SearchElement.prefab index 88ef8193..45d2785a 100644 --- a/Assets/SequenceExamples/Prefabs/SearchElement.prefab +++ b/Assets/SequenceExamples/Prefabs/SearchElement.prefab @@ -504,7 +504,7 @@ MonoBehaviour: m_fontColor32: serializedVersion: 2 rgba: 4281479730 - m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_fontColor: {r: 0, g: 0, b: 0, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: diff --git a/Assets/SequenceExamples/Prefabs/Token.prefab b/Assets/SequenceExamples/Prefabs/Token.prefab index cfd7e58a..fe3e7915 100644 --- a/Assets/SequenceExamples/Prefabs/Token.prefab +++ b/Assets/SequenceExamples/Prefabs/Token.prefab @@ -703,7 +703,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 0.5686275} + m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 diff --git a/Assets/SequenceExamples/Prefabs/WalletPanel.prefab b/Assets/SequenceExamples/Prefabs/WalletPanel.prefab index 33c46274..25a392c2 100644 --- a/Assets/SequenceExamples/Prefabs/WalletPanel.prefab +++ b/Assets/SequenceExamples/Prefabs/WalletPanel.prefab @@ -579,7 +579,7 @@ MonoBehaviour: m_OnClick: m_PersistentCalls: m_Calls: - - m_Target: {fileID: 0} + - m_Target: {fileID: 2980900696299840485} m_TargetAssemblyTypeName: Sequence.Demo.UIPanel, SequenceExamples m_MethodName: GoBack m_Mode: 1 @@ -1158,9 +1158,9 @@ RectTransform: m_Father: {fileID: 2980900696758489947} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 150, y: -290} m_SizeDelta: {x: 275, y: 10} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &2980900695196224119 @@ -1330,9 +1330,9 @@ RectTransform: m_Father: {fileID: 2980900696758489947} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 150, y: -50} m_SizeDelta: {x: 250, y: 30} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &2980900695233699302 @@ -3194,7 +3194,7 @@ MonoBehaviour: m_HandleRect: {fileID: 2980900697128280171} m_Direction: 2 m_Value: 0 - m_Size: 1 + m_Size: 0.99999994 m_NumberOfSteps: 0 m_OnValueChanged: m_PersistentCalls: @@ -3233,9 +3233,9 @@ RectTransform: m_Father: {fileID: 2980900696545480893} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 130, y: -15} m_SizeDelta: {x: 90, y: 20} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &2980900695523446805 @@ -3443,9 +3443,9 @@ RectTransform: m_Father: {fileID: 2980900696758489947} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 150, y: -185} m_SizeDelta: {x: 200, y: 200} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &2980900695558038845 @@ -4337,9 +4337,9 @@ RectTransform: m_Father: {fileID: 2980900696758489947} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 150, y: -75} m_SizeDelta: {x: 200, y: 20} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &2980900695857846700 @@ -4471,9 +4471,9 @@ RectTransform: m_Father: {fileID: 2980900696758489947} m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 150, y: -385} m_SizeDelta: {x: 300, y: 30} m_Pivot: {x: 0.5, y: 0} --- !u!114 &2980900695876322117 @@ -4612,7 +4612,19 @@ MonoBehaviour: m_TargetGraphic: {fileID: 0} m_OnClick: m_PersistentCalls: - m_Calls: [] + m_Calls: + - m_Target: {fileID: 2980900696299840485} + m_TargetAssemblyTypeName: Sequence.Demo.WalletPanel, SequenceExamples + m_MethodName: OpenWalletDropdown + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 --- !u!1 &2980900695919976571 GameObject: m_ObjectHideFlags: 0 @@ -4735,7 +4747,7 @@ MonoBehaviour: m_HandleRect: {fileID: 2980900697197503476} m_Direction: 2 m_Value: 1 - m_Size: 0.11847464 + m_Size: 0.0071519567 m_NumberOfSteps: 0 m_OnValueChanged: m_PersistentCalls: @@ -4981,9 +4993,9 @@ RectTransform: m_Father: {fileID: 2980900696758489947} m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 150, y: -340} m_SizeDelta: {x: 275, y: 30} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &2980900695942656415 @@ -5650,9 +5662,9 @@ RectTransform: m_Father: {fileID: 2980900696520566505} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 60, y: -15} m_SizeDelta: {x: 120, y: 30} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &2980900696050489943 @@ -6411,9 +6423,9 @@ RectTransform: m_Father: {fileID: 2980900696545480893} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 68, y: -15} m_SizeDelta: {x: 30, y: 30} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &2980900696148897788 @@ -6743,7 +6755,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 2701} + m_SizeDelta: {x: 0, y: 44743} m_Pivot: {x: 0.5, y: 1} --- !u!1 &2980900696299840491 GameObject: @@ -6843,7 +6855,7 @@ MonoBehaviour: InitialPage: {fileID: 2980900696715088358} _searchButton: {fileID: 2980900695295444194} _backButton: {fileID: 2980900697117005855} - _walletAddressText: {fileID: 0} + _walletAddressText: {fileID: 2980900696067011591} --- !u!1 &2980900696340165530 GameObject: m_ObjectHideFlags: 0 @@ -7700,9 +7712,9 @@ RectTransform: m_Father: {fileID: 2980900696520566505} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 154, y: -20} m_SizeDelta: {x: 62, y: 20} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &2980900696445274693 @@ -7963,9 +7975,9 @@ RectTransform: m_Father: {fileID: 2980900696758489947} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 150, y: -310} m_SizeDelta: {x: 275, y: 30} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &2980900696520566504 @@ -8030,9 +8042,9 @@ RectTransform: m_Father: {fileID: 2980900696758489947} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 150, y: -5} m_SizeDelta: {x: 250, y: 30} m_Pivot: {x: 0.5, y: 1} --- !u!114 &2980900696545480892 @@ -8965,10 +8977,10 @@ MonoBehaviour: _animation: 0 _numberOfTokenPlaceholdersToInstantiate: 3 _tokenPlaceHolderPrefab: {fileID: 6706636487979383531, guid: 5046b36227b8f41dc898c9e90a98e655, type: 3} - _numberOfTokensToFetchAtOnce: 1 + _numberOfTokensToFetchAtOnce: 6 _numberOfNftPlaceholdersToInstantiate: 10 _nftPlaceHolderPrefab: {fileID: 1878011362095268920, guid: 0ad74f6689ca94f53b758794927d6133, type: 3} - _numberOfNftsToFetchAtOnce: 1 + _numberOfNftsToFetchAtOnce: 6 _scrollviewContentParent: {fileID: 2980900695808590223} TimeBetweenTokenValueRefreshesInSeconds: 5 --- !u!1 &2980900696743074721 @@ -9228,7 +9240,7 @@ MonoBehaviour: m_HandleRect: {fileID: 2980900696194897349} m_Direction: 2 m_Value: 0 - m_Size: 1 + m_Size: 0.99999994 m_NumberOfSteps: 0 m_OnValueChanged: m_PersistentCalls: @@ -11756,7 +11768,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 0} + m_Sprite: {fileID: 21300000, guid: 1f7d57eac46e543d184e1bc30ecd3e39, type: 3} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 @@ -11866,9 +11878,9 @@ RectTransform: m_Father: {fileID: 2980900696545480893} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 187, y: -15} m_SizeDelta: {x: 20, y: 20} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &2980900697175016639 diff --git a/Assets/SequenceExamples/Scenes/Demo.unity b/Assets/SequenceExamples/Scenes/Demo.unity index 2bef1871..11dd3490 100644 --- a/Assets/SequenceExamples/Scenes/Demo.unity +++ b/Assets/SequenceExamples/Scenes/Demo.unity @@ -7693,38 +7693,6 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 171231629} m_Modifications: - - target: {fileID: 1205280610408878046, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1205280610408878046, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1205280610408878046, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1205280610408878046, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2798441867670105215, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2798441867670105215, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2798441867670105215, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2798441867670105215, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - target: {fileID: 2980900695196224117, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} propertyPath: m_AnchorMax.y value: 0 @@ -7757,22 +7725,6 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 2980900695295444189, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900695295444189, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900695295444189, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900695295444189, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - target: {fileID: 2980900695379668971, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} propertyPath: m_AnchorMax.y value: 0 @@ -7825,22 +7777,6 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 2980900695677583050, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900695677583050, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900695677583050, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900695677583050, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - target: {fileID: 2980900695817914343, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} propertyPath: m_AnchorMax.x value: 0 @@ -7881,22 +7817,6 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 2980900695890846396, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900695890846396, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900695890846396, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900695890846396, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - target: {fileID: 2980900695939724626, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} propertyPath: m_AnchorMax.x value: 0 @@ -7953,22 +7873,6 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 2980900696124006223, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900696124006223, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900696124006223, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900696124006223, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - target: {fileID: 2980900696148897666, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} propertyPath: m_AnchorMax.y value: 0 @@ -8009,14 +7913,6 @@ PrefabInstance: propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 2980900696194897349, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900696265226126, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_SizeDelta.y - value: 44743 - objectReference: {fileID: 0} - target: {fileID: 2980900696299840490, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} propertyPath: m_Pivot.x value: 0.5 @@ -8105,38 +8001,6 @@ PrefabInstance: propertyPath: m_Name value: WalletPanel objectReference: {fileID: 0} - - target: {fileID: 2980900696362007278, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900696362007278, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900696362007278, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900696362007278, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900696430991612, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900696430991612, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900696430991612, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900696430991612, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - target: {fileID: 2980900696445274699, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} propertyPath: m_AnchorMax.y value: 0 @@ -8185,30 +8049,6 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 2980900696671892565, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900696671892565, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900696671892565, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900696671892565, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900696715088358, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: _numberOfNftsToFetchAtOnce - value: 6 - objectReference: {fileID: 0} - - target: {fileID: 2980900696715088358, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: _numberOfTokensToFetchAtOnce - value: 6 - objectReference: {fileID: 0} - target: {fileID: 2980900696834639998, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} propertyPath: m_AnchorMax.y value: 0 @@ -8229,38 +8069,6 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 2980900696981492725, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900696981492725, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900696981492725, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900696981492725, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900697118336808, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900697118336808, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900697118336808, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2980900697118336808, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - target: {fileID: 2980900697128280171, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} propertyPath: m_AnchorMax.x value: 0 @@ -8269,10 +8077,6 @@ PrefabInstance: propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 2980900697128280171, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - target: {fileID: 2980900697159384570, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} propertyPath: m_AnchorMax.y value: 0 @@ -8317,22 +8121,6 @@ PrefabInstance: propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 6559553746371087155, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6559553746371087155, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6559553746371087155, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6559553746371087155, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - target: {fileID: 6813335907843917899, guid: 7d8e311766e5c4b8693a216ca3708b52, type: 3} propertyPath: m_AnchorMax.y value: 0 diff --git a/Assets/SequenceExamples/Scripts/Tests/TestAddressCondenser.cs b/Assets/SequenceExamples/Scripts/Tests/TestAddressCondenser.cs new file mode 100644 index 00000000..0adbff9b --- /dev/null +++ b/Assets/SequenceExamples/Scripts/Tests/TestAddressCondenser.cs @@ -0,0 +1,23 @@ +using NUnit.Framework; +using Sequence; +using Sequence.Demo; + +namespace SequenceExamples.Scripts.Tests +{ + public class TestAddressCondenser + { + private static object[] CondenseForUITestCases = new[] + { + new object[] {new Address("0xc683a014955b75F5ECF991d4502427c8fa1Aa249"), "0xc683...a249"}, + new object[] {new Address("0x1099542D7dFaF6757527146C0aB9E70A967f71C0"), "0x1099...71C0"}, + new object[] {new Address("0x606e6d28e9150D8A3C070AEfB751a2D0C5DB19fa"), "0x606e...19fa"} + }; + + [TestCaseSource(nameof(CondenseForUITestCases))] + public void TestCondenseForUI(Address address, string expected) + { + string actual = address.CondenseForUI(); + Assert.AreEqual(expected, actual); + } + } +} \ No newline at end of file diff --git a/Assets/SequenceExamples/Scripts/Tests/TestAddressCondenser.cs.meta b/Assets/SequenceExamples/Scripts/Tests/TestAddressCondenser.cs.meta new file mode 100644 index 00000000..5cbf4565 --- /dev/null +++ b/Assets/SequenceExamples/Scripts/Tests/TestAddressCondenser.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ff31750ae4bd482aad489fead8c4506c +timeCreated: 1697477622 \ No newline at end of file diff --git a/Assets/SequenceExamples/Scripts/Tests/UITestHarness.cs b/Assets/SequenceExamples/Scripts/Tests/UITestHarness.cs index 02ba9a2d..5535d0eb 100644 --- a/Assets/SequenceExamples/Scripts/Tests/UITestHarness.cs +++ b/Assets/SequenceExamples/Scripts/Tests/UITestHarness.cs @@ -30,8 +30,11 @@ public class UITestHarness : MonoBehaviour private NftInfoPage _nftInfoPage; private TokenInfoPage _tokenInfoPage; private SearchViewAllPage _searchViewAllPage; + private WalletDropdown _walletDropdown; public static float WaitForAnimationTime = 1.5f; + + public static readonly Address TestAddress = new Address("0xc683a014955b75F5ECF991d4502427c8fa1Aa249"); [UnitySetUp] public IEnumerator LoadSceneAndWaitForAwakeAndStartAndFetchMajorElements() @@ -55,6 +58,7 @@ public IEnumerator LoadSceneAndWaitForAwakeAndStartAndFetchMajorElements() _nftInfoPage = FindObjectOfType(); _tokenInfoPage = FindObjectOfType(); _searchViewAllPage = FindObjectOfType(); + _walletDropdown = FindObjectOfType(); } GameObject testObject = new GameObject("TestObject"); @@ -75,7 +79,7 @@ private IEnumerator InitiateTest(UIPanel initialPanel, params object[] args) _loginFlowUITests.Setup(_testMonobehaviour, _ui, _loginPanel, _connectPage, _loginPage, _mfaPage, _loginSuccessPage, _walletPanel); _walletFlowUITests.Setup(_testMonobehaviour, _ui, _walletPanel, _walletPage, _loginPanel, _transitionPanel, - _searchPage, _collectionInfoPage, _nftInfoPage, _tokenInfoPage, _searchViewAllPage); + _searchPage, _collectionInfoPage, _nftInfoPage, _tokenInfoPage, _searchViewAllPage, _walletDropdown); } [UnityTearDown] @@ -122,7 +126,8 @@ private IEnumerator InitiateWalletPanelTest() _walletFlowUITests.RandomNumberOfNftsToFetch = Random.Range(1, 100); yield return _testMonobehaviour.StartCoroutine(InitiateTest(_walletPanel, new MockTokenContentFetcher(_walletFlowUITests.RandomNumberOfTokensToFetch, 0), - new MockNftContentFetcher(_walletFlowUITests.RandomNumberOfNftsToFetch, 0))); + new MockNftContentFetcher(_walletFlowUITests.RandomNumberOfNftsToFetch, 0), + TestAddress)); } [UnityTest] @@ -155,6 +160,13 @@ public IEnumerator SearchViewAllTest() yield return _testMonobehaviour.StartCoroutine(_walletFlowUITests.TestSearchViewAllPage()); } + [UnityTest] + public IEnumerator WalletDropdownTest() + { + yield return _testMonobehaviour.StartCoroutine(InitiateWalletPanelTest()); + yield return _testMonobehaviour.StartCoroutine(_walletFlowUITests.TestWalletDropdown()); + } + [UnityTest] public IEnumerator ContentFetcherEndToEndTest() { @@ -166,7 +178,8 @@ public IEnumerator ContentFetcherEndToEndTest() nftFetcher.OnNftFetchSuccess += _walletFlowUITests.OnNftFetch; yield return _testMonobehaviour.StartCoroutine(InitiateTest(_walletPanel, tokenFetcher, - nftFetcher)); + nftFetcher, + TestAddress)); yield return _testMonobehaviour.StartCoroutine(_walletFlowUITests.EndToEndTestFetchWalletContent()); } } diff --git a/Assets/SequenceExamples/Scripts/Tests/WalletFlowUITests.cs b/Assets/SequenceExamples/Scripts/Tests/WalletFlowUITests.cs index ab8c470c..9a5f31f8 100644 --- a/Assets/SequenceExamples/Scripts/Tests/WalletFlowUITests.cs +++ b/Assets/SequenceExamples/Scripts/Tests/WalletFlowUITests.cs @@ -33,13 +33,14 @@ public class WalletFlowUITests : MonoBehaviour private NftInfoPage _nftInfoPage; private TokenInfoPage _tokenInfoPage; private SearchViewAllPage _searchViewAllPage; + private WalletDropdown _walletDropdown; private bool _nftInfoPageCurrencyValueRefreshTested = false; private bool _tokensLoaded = false; private bool _nftsLoaded = false; - public void Setup(MonoBehaviour testMonobehaviour, SequenceSampleUI ui, WalletPanel walletPanel, WalletPage walletPage, LoginPanel loginPanel, TransitionPanel transitionPanel, SearchPage searchPage, CollectionInfoPage collectionInfoPage, NftInfoPage nftInfoPage, TokenInfoPage tokenInfoPage, SearchViewAllPage searchViewAllPage) + public void Setup(MonoBehaviour testMonobehaviour, SequenceSampleUI ui, WalletPanel walletPanel, WalletPage walletPage, LoginPanel loginPanel, TransitionPanel transitionPanel, SearchPage searchPage, CollectionInfoPage collectionInfoPage, NftInfoPage nftInfoPage, TokenInfoPage tokenInfoPage, SearchViewAllPage searchViewAllPage, WalletDropdown walletDropdown) { _testMonobehaviour = testMonobehaviour; _ui = ui; @@ -52,6 +53,7 @@ public void Setup(MonoBehaviour testMonobehaviour, SequenceSampleUI ui, WalletPa _nftInfoPage = nftInfoPage; _tokenInfoPage = tokenInfoPage; _searchViewAllPage = searchViewAllPage; + _walletDropdown = walletDropdown; } public IEnumerator NavigateToWalletPageTest() @@ -117,6 +119,16 @@ private void AssertWeAreOnWalletPage() Assert.IsTrue(_walletPage.gameObject.activeInHierarchy); Assert.IsFalse(_loginPanel.gameObject.activeInHierarchy); Assert.IsFalse(_transitionPanel.gameObject.activeInHierarchy); + Assert.IsFalse(_nftInfoPage.gameObject.activeInHierarchy); + } + + private void AssertWeAreOnNftInfoPage() + { + Assert.IsTrue(_walletPanel.gameObject.activeInHierarchy); + Assert.IsFalse(_walletPage.gameObject.activeInHierarchy); + Assert.IsFalse(_loginPanel.gameObject.activeInHierarchy); + Assert.IsFalse(_transitionPanel.gameObject.activeInHierarchy); + Assert.IsTrue(_nftInfoPage.gameObject.activeInHierarchy); } private IEnumerator AssertWalletPageIsAsExpected(bool isIntegrationTest = false) @@ -332,7 +344,7 @@ private IEnumerator TestInfoPages() where T : WalletUIElement yield return _testMonobehaviour.StartCoroutine(TestInfoPage(item)); // Wait for tokens to load again - if (_transitionPanel.TokenFetcher is MockTokenContentFetcher mockTokenFetcher) + if (_walletPage.GetTokenFetcher() is MockTokenContentFetcher mockTokenFetcher) { yield return new WaitForSeconds(RandomNumberOfTokensToFetch * (float)mockTokenFetcher.DelayInMilliseconds / 1000); } @@ -515,6 +527,60 @@ public IEnumerator TestSearchViewAllPage() yield return _testMonobehaviour.StartCoroutine(searchTests.NavigateToViewAllCollectionsPageTest()); yield return _testMonobehaviour.StartCoroutine(searchTests.ToggleViewAllPageTest()); } + + public IEnumerator TestWalletDropdown() + { + AssertWeAreOnWalletPage(); + Assert.IsFalse(_walletDropdown.gameObject.activeInHierarchy); + + Transform topBar = _walletPanel.transform.FindAmongDecendants("TopBar"); + Assert.IsNotNull(topBar); + TestExtensions.AssertTextWithNameHasText(topBar, "WalletAddressText", UITestHarness.TestAddress.CondenseForUI()); + + TestExtensions.ClickButtonWithName(topBar, "WalletDropdown"); + yield return new WaitForSeconds(UITestHarness.WaitForAnimationTime); // Wait for next page to animate in + + AssertWeAreOnWalletPage(); + Assert.IsTrue(_walletDropdown.gameObject.activeInHierarchy); + + TestExtensions.AssertTextWithNameHasText(_walletDropdown.transform, "WalletAddressText", UITestHarness.TestAddress.CondenseForUI()); + + Transform copyAddressIconTransform = _walletDropdown.transform.FindAmongDecendants("CopyAddressIcon"); + Assert.IsNotNull(copyAddressIconTransform); + Image copyAddressIcon = copyAddressIconTransform.GetComponent(); + Assert.IsNotNull(copyAddressIcon); + Sprite copyAddressIconSprite = copyAddressIcon.sprite; + + TestExtensions.ClickButtonWithName(_walletDropdown.transform, "AddressLayoutGroup"); + yield return new WaitForEndOfFrame(); // Allow UI a moment to update + Assert.AreNotEqual(copyAddressIconSprite, copyAddressIcon.sprite); + + yield return new WaitForSeconds(UITestHarness.WaitForAnimationTime); // Wait for next page to animate in + Assert.AreEqual(copyAddressIconSprite, copyAddressIcon.sprite); + + TestExtensions.ClickButtonWithName(_walletDropdown.transform, "CloseDropdownButton"); + yield return new WaitForSeconds(UITestHarness.WaitForAnimationTime); // Wait for next page to animate in + + AssertWeAreOnWalletPage(); + Assert.IsFalse(_walletDropdown.gameObject.activeInHierarchy); + + TestExtensions.ClickButtonWithName(topBar, "WalletDropdown"); + yield return new WaitForSeconds(UITestHarness.WaitForAnimationTime); // Wait for next page to animate in + AssertWeAreOnWalletPage(); + Assert.IsTrue(_walletDropdown.gameObject.activeInHierarchy); + + TestExtensions.ClickButtonWithName(_walletPage.transform, "NFT(Clone)"); + yield return new WaitForSeconds(UITestHarness.WaitForAnimationTime); // Wait for next page to animate in + + AssertWeAreOnNftInfoPage(); + Assert.IsFalse(_walletDropdown.gameObject.activeInHierarchy); + + yield return _testMonobehaviour.StartCoroutine(HitUIBackButton()); + AssertWeAreOnWalletPage(); + Assert.IsFalse(_walletDropdown.gameObject.activeInHierarchy); + } + + public IEnumerator EndToEndTestFetchWalletContent() { diff --git a/Assets/SequenceExamples/Scripts/Tweening/ScaleVertically.cs b/Assets/SequenceExamples/Scripts/Tweening/ScaleVertically.cs new file mode 100644 index 00000000..77886d68 --- /dev/null +++ b/Assets/SequenceExamples/Scripts/Tweening/ScaleVertically.cs @@ -0,0 +1,52 @@ +using System.Collections; +using UnityEngine; + +namespace Sequence.Demo.Tweening +{ + public class ScaleVertically : MonoBehaviour, ITween + { + private RectTransform _transform; + + public void Initialize(RectTransform rectTransform) + { + this._transform = rectTransform; + Vector3 startingScale = _transform.localScale; + _transform.localScale = new Vector3(startingScale.x, 0, 0); + } + + public void AnimateIn(float durationInSeconds) + { + ScaleOverTime(1, durationInSeconds); + } + + public void AnimateOut(float durationInSeconds) + { + ScaleOverTime(0, durationInSeconds); + } + + private void ScaleOverTime(float target, float durationInSeconds) + { + Vector3 startingScale = _transform.localScale; + Vector3 targetScale = new Vector3(startingScale.x, target, 1); + + StartCoroutine(DoScale(startingScale, targetScale, durationInSeconds)); + } + + private IEnumerator DoScale(Vector3 startingScale, Vector3 targetScale, float durationInSeconds) + { + float startTime = Time.time; + float deltaTime = Time.time - startTime; + + while (deltaTime < durationInSeconds) + { + float progress = deltaTime / durationInSeconds; + Vector3 newScale = Vector3.Lerp(startingScale, targetScale, progress); + _transform.localScale = newScale; + deltaTime = Time.time - startTime; + yield return null; + } + + _transform.localScale = targetScale; + } + } +} \ No newline at end of file diff --git a/Assets/SequenceExamples/Scripts/Tweening/ScaleVertically.cs.meta b/Assets/SequenceExamples/Scripts/Tweening/ScaleVertically.cs.meta new file mode 100644 index 00000000..ec6e06e9 --- /dev/null +++ b/Assets/SequenceExamples/Scripts/Tweening/ScaleVertically.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: cc6197f391514c09a5c99ee1b949a526 +timeCreated: 1697469935 \ No newline at end of file diff --git a/Assets/SequenceExamples/Scripts/UI/ColorSchemeManager.cs b/Assets/SequenceExamples/Scripts/UI/ColorSchemeManager.cs index de2f5c2d..cd9e6303 100644 --- a/Assets/SequenceExamples/Scripts/UI/ColorSchemeManager.cs +++ b/Assets/SequenceExamples/Scripts/UI/ColorSchemeManager.cs @@ -18,7 +18,7 @@ public void ApplyColorScheme() for (int i = 0; i < prefabs; i++) { GameObject prefabInstance = PrefabUtility.InstantiatePrefab(_uiElementPrefabs[i]) as GameObject; - ApplyColorSchemeToChildren(prefabInstance.transform); + ApplyColorSchemeToTransformAndChildren(prefabInstance.transform); PrefabUtility.ApplyPrefabInstance(prefabInstance, InteractionMode.UserAction); DestroyImmediate(prefabInstance); } @@ -31,14 +31,21 @@ private void ApplyColorSchemeToChildren(Transform parent) { Transform child = parent.GetChild(i); - SetButtonColor(child); + ApplyColorSchemeToTransformAndChildren(child); + } + } - SetTextColor(child); + private void ApplyColorSchemeToTransformAndChildren(Transform obj) + { + ApplyColorSchemeToTransform(obj); + ApplyColorSchemeToChildren(obj); + } - SetBackgroundColor(child); - - ApplyColorSchemeToChildren(child); - } + private void ApplyColorSchemeToTransform(Transform obj) + { + SetButtonColor(obj); + SetTextColor(obj); + SetBackgroundColor(obj); } private void SetButtonColor(Transform t) @@ -84,6 +91,16 @@ private void SetBackgroundColor(Transform t) image.color = _colorScheme.backgroundColor; } } + + WalletDropdown dropdown = t.GetComponent(); + if (dropdown != null) + { + Image image = dropdown.GetComponent(); + if (image != null) + { + image.color = _colorScheme.backgroundColor; + } + } } } } diff --git a/Assets/SequenceExamples/Scripts/UI/Helpers/AddressCondenser.cs b/Assets/SequenceExamples/Scripts/UI/Helpers/AddressCondenser.cs new file mode 100644 index 00000000..0e411c42 --- /dev/null +++ b/Assets/SequenceExamples/Scripts/UI/Helpers/AddressCondenser.cs @@ -0,0 +1,10 @@ +namespace Sequence.Demo +{ + public static class AddressCondenser + { + public static string CondenseForUI(this Address address) + { + return address.ToString().Substring(0, 6) + "..." + address.ToString().Substring(38, 4); + } + } +} \ No newline at end of file diff --git a/Assets/SequenceExamples/Scripts/UI/Helpers/AddressCondenser.cs.meta b/Assets/SequenceExamples/Scripts/UI/Helpers/AddressCondenser.cs.meta new file mode 100644 index 00000000..84e9a818 --- /dev/null +++ b/Assets/SequenceExamples/Scripts/UI/Helpers/AddressCondenser.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: be3989b354704773b269ed060587257d +timeCreated: 1697477514 \ No newline at end of file diff --git a/Assets/SequenceExamples/Scripts/UI/TransitionPanel.cs b/Assets/SequenceExamples/Scripts/UI/TransitionPanel.cs index bdb7397d..5fcb2731 100644 --- a/Assets/SequenceExamples/Scripts/UI/TransitionPanel.cs +++ b/Assets/SequenceExamples/Scripts/UI/TransitionPanel.cs @@ -19,7 +19,8 @@ protected override void Awake() public void OpenWalletPanel() { - _ui.OpenWalletPanelWithDelay(_closeAnimationDurationInSeconds, TokenFetcher, NftFetcher); + _ui.OpenWalletPanelWithDelay(_closeAnimationDurationInSeconds, TokenFetcher, NftFetcher, + new Address("0xc683a014955b75F5ECF991d4502427c8fa1Aa249")); } } } \ No newline at end of file diff --git a/Assets/SequenceExamples/Scripts/UI/UIPage.cs b/Assets/SequenceExamples/Scripts/UI/UIPage.cs index 0f4c998a..500cf853 100644 --- a/Assets/SequenceExamples/Scripts/UI/UIPage.cs +++ b/Assets/SequenceExamples/Scripts/UI/UIPage.cs @@ -23,6 +23,7 @@ public enum AnimationType { ScaleIn, FromBottom, + ScaleInVertically, } protected virtual void Awake() @@ -67,6 +68,12 @@ private void AddAppropriateAnimator() case AnimationType.FromBottom: _animator = _gameObject.AddComponent(); break; + case AnimationType.ScaleInVertically: + _animator = _gameObject.AddComponent(); + break; + default: + throw new NotImplementedException( + $"This animation type {_animation} has not been added to {GetType().Name}'s implementation"); } } diff --git a/Assets/SequenceExamples/Scripts/UI/UIPanel.cs b/Assets/SequenceExamples/Scripts/UI/UIPanel.cs index ff893c8e..18e1b468 100644 --- a/Assets/SequenceExamples/Scripts/UI/UIPanel.cs +++ b/Assets/SequenceExamples/Scripts/UI/UIPanel.cs @@ -9,10 +9,10 @@ public abstract class UIPanel : UIPage { public UIPage InitialPage; - private Stack _pageStack = new Stack(); + protected Stack _pageStack = new Stack(); protected UIPage _page; - private struct PageWithArgs + protected struct PageWithArgs { public UIPage page; public object[] openArgs; @@ -62,7 +62,7 @@ private IEnumerator DoOpenWithDelay(float delayInSeconds, params object[] args) Open(args); } - public IEnumerator SetUIPage(UIPage page, params object[] openArgs) + public virtual IEnumerator SetUIPage(UIPage page, params object[] openArgs) { if (_page != null) { @@ -74,6 +74,13 @@ public IEnumerator SetUIPage(UIPage page, params object[] openArgs) _page.Open(openArgs.AppendObject(this)); } + protected void OpenPageOverlaid(UIPage page, params object[] openArgs) + { + _page = page; + _pageStack.Push(new PageWithArgs(page, openArgs)); + page.Open(openArgs.AppendObject(this)); + } + public virtual void Back(params object[] injectAdditionalParams) { if (_pageStack.Count <= 1) diff --git a/Assets/SequenceExamples/Scripts/UI/WalletDropdown.cs b/Assets/SequenceExamples/Scripts/UI/WalletDropdown.cs new file mode 100644 index 00000000..ed79f15c --- /dev/null +++ b/Assets/SequenceExamples/Scripts/UI/WalletDropdown.cs @@ -0,0 +1,49 @@ +using System; +using Sequence.Utils; +using TMPro; +using UnityEngine; +using UnityEngine.UI; + +namespace Sequence.Demo +{ + public class WalletDropdown : UIPage + { + [SerializeField] private TextMeshProUGUI _walletAddressText; + [SerializeField] private Image _copyAddressIcon; + [SerializeField] private Sprite _checkMarkIcon; + [SerializeField] private Sprite _copyIcon; + [SerializeField] private float _timeBeforeResettingCopyIcon = 1f; + + private Address _walletAddress; + + public override void Open(params object[] args) + { + base.Open(args); + _walletAddress = args.GetObjectOfTypeIfExists
(); + if (_walletAddress == default) + { + throw new SystemException( + $"Invalid use. {GetType().Name} must be opened with a {typeof(Address)} as an argument"); + } + + _walletAddressText.text = _walletAddress.CondenseForUI(); + ResetCopyIcon(); + } + + /// + /// Copy _walletAddress to clipboard and temporarily change _copyAddressIcon's sprite + /// + public void CopyAddress() + { + GUIUtility.systemCopyBuffer = _walletAddress.ToString(); + + _copyAddressIcon.sprite = _checkMarkIcon; + Invoke(nameof(ResetCopyIcon), _timeBeforeResettingCopyIcon); + } + + private void ResetCopyIcon() + { + _copyAddressIcon.sprite = _copyIcon; + } + } +} \ No newline at end of file diff --git a/Assets/SequenceExamples/Scripts/UI/WalletDropdown.cs.meta b/Assets/SequenceExamples/Scripts/UI/WalletDropdown.cs.meta new file mode 100644 index 00000000..2468299b --- /dev/null +++ b/Assets/SequenceExamples/Scripts/UI/WalletDropdown.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9e2cac62017640d0950b94b284c3c26e +timeCreated: 1697468207 \ No newline at end of file diff --git a/Assets/SequenceExamples/Scripts/UI/WalletPanel.cs b/Assets/SequenceExamples/Scripts/UI/WalletPanel.cs index 2e87c47c..2c4b29f3 100644 --- a/Assets/SequenceExamples/Scripts/UI/WalletPanel.cs +++ b/Assets/SequenceExamples/Scripts/UI/WalletPanel.cs @@ -1,7 +1,9 @@ +using System; using System.Collections; using System.Collections.Generic; using Sequence.Demo.ScriptableObjects; using Sequence.Utils; +using TMPro; using UnityEngine; namespace Sequence.Demo @@ -10,17 +12,20 @@ public class WalletPanel : UIPanel { [SerializeField] private GameObject _searchButton; [SerializeField] private GameObject _backButton; + [SerializeField] private TextMeshProUGUI _walletAddressText; private WalletPage _walletPage; private TransitionPanel _transitionPanel; private TokenInfoPage _tokenInfoPage; private NftInfoPage _nftInfoPage; private SearchPage _searchPage; + private WalletDropdown _walletDropdown; private CollectionNftMapper _collectionNftMapper; private INftContentFetcher _nftContentFetcher; private CollectionInfoPage _collectionInfoPage; private ITokenContentFetcher _tokenContentFetcher; private List _fetchedTokenElements; + private Address _walletAddress; public enum TopBarMode { @@ -37,6 +42,7 @@ protected override void Awake() _nftInfoPage = GetComponentInChildren(); _collectionInfoPage = GetComponentInChildren(); _searchPage = GetComponentInChildren(); + _walletDropdown = GetComponentInChildren(); _collectionNftMapper = new CollectionNftMapper(); } @@ -44,6 +50,14 @@ public override void Open(params object[] args) { base.Open(args); _fetchedTokenElements = new List(); + _walletAddress = args.GetObjectOfTypeIfExists
(); + if (_walletAddress == default) + { + throw new SystemException( + $"Invalid use. {GetType().Name} must be opened with a {typeof(Address)} as an argument"); + } + + _walletAddressText.text = _walletAddress.CondenseForUI(); } public override void Close() @@ -165,5 +179,22 @@ public void OpenSearchPage() StartCoroutine(SetUIPage(_searchPage, searchableCollections, _fetchedTokenElements.ToArray())); SetTopBarMode(TopBarMode.Back); } + + public void OpenWalletDropdown() + { + OpenPageOverlaid(_walletDropdown, _walletAddress); + } + + public override IEnumerator SetUIPage(UIPage page, params object[] openArgs) + { + if (_page is WalletDropdown) + { + _page.Close(); + _pageStack.Pop(); + yield return new WaitUntil(() => !_page.isActiveAndEnabled); + _page = _pageStack.Peek().page; + } + yield return base.SetUIPage(page, openArgs); + } } } \ No newline at end of file diff --git a/Assets/SequenceSDK/Indexer/Indexer.cs b/Assets/SequenceSDK/Indexer/Indexer.cs index f847df6c..a8e6d105 100644 --- a/Assets/SequenceSDK/Indexer/Indexer.cs +++ b/Assets/SequenceSDK/Indexer/Indexer.cs @@ -283,7 +283,7 @@ private static async Task HttpPost(BigInteger chainID, string endPoint, } else { - Debug.LogError("File load exception: " + e.Message + "\nCurl-equivalent request: " + curlRequest); + Debug.LogWarning("File load exception: " + e.Message + "\nCurl-equivalent request: " + curlRequest); } } catch (Exception e) {