Skip to content

Commit

Permalink
Merge branch 'develop' into fix/green-names-on-late-joiners
Browse files Browse the repository at this point in the history
  • Loading branch information
fernando-cortez committed Jan 17, 2025
2 parents 85318a7 + 7a42396 commit 003c718
Show file tree
Hide file tree
Showing 55 changed files with 1,777 additions and 259 deletions.
8 changes: 8 additions & 0 deletions Assets/Editor/Tutorials/Homepage.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Assets/Editor/Tutorials/Homepage/0_TableOfContents.asset
Git LFS file not shown
3 changes: 3 additions & 0 deletions Assets/Editor/Tutorials/Homepage/1_ConfigureUGS.asset
Git LFS file not shown
8 changes: 8 additions & 0 deletions Assets/Editor/Tutorials/Homepage/1_ConfigureUGS.asset.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/Editor/Tutorials/Images.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Assets/Editor/Tutorials/Images/Feature_Image_008.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
127 changes: 127 additions & 0 deletions Assets/Editor/Tutorials/Images/Feature_Image_008.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Assets/Editor/Tutorials/TableOfContents.asset

This file was deleted.

4 changes: 2 additions & 2 deletions Assets/Editor/Tutorials/Tutorial Welcome Page.asset
Git LFS file not shown
8 changes: 8 additions & 0 deletions Assets/Editor/Tutorials/Tutorial0_SetupUGS.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Git LFS file not shown

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Git LFS file not shown

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Git LFS file not shown

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Git LFS file not shown

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 9 additions & 30 deletions Assets/Editor/Tutorials/TutorialCallbacks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

namespace Unity.Netcode.Samples.BossRoom
{

/// <summary>
/// Implement your Tutorial callbacks here.
/// </summary>
[CreateAssetMenu(fileName = DefaultFileName, menuName = "Tutorials/" + DefaultFileName + " Instance")]
[CreateAssetMenu(fileName = k_DefaultFileName, menuName = "Tutorials/" + k_DefaultFileName + " Instance")]
public class TutorialCallbacks : ScriptableObject
{
[SerializeField] SceneAsset m_StartupScene;
[SerializeField]
SceneAsset m_StartupScene;

/// <summary>
/// The default file name used to create asset of this class type.
/// </summary>
public const string DefaultFileName = "TutorialCallbacks";
const string k_DefaultFileName = "TutorialCallbacks";

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

public void FocusGameView()
{
/*
* note: this solution is a bit weak, but it's the best we can do without accessing internal APIs.
* we'll need to check that it works for Unity 6 as well
*/
EditorApplication.ExecuteMenuItem("Window/General/Game");
}

public void FocusSceneView()
{
EditorApplication.ExecuteMenuItem("Window/General/Scene");
}

public bool IsRunningAsHost()
{
return NetworkManager.Singleton && NetworkManager.Singleton.IsHost;
}

public bool IsRunningAsServerOnly()
public bool IsConnectedToUgs()
{
return NetworkManager.Singleton && NetworkManager.Singleton.IsServer
&& !NetworkManager.Singleton.IsClient;
return CloudProjectSettings.projectBound;
}

public bool IsRunningAsClientOnly()
public void ShowServicesSettings()
{
return NetworkManager.Singleton && !NetworkManager.Singleton.IsServer
&& NetworkManager.Singleton.IsClient;
SettingsService.OpenProjectSettings("Project/Services");
}

public void OpenURL(string url)
Expand Down
8 changes: 8 additions & 0 deletions Assets/InputSystem.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 003c718

Please sign in to comment.