public void Awake() { if (Instance != this) { Instance = this; DontDestroyOnLoad(gameObject); _playerInfo = new PlayerInfo(SteamAPI.GetUserName(), SteamAPI.GetUserID()); _currentScene = SceneManager.GetActiveScene().name; } }
public void UpdatePlayerInfo() { _playerInfo.avatarHash = ModelSaberAPI.cachedAvatars.FirstOrDefault(x => x.Value == CustomAvatar.Plugin.Instance.PlayerAvatarManager.GetCurrentAvatar()).Key; if (_playerInfo.avatarHash == null) { _playerInfo.avatarHash = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"; } _playerInfo.playerName = SteamAPI.GetUserName(); _playerInfo.playerId = SteamAPI.GetUserID(); WorldController.CharacterPosition pos = WorldController.GetCharacterInfo(); _playerInfo.headPos = pos.headPos; _playerInfo.headRot = pos.headRot; _playerInfo.leftHandPos = pos.leftHandPos; _playerInfo.leftHandRot = pos.leftHandRot; _playerInfo.rightHandPos = pos.rightHandPos; _playerInfo.rightHandRot = pos.rightHandRot; }