-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLocalPlayer.cs
More file actions
44 lines (38 loc) · 1.21 KB
/
LocalPlayer.cs
File metadata and controls
44 lines (38 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System.Collections;
using System.Collections.Generic;
using CompassNavigatorPro;
using Fusion;
using UnityEngine;
namespace _Game
{
static public class LocalPlayer
{
static public bool IsServer;
static public string PlayerId;
static public string DisplayName;
static public Player Player;
static public PlayerRef PlayerRef { get { return Player.Object.InputAuthority; } }
static public Ship Ship { get; private set; }
static public Camera Camera { get; private set; }
static public void SetShip(Ship ship)
{
if (ship)
{
ship.IsLocalPlayer = true;
Ship = ship;
Camera = ship.Camera;
ShipCamera.Instance.SetShip(ship);
PlayerHudPanel.Instance.SetShip(ship);
PlayerHudPanel.Instance.Show(true);
}
else
{
Ship = null;
Camera = null;
ShipCamera.Instance.SetShip(null);
PlayerHudPanel.Instance.SetShip(null);
PlayerHudPanel.Instance.Show(false);
}
}
}
}