From a3aef210d23103e840160b29bfae8bbbfeff4383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raigo=20K=C3=B5vask?= Date: Wed, 7 Feb 2024 15:57:42 +0200 Subject: [PATCH 1/3] feat: update wizardAvatarCreator to show merge window before logging into RPM account --- .../Scripts/Managers/AuthManager.cs | 4 +- .../Scripts/WebRequests/AuthAPIRequests.cs | 15 +- .../Selections/LoginWithEmailSelection.prefab | 687 +++++++++++++++++- .../Scenes/AvatarCreatorWizard.unity | 196 ++--- .../AvatarCreatorSelection.cs | 2 +- .../LoginWithEmailSelection.cs | 76 +- 6 files changed, 865 insertions(+), 115 deletions(-) diff --git a/Runtime/AvatarCreator/Scripts/Managers/AuthManager.cs b/Runtime/AvatarCreator/Scripts/Managers/AuthManager.cs index 508f36fc..5bff4a6c 100644 --- a/Runtime/AvatarCreator/Scripts/Managers/AuthManager.cs +++ b/Runtime/AvatarCreator/Scripts/Managers/AuthManager.cs @@ -45,11 +45,11 @@ public static async void SendEmailCode(string email) await AuthAPIRequests.SendCodeToEmail(email, userSession.Id); } - public static async Task LoginWithCode(string otp) + public static async Task LoginWithCode(string otp, string userIdToMerge = null) { try { - userSession = await AuthAPIRequests.LoginWithCode(otp); + userSession = await AuthAPIRequests.LoginWithCode(otp, userIdToMerge); IsSignedIn = true; OnSignedIn?.Invoke(userSession); return true; diff --git a/Runtime/AvatarCreator/Scripts/WebRequests/AuthAPIRequests.cs b/Runtime/AvatarCreator/Scripts/WebRequests/AuthAPIRequests.cs index 5b7b8bd6..eacb169f 100644 --- a/Runtime/AvatarCreator/Scripts/WebRequests/AuthAPIRequests.cs +++ b/Runtime/AvatarCreator/Scripts/WebRequests/AuthAPIRequests.cs @@ -17,7 +17,7 @@ public AuthAPIRequests(string domain) { this.domain = domain; webRequestDispatcher = new WebRequestDispatcher(); - + rpmAuthBaseUrl = string.Format(Env.RPM_SUBDOMAIN_BASE_URL, domain); } @@ -49,14 +49,19 @@ public async Task SendCodeToEmail(string email, string userId = "") response.ThrowIfError(); } - public async Task LoginWithCode(string code) + public async Task LoginWithCode(string code, string userIdToMerge = null) { - var payload = AuthDataConverter.CreatePayload(new Dictionary + var body = new Dictionary { { AuthConstants.AUTH_TYPE_CODE, code } - }); + }; + if (userIdToMerge != null) + { + body.Add(AuthConstants.USER_ID, userIdToMerge); + } + var payload = AuthDataConverter.CreatePayload(body); - var response = await webRequestDispatcher.SendRequest( $"{rpmAuthBaseUrl}/auth/login", HttpMethod.POST, headers, payload); + var response = await webRequestDispatcher.SendRequest($"{rpmAuthBaseUrl}/auth/login", HttpMethod.POST, headers, payload); response.ThrowIfError(); var data = AuthDataConverter.ParseResponse(response.Text); diff --git a/Samples~/AvatarCreatorSamples/AvatarCreatorWizard/Prefabs/Selections/LoginWithEmailSelection.prefab b/Samples~/AvatarCreatorSamples/AvatarCreatorWizard/Prefabs/Selections/LoginWithEmailSelection.prefab index 12622047..c3f7dddb 100644 --- a/Samples~/AvatarCreatorSamples/AvatarCreatorWizard/Prefabs/Selections/LoginWithEmailSelection.prefab +++ b/Samples~/AvatarCreatorSamples/AvatarCreatorWizard/Prefabs/Selections/LoginWithEmailSelection.prefab @@ -457,7 +457,7 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 430256381036330111} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + 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_Children: @@ -644,7 +644,7 @@ GameObject: - component: {fileID: 430256381106288229} - component: {fileID: 430256381106288230} m_Layer: 5 - m_Name: Panel + m_Name: LoginPanel m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -1204,7 +1204,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &430256381474151111 RectTransform: m_ObjectHideFlags: 0 @@ -1212,11 +1212,12 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 430256381474151112} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + 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_Children: - {fileID: 430256381106288231} + - {fileID: 1009621498801351471} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -1279,10 +1280,14 @@ MonoBehaviour: haveCodeButton: {fileID: 430256381372492468} changeEmailButton: {fileID: 430256381621279887} loginButton: {fileID: 430256382116053737} + transferAssets: {fileID: 323673023121411019} + dontTransferAssets: {fileID: 245218900210758059} emailField: {fileID: 430256381051158051} codeField: {fileID: 430256380604179355} emailPanel: {fileID: 430256382019053932} codePanel: {fileID: 430256381036330111} + loginPanel: {fileID: 430256381106288232} + transferAssetsPanel: {fileID: 8229489613473230458} --- !u!1 &430256381517162069 GameObject: m_ObjectHideFlags: 0 @@ -2153,3 +2158,677 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 60} m_SizeDelta: {x: 600, y: 120} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &3266363421062938015 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9080674993197883699} + - component: {fileID: 8371743089474771235} + - component: {fileID: 5792899494880967904} + - component: {fileID: 323673023121411019} + m_Layer: 5 + m_Name: Transfer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &9080674993197883699 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3266363421062938015} + 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_Children: + - {fileID: 655561152070475423} + m_Father: {fileID: 3638856207583583203} + m_RootOrder: 0 + 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: 148.43, y: -60} + m_SizeDelta: {x: 300, y: 60} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8371743089474771235 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3266363421062938015} + m_CullTransparentMesh: 1 +--- !u!114 &5792899494880967904 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3266363421062938015} + 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: 0.043137256, g: 0.80392164, b: 0.7607844, a: 1} + 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: f3be935944ee4754d8d71cdf47dea555, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 3 +--- !u!114 &323673023121411019 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3266363421062938015} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.7843138, g: 0.7843138, b: 0.7843138, a: 1} + m_PressedColor: {r: 0.6226415, g: 0.61383057, b: 0.61383057, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 5792899494880967904} + m_OnClick: + m_PersistentCalls: + m_Calls: [] +--- !u!1 &4182875173132232979 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 655561152070475423} + - component: {fileID: 2526595364734443545} + - component: {fileID: 5140357168319257039} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &655561152070475423 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4182875173132232979} + 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_Children: [] + m_Father: {fileID: 9080674993197883699} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &2526595364734443545 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4182875173132232979} + m_CullTransparentMesh: 1 +--- !u!114 &5140357168319257039 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4182875173132232979} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: 650a725a2bb22784e89b330b54529457, type: 3} + m_FontSize: 18 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Transfer now +--- !u!1 &4455449619062470041 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7260394725293143295} + - component: {fileID: 614568813514911072} + - component: {fileID: 2302646495654673284} + - component: {fileID: 245218900210758059} + m_Layer: 5 + m_Name: DontTransfer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7260394725293143295 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4455449619062470041} + 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_Children: + - {fileID: 3784670677464804799} + m_Father: {fileID: 3638856207583583203} + 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: -150, y: -60.000015} + m_SizeDelta: {x: 300, y: 60} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &614568813514911072 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4455449619062470041} + m_CullTransparentMesh: 1 +--- !u!114 &2302646495654673284 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4455449619062470041} + 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} + 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: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + 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!114 &245218900210758059 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4455449619062470041} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 2302646495654673284} + m_OnClick: + m_PersistentCalls: + m_Calls: [] +--- !u!1 &5040980129649584897 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3638856207583583203} + m_Layer: 5 + m_Name: Buttons + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3638856207583583203 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5040980129649584897} + 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_Children: + - {fileID: 9080674993197883699} + - {fileID: 7260394725293143295} + m_Father: {fileID: 1009621498801351471} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 247.7674} + m_Pivot: {x: 0.5, y: 0} +--- !u!1 &6064447710547960981 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5332798995335967626} + - component: {fileID: 1316164017810188834} + - component: {fileID: 3332098177369823437} + m_Layer: 5 + m_Name: Heading + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5332798995335967626 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6064447710547960981} + 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_Children: [] + m_Father: {fileID: 1009621498801351471} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 0, y: -50} + m_SizeDelta: {x: 600, y: 70} + m_Pivot: {x: 0.5, y: 1} +--- !u!222 &1316164017810188834 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6064447710547960981} + m_CullTransparentMesh: 1 +--- !u!114 &3332098177369823437 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6064447710547960981} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + 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 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: 12aac7490fc6e5b41a811cc24c825f5e, type: 3} + m_FontSize: 34 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 3 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Transfer your avatars and assets +--- !u!1 &6320060771797866023 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3203658976854345518} + - component: {fileID: 6756347145267166687} + - component: {fileID: 1539644893763814189} + m_Layer: 5 + m_Name: Description + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3203658976854345518 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6320060771797866023} + 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_Children: [] + m_Father: {fileID: 1009621498801351471} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 0, y: -120} + m_SizeDelta: {x: 600, y: 120.3172} + m_Pivot: {x: 0.5, y: 1} +--- !u!222 &6756347145267166687 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6320060771797866023} + m_CullTransparentMesh: 1 +--- !u!114 &1539644893763814189 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6320060771797866023} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + 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 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: 12aac7490fc6e5b41a811cc24c825f5e, type: 3} + m_FontSize: 24 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 0 + m_MaxSize: 119 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Your created avatars and unlocked assets will be transferred to your Ready + Player Me account. You will not lose any of your avatars or assets +--- !u!1 &7290769683141252124 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3784670677464804799} + - component: {fileID: 5744428915524796662} + - component: {fileID: 5298029491326726362} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3784670677464804799 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7290769683141252124} + 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_Children: [] + m_Father: {fileID: 7260394725293143295} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &5744428915524796662 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7290769683141252124} + m_CullTransparentMesh: 1 +--- !u!114 &5298029491326726362 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7290769683141252124} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.043137256, g: 0.80392164, b: 0.7607844, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: 12aac7490fc6e5b41a811cc24c825f5e, type: 3} + m_FontSize: 18 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Don't transfer +--- !u!1 &8229489613473230458 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1009621498801351471} + - component: {fileID: 3738101718397074125} + - component: {fileID: 4207850916952678893} + m_Layer: 5 + m_Name: Transfer assets + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &1009621498801351471 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8229489613473230458} + 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_Children: + - {fileID: 5332798995335967626} + - {fileID: 3203658976854345518} + - {fileID: 3638856207583583203} + m_Father: {fileID: 430256381474151111} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 40, y: -132.28009} + m_SizeDelta: {x: 700, y: 420.4279} + m_Pivot: {x: 0, y: 1} +--- !u!222 &3738101718397074125 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8229489613473230458} + m_CullTransparentMesh: 1 +--- !u!114 &4207850916952678893 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8229489613473230458} + 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: 0.13207549, g: 0.13207549, b: 0.13207549, a: 0.7607843} + 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: f3be935944ee4754d8d71cdf47dea555, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 3 diff --git a/Samples~/AvatarCreatorSamples/AvatarCreatorWizard/Scenes/AvatarCreatorWizard.unity b/Samples~/AvatarCreatorSamples/AvatarCreatorWizard/Scenes/AvatarCreatorWizard.unity index 656529c1..61cf4028 100644 --- a/Samples~/AvatarCreatorSamples/AvatarCreatorWizard/Scenes/AvatarCreatorWizard.unity +++ b/Samples~/AvatarCreatorSamples/AvatarCreatorWizard/Scenes/AvatarCreatorWizard.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.4445709, g: 0.494076, b: 0.57335085, a: 1} + m_IndirectSpecularColor: {r: 0.44457042, g: 0.49407542, b: 0.57334924, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -16457,6 +16457,11 @@ PrefabInstance: propertyPath: m_Name value: AvatarCreatorSelection objectReference: {fileID: 0} + - target: {fileID: 57378948363611731, guid: 94e6adc5c795ff348bce129db0368b1f, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} - target: {fileID: 57378948363611732, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_Pivot.x @@ -16580,462 +16585,462 @@ PrefabInstance: - target: {fileID: 426946072540919372, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 426946072540919372, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 426946072540919372, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 426946072540919372, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 426946072540919372, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 426946072540919372, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -370 objectReference: {fileID: 0} - target: {fileID: 852090692576577478, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 852090692576577478, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 852090692576577478, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 852090692576577478, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 852090692576577478, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 852090692576577478, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -50 objectReference: {fileID: 0} - target: {fileID: 2053456665730896000, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 2053456665730896000, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 2053456665730896000, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 2053456665730896000, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 2053456665730896000, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 2053456665730896000, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -610 objectReference: {fileID: 0} - target: {fileID: 2730285427173911291, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 17 objectReference: {fileID: 0} - target: {fileID: 2730285427173911291, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 660 objectReference: {fileID: 0} - target: {fileID: 3170710361632400798, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 3170710361632400798, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 3170710361632400798, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 3170710361632400798, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 3170710361632400798, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 3170710361632400798, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -450 objectReference: {fileID: 0} - target: {fileID: 3851812259396406019, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 3851812259396406019, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 3851812259396406019, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 3851812259396406019, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 3851812259396406019, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 3851812259396406019, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -290 objectReference: {fileID: 0} - target: {fileID: 5227215079588291672, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 5227215079588291672, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 5227215079588291672, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 5227215079588291672, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 5227215079588291672, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 5227215079588291672, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -210 objectReference: {fileID: 0} - target: {fileID: 5230037809109001959, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 17 objectReference: {fileID: 0} - target: {fileID: 5230037809109001959, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 500 objectReference: {fileID: 0} - target: {fileID: 5251783354751334297, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 5251783354751334297, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 5251783354751334297, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 5251783354751334297, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 5251783354751334297, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 5251783354751334297, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -130 objectReference: {fileID: 0} - target: {fileID: 5989099976694151738, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMax.x - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 5989099976694151738, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 6510103915601191157, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 6510103915601191157, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 6510103915601191157, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 6510103915601191157, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 6510103915601191157, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 6510103915601191157, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -530 objectReference: {fileID: 0} - target: {fileID: 6852249728987564328, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 6852249728987564328, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 6852249728987564328, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 6852249728987564328, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 6852249728987564328, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 6852249728987564328, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -290 objectReference: {fileID: 0} - target: {fileID: 7195927354887210847, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 7195927354887210847, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 7195927354887210847, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 7195927354887210847, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 7195927354887210847, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 7195927354887210847, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -130 objectReference: {fileID: 0} - target: {fileID: 7740458256474902214, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 7740458256474902214, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 7740458256474902214, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 7740458256474902214, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 7740458256474902214, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 7740458256474902214, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -210 objectReference: {fileID: 0} - target: {fileID: 8381926575841560858, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 8381926575841560858, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 8381926575841560858, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 8381926575841560858, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 8381926575841560858, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 8381926575841560858, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -370 objectReference: {fileID: 0} - target: {fileID: 8424578161433254004, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMax.x - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 8424578161433254004, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 8911236589622506822, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 8911236589622506822, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 8911236589622506822, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 8911236589622506822, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 8911236589622506822, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 8911236589622506822, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -450 objectReference: {fileID: 0} - target: {fileID: 9164789101006033984, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 9164789101006033984, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 9164789101006033984, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 9164789101006033984, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 60 objectReference: {fileID: 0} - target: {fileID: 9164789101006033984, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 9164789101006033984, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -50 objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 94e6adc5c795ff348bce129db0368b1f, type: 3} @@ -17156,6 +17161,11 @@ PrefabInstance: propertyPath: m_Name value: LoginWithEmailSelection objectReference: {fileID: 0} + - target: {fileID: 8229489613473230458, guid: 50689676eb279f848a3a412d1cf2e36f, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 50689676eb279f848a3a412d1cf2e36f, type: 3} --- !u!1001 &1983149063479050778 diff --git a/Samples~/AvatarCreatorSamples/AvatarCreatorWizard/Scripts/UI/SelectionScreens/AvatarCreatorSelection.cs b/Samples~/AvatarCreatorSamples/AvatarCreatorWizard/Scripts/UI/SelectionScreens/AvatarCreatorSelection.cs index 4599cdde..6aa4c06e 100644 --- a/Samples~/AvatarCreatorSamples/AvatarCreatorWizard/Scripts/UI/SelectionScreens/AvatarCreatorSelection.cs +++ b/Samples~/AvatarCreatorSamples/AvatarCreatorWizard/Scripts/UI/SelectionScreens/AvatarCreatorSelection.cs @@ -65,7 +65,7 @@ private async void Setup() avatarManager = new AvatarManager( inCreatorConfig, - ctxSource.Token, + ctxSource.Token, AvatarCreatorData.AvatarProperties.Gender); avatarManager.OnError += OnErrorCallback; diff --git a/Samples~/AvatarCreatorSamples/AvatarCreatorWizard/Scripts/UI/SelectionScreens/LoginWithEmailSelection.cs b/Samples~/AvatarCreatorSamples/AvatarCreatorWizard/Scripts/UI/SelectionScreens/LoginWithEmailSelection.cs index a65fe6b0..f0105815 100644 --- a/Samples~/AvatarCreatorSamples/AvatarCreatorWizard/Scripts/UI/SelectionScreens/LoginWithEmailSelection.cs +++ b/Samples~/AvatarCreatorSamples/AvatarCreatorWizard/Scripts/UI/SelectionScreens/LoginWithEmailSelection.cs @@ -9,11 +9,19 @@ namespace ReadyPlayerMe.Samples.AvatarCreatorWizard public class LoginWithEmailSelection : State { private const string TAG = nameof(LoginWithEmailSelection); + private enum LoginWithEmailState + { + EnterEmail, + TransferAssetsPrompt, + EnterCode + } [SerializeField] private Button sendActivationCodeButton; [SerializeField] private Button haveCodeButton; [SerializeField] private Button changeEmailButton; [SerializeField] private Button loginButton; + [SerializeField] private Button transferAssets; + [SerializeField] private Button dontTransferAssets; [SerializeField] private InputField emailField; [SerializeField] private InputField codeField; @@ -21,41 +29,86 @@ public class LoginWithEmailSelection : State [SerializeField] private GameObject emailPanel; [SerializeField] private GameObject codePanel; + [SerializeField] private GameObject loginPanel; + [SerializeField] private GameObject transferAssetsPanel; + public override StateType StateType => StateType.LoginWithCodeFromEmail; public override StateType NextState => StateType.BodyTypeSelection; + private bool transferAvatarsAndAssets; public override void ActivateState() { sendActivationCodeButton.onClick.AddListener(OnSendActivationCode); haveCodeButton.onClick.AddListener(OnHaveCodeButton); changeEmailButton.onClick.AddListener(OnChangeEmail); + transferAssets.onClick.AddListener(OnTransferAssets); + dontTransferAssets.onClick.AddListener(OnDontTransferAssets); loginButton.onClick.AddListener(OnLogin); + SetState(LoginWithEmailState.EnterEmail); } + public override void DeactivateState() { sendActivationCodeButton.onClick.RemoveListener(OnSendActivationCode); haveCodeButton.onClick.RemoveListener(OnHaveCodeButton); changeEmailButton.onClick.RemoveListener(OnChangeEmail); + transferAssets.onClick.RemoveListener(OnTransferAssets); + dontTransferAssets.onClick.RemoveListener(OnDontTransferAssets); loginButton.onClick.RemoveListener(OnLogin); } + private void OnDontTransferAssets() + { + transferAvatarsAndAssets = false; + SetState(LoginWithEmailState.EnterCode); + } + + private void OnTransferAssets() + { + transferAvatarsAndAssets = true; + SetState(LoginWithEmailState.EnterCode); + } + private void OnSendActivationCode() { AuthManager.SendEmailCode(emailField.text); - OnHaveCodeButton(); + SetState(AuthManager.IsSignedInAnonymously ? LoginWithEmailState.TransferAssetsPrompt : LoginWithEmailState.EnterCode); + + } + + private void SetState(LoginWithEmailState loginWithEmailState) + { + switch (loginWithEmailState) + { + case LoginWithEmailState.EnterEmail: + transferAvatarsAndAssets = false; + emailPanel.SetActive(true); + codePanel.SetActive(false); + loginPanel.SetActive(true); + transferAssetsPanel.SetActive(false); + break; + case LoginWithEmailState.EnterCode: + emailPanel.SetActive(false); + codePanel.SetActive(true); + loginPanel.SetActive(true); + transferAssetsPanel.SetActive(false); + break; + case LoginWithEmailState.TransferAssetsPrompt: + loginPanel.SetActive(false); + transferAssetsPanel.SetActive(true); + break; + } } private void OnHaveCodeButton() { - emailPanel.SetActive(false); - codePanel.SetActive(true); + SetState(LoginWithEmailState.TransferAssetsPrompt); } private void OnChangeEmail() { - emailPanel.SetActive(true); - codePanel.SetActive(false); + SetState(LoginWithEmailState.EnterEmail); } private async void OnLogin() @@ -64,13 +117,16 @@ private async void OnLogin() AuthManager.OnSignInError += OnSignInError; - if (await AuthManager.LoginWithCode(codeField.text)) + var loginWithCode = transferAvatarsAndAssets ? AuthManager.LoginWithCode(codeField.text, AuthManager.UserSession.Id) : AuthManager.LoginWithCode(codeField.text); + if (!await loginWithCode) { - OnChangeEmail(); - LoadingManager.DisableLoading(); - StateMachine.SetState(StateType.AvatarSelection); - SDKLogger.Log(TAG, "Login successful"); + return; } + + OnChangeEmail(); + LoadingManager.DisableLoading(); + StateMachine.SetState(StateType.AvatarSelection); + SDKLogger.Log(TAG, "Login successful"); } private void OnSignInError(string error) From d9a13c752574595c7728607432cdfe5531102286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raigo=20K=C3=B5vask?= Date: Thu, 8 Feb 2024 11:21:33 +0200 Subject: [PATCH 2/3] feat: update cac 2.0 login element to allow merging current session to their RPM account --- .../Prefabs/Elements/LoginElement.prefab | 597 +++++++++++++++++- .../Scripts/UI/Elements/LoginElement.cs | 14 +- .../AvatarCreatorExperimental/README.md | 1 + 3 files changed, 608 insertions(+), 4 deletions(-) diff --git a/Runtime/AvatarCreator/Prefabs/Elements/LoginElement.prefab b/Runtime/AvatarCreator/Prefabs/Elements/LoginElement.prefab index 930270e3..5741d020 100644 --- a/Runtime/AvatarCreator/Prefabs/Elements/LoginElement.prefab +++ b/Runtime/AvatarCreator/Prefabs/Elements/LoginElement.prefab @@ -1,5 +1,43 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: +--- !u!1 &931433734628605246 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8188830851170153910} + m_Layer: 5 + m_Name: Merge panel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &8188830851170153910 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 931433734628605246} + 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_Children: + - {fileID: 5714860656775607079} + - {fileID: 8086738846091643257} + - {fileID: 7932834923692168419} + m_Father: {fileID: 4316720321970040649} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -340} + m_SizeDelta: {x: 0, y: 240} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1495366482489947043 GameObject: m_ObjectHideFlags: 0 @@ -580,6 +618,7 @@ RectTransform: - {fileID: 4316720323810756527} - {fileID: 4316720323840417774} - {fileID: 4316720323855853342} + - {fileID: 8188830851170153910} - {fileID: 4316720323126019440} m_Father: {fileID: 0} m_RootOrder: 0 @@ -730,7 +769,7 @@ MonoBehaviour: m_OnClick: m_PersistentCalls: m_Calls: - - m_Target: {fileID: 4316720323126019441} + - m_Target: {fileID: 931433734628605246} m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine m_MethodName: SetActive m_Mode: 6 @@ -1533,7 +1572,7 @@ RectTransform: - {fileID: 4316720322710942739} - {fileID: 1495366483075221679} m_Father: {fileID: 4316720321970040649} - m_RootOrder: 4 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} @@ -1673,7 +1712,7 @@ MonoBehaviour: m_StringArgument: m_BoolArgument: 0 m_CallState: 2 - - m_Target: {fileID: 4316720323126019441} + - m_Target: {fileID: 931433734628605246} m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine m_MethodName: SetActive m_Mode: 6 @@ -1974,6 +2013,86 @@ RectTransform: m_AnchoredPosition: {x: 0, y: -340} m_SizeDelta: {x: 0, y: 240} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &4447574852482424007 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5714860656775607079} + - component: {fileID: 7033438957676128615} + - component: {fileID: 2903701376808805665} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5714860656775607079 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4447574852482424007} + 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_Children: [] + m_Father: {fileID: 8188830851170153910} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -71.608765} + m_SizeDelta: {x: -80, y: 103.2175} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &7033438957676128615 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4447574852482424007} + m_CullTransparentMesh: 1 +--- !u!114 &2903701376808805665 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4447574852482424007} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + 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 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 24 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Your created avatars and unlocked assets will be transferred to your Ready + Player Me account. You will not lose any of your avatars or assets --- !u!1 &5196972148706071301 GameObject: m_ObjectHideFlags: 0 @@ -2053,3 +2172,475 @@ MonoBehaviour: m_VerticalOverflow: 0 m_LineSpacing: 1 m_Text: Verification Code +--- !u!1 &5258653989071909145 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6837517838208719675} + - component: {fileID: 6367301820893842414} + - component: {fileID: 1135494336878022357} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6837517838208719675 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5258653989071909145} + 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_Children: [] + m_Father: {fileID: 7932834923692168419} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &6367301820893842414 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5258653989071909145} + m_CullTransparentMesh: 1 +--- !u!114 &1135494336878022357 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5258653989071909145} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 20 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Continue +--- !u!1 &6513510087155692729 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7932834923692168419} + - component: {fileID: 3994865443608171999} + - component: {fileID: 6756690555297024533} + - component: {fileID: 5085689240096181003} + m_Layer: 5 + m_Name: Continue + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7932834923692168419 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6513510087155692729} + 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_Children: + - {fileID: 6837517838208719675} + m_Father: {fileID: 8188830851170153910} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 140, y: -170} + m_SizeDelta: {x: -360, y: 60} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3994865443608171999 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6513510087155692729} + m_CullTransparentMesh: 1 +--- !u!114 &6756690555297024533 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6513510087155692729} + 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: 1} + 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: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + 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!114 &5085689240096181003 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6513510087155692729} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 6756690555297024533} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 4316720323126019441} + m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine + m_MethodName: SetActive + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 1 + m_CallState: 2 + - m_Target: {fileID: 931433734628605246} + m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine + m_MethodName: SetActive + m_Mode: 6 + 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 + - m_Target: {fileID: 4316720321970040648} + m_TargetAssemblyTypeName: ReadyPlayerMe.AvatarCreator.LoginElement, ReadyPlayerMe.AvatarCreator + m_MethodName: MergeCurrentUserToRpmAccount + 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 &8016215951670164501 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5704122375698290064} + - component: {fileID: 2557774715767153891} + - component: {fileID: 7133865441592933175} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5704122375698290064 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8016215951670164501} + 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_Children: [] + m_Father: {fileID: 8086738846091643257} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &2557774715767153891 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8016215951670164501} + m_CullTransparentMesh: 1 +--- !u!114 &7133865441592933175 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8016215951670164501} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 20 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Continue without Transferring +--- !u!1 &8227810094798555495 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8086738846091643257} + - component: {fileID: 1327952007191869963} + - component: {fileID: 3244331750152209553} + - component: {fileID: 7053627951103957866} + m_Layer: 5 + m_Name: Continue without transferring + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8086738846091643257 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8227810094798555495} + 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_Children: + - {fileID: 5704122375698290064} + m_Father: {fileID: 8188830851170153910} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -140, y: -170} + m_SizeDelta: {x: -360, y: 60} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &1327952007191869963 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8227810094798555495} + m_CullTransparentMesh: 1 +--- !u!114 &3244331750152209553 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8227810094798555495} + 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: 1} + 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: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + 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!114 &7053627951103957866 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8227810094798555495} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 3244331750152209553} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 4316720323126019441} + m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine + m_MethodName: SetActive + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 1 + m_CallState: 2 + - m_Target: {fileID: 931433734628605246} + m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine + m_MethodName: SetActive + m_Mode: 6 + 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 + - m_Target: {fileID: 4316720321970040648} + m_TargetAssemblyTypeName: ReadyPlayerMe.AvatarCreator.LoginElement, ReadyPlayerMe.AvatarCreator + m_MethodName: DontMergeCurrentUserToRpmAccount + 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 diff --git a/Runtime/AvatarCreator/Scripts/UI/Elements/LoginElement.cs b/Runtime/AvatarCreator/Scripts/UI/Elements/LoginElement.cs index 4919e5b2..88a91cef 100644 --- a/Runtime/AvatarCreator/Scripts/UI/Elements/LoginElement.cs +++ b/Runtime/AvatarCreator/Scripts/UI/Elements/LoginElement.cs @@ -21,6 +21,7 @@ public class LoginElement : MonoBehaviour [SerializeField] private UnityEvent OnLoginSuccess; [SerializeField] private UnityEvent OnLoginFail; + private bool mergeCurrentSession; private void OnEnable() { AuthManager.OnSignInError += LoginFailed; @@ -39,6 +40,16 @@ public void SendVerificationCode() AuthManager.SendEmailCode(emailField.text); } + public void MergeCurrentUserToRpmAccount() + { + mergeCurrentSession = true; + } + + public void DontMergeCurrentUserToRpmAccount() + { + mergeCurrentSession = false; + } + /// /// Attempts to login with the verification code that was entered into the code InputField. /// @@ -46,7 +57,8 @@ public async void LoginWithCode() { try { - if (await AuthManager.LoginWithCode(codeField.text)) + var userIdToMerge = mergeCurrentSession && AuthManager.IsSignedInAnonymously ? AuthManager.UserSession.Id : null; + if (await AuthManager.LoginWithCode(codeField.text, userIdToMerge)) { LoginSuccess(); } diff --git a/Samples~/AvatarCreatorSamples/AvatarCreatorExperimental/README.md b/Samples~/AvatarCreatorSamples/AvatarCreatorExperimental/README.md index 2ea24a58..4503d8be 100644 --- a/Samples~/AvatarCreatorSamples/AvatarCreatorExperimental/README.md +++ b/Samples~/AvatarCreatorSamples/AvatarCreatorExperimental/README.md @@ -162,6 +162,7 @@ This element is useful for creating Ready Player Me login UI. - an input field for the user to enter their email address - an input field for the user to enter in their 1 time login code - functionality to automatically send a login code to the user after they enter their email address +- functionality to merge user session to their Ready Player Me account - OnLoginSuccess event that can be subscribed to in the inspector - OnLoginFailed event that can be subscribed to in the inspector and passes a string containing the error message From 6eed5610d91b227dfe2fe449d7d45b0a820ece7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raigo=20K=C3=B5vask?= Date: Fri, 9 Feb 2024 08:57:20 +0200 Subject: [PATCH 3/3] chore: join functions together --- .../AvatarCreator/Prefabs/Elements/LoginElement.prefab | 8 ++++---- .../AvatarCreator/Scripts/UI/Elements/LoginElement.cs | 9 ++------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Runtime/AvatarCreator/Prefabs/Elements/LoginElement.prefab b/Runtime/AvatarCreator/Prefabs/Elements/LoginElement.prefab index 5741d020..8522eb4d 100644 --- a/Runtime/AvatarCreator/Prefabs/Elements/LoginElement.prefab +++ b/Runtime/AvatarCreator/Prefabs/Elements/LoginElement.prefab @@ -2399,14 +2399,14 @@ MonoBehaviour: - m_Target: {fileID: 4316720321970040648} m_TargetAssemblyTypeName: ReadyPlayerMe.AvatarCreator.LoginElement, ReadyPlayerMe.AvatarCreator m_MethodName: MergeCurrentUserToRpmAccount - m_Mode: 1 + m_Mode: 6 m_Arguments: m_ObjectArgument: {fileID: 0} m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine m_IntArgument: 0 m_FloatArgument: 0 m_StringArgument: - m_BoolArgument: 0 + m_BoolArgument: 1 m_CallState: 2 --- !u!1 &8016215951670164501 GameObject: @@ -2634,8 +2634,8 @@ MonoBehaviour: m_CallState: 2 - m_Target: {fileID: 4316720321970040648} m_TargetAssemblyTypeName: ReadyPlayerMe.AvatarCreator.LoginElement, ReadyPlayerMe.AvatarCreator - m_MethodName: DontMergeCurrentUserToRpmAccount - m_Mode: 1 + m_MethodName: MergeCurrentUserToRpmAccount + m_Mode: 6 m_Arguments: m_ObjectArgument: {fileID: 0} m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine diff --git a/Runtime/AvatarCreator/Scripts/UI/Elements/LoginElement.cs b/Runtime/AvatarCreator/Scripts/UI/Elements/LoginElement.cs index 88a91cef..dd0cd1a9 100644 --- a/Runtime/AvatarCreator/Scripts/UI/Elements/LoginElement.cs +++ b/Runtime/AvatarCreator/Scripts/UI/Elements/LoginElement.cs @@ -40,14 +40,9 @@ public void SendVerificationCode() AuthManager.SendEmailCode(emailField.text); } - public void MergeCurrentUserToRpmAccount() + public void MergeCurrentUserToRpmAccount(bool merge) { - mergeCurrentSession = true; - } - - public void DontMergeCurrentUserToRpmAccount() - { - mergeCurrentSession = false; + mergeCurrentSession = merge; } ///