I suggest to add
private void OnPlayerSleep(BasePlayer player)
{
if (!IsInvisible(player)) return;
if (config.EnableGUI)
{
CuiHelper.DestroyUi(player, "VanishUI");
CuiHelper.DestroyUi(player, "VanishColliderUI");
}
}
private void OnPlayerSleepEnded(BasePlayer player)
{
if (!IsInvisible(player)) return;
if (config.EnableGUI)
{
CuiHelper.DestroyUi(player, "VanishUI");
CuiHelper.DestroyUi(player, "VanishColliderUI");
CuiHelper.AddUi(player, cachedVanishUI);
}
}
private void OnPlayerDeath(BasePlayer player)
{
if (!IsInvisible(player)) return;
if (config.EnableGUI)
{
CuiHelper.DestroyUi(player, "VanishUI");
CuiHelper.DestroyUi(player, "VanishColliderUI");
}
}
private void OnNpcConversationStart(NPCTalking npcTalking, BasePlayer player, ConversationData conversationData)
{
if (!IsInvisible(player)) return;
if (config.EnableGUI)
{
CuiHelper.DestroyUi(player, "VanishUI");
CuiHelper.DestroyUi(player, "VanishColliderUI");
}
}
private void OnNpcConversationEnded(NPCTalking npcTalking, BasePlayer player)
{
if (!IsInvisible(player)) return;
if (config.EnableGUI)
{
CuiHelper.DestroyUi(player, "VanishUI");
CuiHelper.DestroyUi(player, "VanishColliderUI");
CuiHelper.AddUi(player, cachedVanishUI);
}
}
to pervent GUI appears on interactions windows.