-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added usernames above players' heads
- Loading branch information
1 parent
12bca39
commit 033a6af
Showing
7 changed files
with
234 additions
and
13 deletions.
There are no files selected for viewing
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
21 changes: 21 additions & 0 deletions
21
Assets/RiptideSteamTransport/Demos/PlayerHosted/Scripts/Player/PlayerUIManager.cs
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,21 @@ | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
namespace RiptideNetworking.Demos.SteamTransport.PlayerHosted | ||
{ | ||
internal class PlayerUIManager : MonoBehaviour | ||
{ | ||
[SerializeField] private Text usernameText; | ||
|
||
private void Update() | ||
{ | ||
if (ClientPlayer.list.TryGetValue(NetworkManager.Singleton.Client.Id, out ClientPlayer player)) | ||
transform.rotation = Quaternion.LookRotation(transform.position - player.transform.position); | ||
} | ||
|
||
internal void SetName(string _name) | ||
{ | ||
usernameText.text = _name; | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Assets/RiptideSteamTransport/Demos/PlayerHosted/Scripts/Player/PlayerUIManager.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
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