-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/v3.4.0' into main
- Loading branch information
Showing
23 changed files
with
241 additions
and
193 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using System; | ||
using UnityEditor; | ||
using UnityEngine; | ||
using UnityEngine.UIElements; | ||
|
||
namespace ReadyPlayerMe.Core.Editor | ||
{ | ||
public class BreakingChangeDialog : EditorWindow | ||
{ | ||
private const string MIGRATION_GUIDE_URL = "https://docs.readyplayer.me/ready-player-me/integration-guides/unity/troubleshooting/updating-from-earlier-versions"; | ||
private const string TITLE = "Update Packages"; | ||
|
||
[SerializeField] private VisualTreeAsset visualTreeAsset; | ||
|
||
private static Action updateClicked; | ||
|
||
public static void ShowDialog(Action onUpdate) | ||
{ | ||
updateClicked = onUpdate; | ||
|
||
var window = GetWindow<BreakingChangeDialog>(); | ||
window.titleContent = new GUIContent(TITLE); | ||
window.minSize = new Vector2(500, 140); | ||
window.maxSize = new Vector2(500, 140); | ||
window.ShowModalUtility(); | ||
} | ||
|
||
public void CreateGUI() | ||
{ | ||
visualTreeAsset.CloneTree(rootVisualElement); | ||
|
||
var migrationLink = rootVisualElement.Q<Label>("MigrationLink"); | ||
migrationLink.RegisterCallback<MouseUpEvent>(x => | ||
{ | ||
Application.OpenURL(MIGRATION_GUIDE_URL); | ||
}); | ||
|
||
rootVisualElement.Q<Button>("UpdateButton").clicked += () => | ||
{ | ||
updateClicked?.Invoke(); | ||
Close(); | ||
}; | ||
|
||
rootVisualElement.Q<Button>("CancelButton").clicked += Close; | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
Editor/UI/BreakingChangeDialog/BreakingChangeDialog.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True"> | ||
<Style src="../EditorWindows/CommonStyle.uss" /> | ||
<ui:VisualElement style="flex-direction: row; align-items: stretch; justify-content: flex-start; margin-left: 20px; margin-right: 20px; margin-top: 20px; margin-bottom: 20px; flex-shrink: 0;"> | ||
<ui:VisualElement name="IconContainer" style="width: 60px; height: 60px; flex-direction: row; align-items: center; justify-content: center; background-color: rgb(0, 0, 0);"> | ||
<ui:VisualElement name="Icon" style="background-image: resource('rpm_logo'); width: 50px; height: 50px; flex-direction: row; flex-shrink: 0; -unity-background-scale-mode: scale-to-fit; background-color: rgba(0, 0, 0, 0);" /> | ||
</ui:VisualElement> | ||
<ui:VisualElement name="Description" style="align-items: flex-start; justify-content: center; margin-left: 10px; flex-shrink: 0;"> | ||
<ui:Label text="This is a breaking change! Do you still want to update? " name="Text" style="margin-top: 0; margin-right: 0; margin-left: 0; margin-bottom: 0; white-space: normal; -unity-text-align: middle-left;" /> | ||
<ui:Label text="Link to Migration Guide" name="MigrationLink" class="link" style="margin-top: 5px; margin-right: 0; margin-left: 0; margin-bottom: 0; white-space: normal; -unity-text-align: middle-left; color: rgb(0, 104, 255);" /> | ||
</ui:VisualElement> | ||
</ui:VisualElement> | ||
<ui:VisualElement name="Buttons" style="flex-direction: row-reverse; padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px; flex-shrink: 0; height: 44px;"> | ||
<ui:Button text="Cancel" display-tooltip-when-elided="true" name="CancelButton" /> | ||
<ui:Button text="Update" display-tooltip-when-elided="true" name="UpdateButton" style="white-space: nowrap;" /> | ||
</ui:VisualElement> | ||
</ui:UXML> |
10 changes: 10 additions & 0 deletions
10
Editor/UI/BreakingChangeDialog/BreakingChangeDialog.uxml.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.