This repository was archived by the owner on Mar 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathManager.cs
More file actions
49 lines (34 loc) · 1.76 KB
/
Manager.cs
File metadata and controls
49 lines (34 loc) · 1.76 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
45
46
47
48
49
using Il2CppSystem.Collections.Generic;
using System.Linq;
using UnityEngine;
using VRC;
using VRC.Core;
using VRC.Management;
using ABI_RC.Core;
using ABI_RC.Core.Player;
namespace AvatarHider
{
public static class Manager
{
public static void StopSpawnSounds(this GameObject avtrObject)
{
foreach (var audioSource in avtrObject.GetComponentsInChildren<AudioSource>().Where(audioSource => audioSource.isPlaying))
audioSource.Stop();
}
public static VRCPlayer GetLocalVRCPlayer() => VRCPlayer.field_Internal_Static_VRCPlayer_0;
public static GameObject GetAvatarObject(this Player p) => p.prop_VRCPlayer_0.prop_VRCAvatarManager_0.prop_GameObject_0;
public static bool IsShowingAvatar(this APIUser apiUser)
{
foreach (var playerModeration in GetModerationManager().field_Private_List_1_ApiPlayerModeration_0)
if (playerModeration.moderationType == ApiPlayerModeration.ModerationType.ShowAvatar && playerModeration.targetUserId == apiUser.id)
return true;
return false;
}
public static List<CVRPlayerEntity> networkPlayersCVR = CVRPlayerManager.Instance.NetworkPlayers;
public static PlayerManager GetPlayerManager() => PlayerManager.prop_PlayerManager_0;
public static System.Collections.Generic.List<Player> GetAllPlayers() => GetPlayerManager()?.prop_ArrayOf_Player_0.ToList();
public static bool IsMe(this Player p) => p.name == GetLocalVRCPlayer().name;
public static bool IsFriendsWith(this APIUser apiUser) => APIUser.CurrentUser.friendIDs.Contains(apiUser.id);
public static ModerationManager GetModerationManager() => ModerationManager.prop_ModerationManager_0;
}
}