Skip to content

Commit 7a42396

Browse files
feat: how to setup UGS In-Editor Tutorial added [MTT-8923] (#898)
* how to setup UGS tutorial added * changelog addition * tutorial updates * whitespace fixes
1 parent f33f2b2 commit 7a42396

21 files changed

+224
-35
lines changed

Assets/Editor/Tutorials/Homepage.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:8548f60d916a56db3cfbef9db7f6e46a10bea6e7f4885bea060c05cf4e2b592c
3+
size 3310
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:c16f97958fbc897c0311d98cca161ed16d2cacb9c386127b9afbdc1c03041ad1
3+
size 1216

Assets/Editor/Tutorials/Homepage/1_ConfigureUGS.asset.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Editor/Tutorials/Images.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Loading

Assets/Editor/Tutorials/Images/Feature_Image_008.png.meta

+127
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Editor/Tutorials/TableOfContents.asset

-3
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:31df35e528089f3ff6019906e0b5396cfeaeaee38f4fe210b199ecdf9e27bd4d
3-
size 2404
2+
oid sha256:5324a2c2df7f4983887f5f31d8a7a934b43c6e0255e2fc9821fdaa3e52eb0d25
3+
size 3203

Assets/Editor/Tutorials/Tutorial0_SetupUGS.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:906b96219e7c7d6e763a0654834197a27bb67bc3f93752c43fbbaa784a7b45a7
3+
size 3035

Assets/Editor/Tutorials/Tutorial0_SetupUGS/1-Verify And Setup UGS.asset.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:cdf61b105a1e633877187ab063da4c4d6b8734eae95cc403ec05d1983f0e4d7f
3+
size 6585

Assets/Editor/Tutorials/Tutorial0_SetupUGS/2-CheckServices.asset.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:ac721dec4e2a4370270b1e70b4383351ec621fab2f7f8af27bc34b89ed1e3a17
3+
size 3302

Assets/Editor/Tutorials/Tutorial0_SetupUGS/8-Project Successfully Linked.asset.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:54db6af02dc3be072fc11e511152d7d6a69b59256e114d2f566ae4c856d8b5cb
3+
size 1795

Assets/Editor/Tutorials/Tutorial0_SetupUGS/Tutorial 0 - UGS Setup.asset.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Editor/Tutorials/TutorialCallbacks.cs

+9-30
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44

55
namespace Unity.Netcode.Samples.BossRoom
66
{
7-
87
/// <summary>
98
/// Implement your Tutorial callbacks here.
109
/// </summary>
11-
[CreateAssetMenu(fileName = DefaultFileName, menuName = "Tutorials/" + DefaultFileName + " Instance")]
10+
[CreateAssetMenu(fileName = k_DefaultFileName, menuName = "Tutorials/" + k_DefaultFileName + " Instance")]
1211
public class TutorialCallbacks : ScriptableObject
1312
{
14-
[SerializeField] SceneAsset m_StartupScene;
13+
[SerializeField]
14+
SceneAsset m_StartupScene;
1515

1616
/// <summary>
1717
/// The default file name used to create asset of this class type.
1818
/// </summary>
19-
public const string DefaultFileName = "TutorialCallbacks";
19+
const string k_DefaultFileName = "TutorialCallbacks";
2020

2121
/// <summary>
2222
/// Creates a TutorialCallbacks asset and shows it in the Project window.
@@ -27,7 +27,7 @@ public class TutorialCallbacks : ScriptableObject
2727
/// <returns>The created asset</returns>
2828
public static ScriptableObject CreateAndShowAsset(string assetPath = null)
2929
{
30-
assetPath = assetPath ?? $"{TutorialEditorUtils.GetActiveFolderPath()}/{DefaultFileName}.asset";
30+
assetPath = assetPath ?? $"{TutorialEditorUtils.GetActiveFolderPath()}/{k_DefaultFileName}.asset";
3131
var asset = CreateInstance<TutorialCallbacks>();
3232
AssetDatabase.CreateAsset(asset, AssetDatabase.GenerateUniqueAssetPath(assetPath));
3333
EditorUtility.FocusProjectWindow(); // needed in order to make the selection of newly created asset to really work
@@ -40,35 +40,14 @@ public void StartTutorial(Tutorial tutorial)
4040
TutorialWindow.StartTutorial(tutorial);
4141
}
4242

43-
public void FocusGameView()
44-
{
45-
/*
46-
* note: this solution is a bit weak, but it's the best we can do without accessing internal APIs.
47-
* we'll need to check that it works for Unity 6 as well
48-
*/
49-
EditorApplication.ExecuteMenuItem("Window/General/Game");
50-
}
51-
52-
public void FocusSceneView()
53-
{
54-
EditorApplication.ExecuteMenuItem("Window/General/Scene");
55-
}
56-
57-
public bool IsRunningAsHost()
58-
{
59-
return NetworkManager.Singleton && NetworkManager.Singleton.IsHost;
60-
}
61-
62-
public bool IsRunningAsServerOnly()
43+
public bool IsConnectedToUgs()
6344
{
64-
return NetworkManager.Singleton && NetworkManager.Singleton.IsServer
65-
&& !NetworkManager.Singleton.IsClient;
45+
return CloudProjectSettings.projectBound;
6646
}
6747

68-
public bool IsRunningAsClientOnly()
48+
public void ShowServicesSettings()
6949
{
70-
return NetworkManager.Singleton && !NetworkManager.Singleton.IsServer
71-
&& NetworkManager.Singleton.IsClient;
50+
SettingsService.OpenProjectSettings("Project/Services");
7251
}
7352

7453
public void OpenURL(string url)

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
1111
* Added a welcome dialog to guide users on their first time experience (#888)
1212
* Added a Table of Contents with helpful resources, that can be accessed from the `Tutorials > Show Tutorials` menu
1313
* Added the Multiplayer Play Mode package v1.3.1 to the project (#890)
14+
* An In-Editor Tutorial walking through the process of associating your Unity project with a Unity Cloud ID has been added (#898)
1415

1516
### Changed
1617
* Upgraded editor version to 6000.0.25f1 and upgraded Boss Room to Netcode for GameObjects v2.0.0 (#890)

0 commit comments

Comments
 (0)