ShareBubbles: move to additive scene

This commit is contained in:
NotAKidoS 2024-12-02 21:53:17 -06:00
parent 6fb1e0658d
commit e7b2ad4c31
2 changed files with 8 additions and 3 deletions

View file

@ -345,8 +345,8 @@ public class ShareBubble : MonoBehaviour
{
if (!IsOwnBubble) return;
bool isAllowed = implementation.IsPermitted ||
Data.Rule == ShareRule.Everyone ||
// Check if requester is allowed to claim
bool isAllowed = Data.Rule == ShareRule.Everyone ||
(Data.Rule == ShareRule.FriendsOnly && Friends.FriendsWith(requesterId));
if (!isAllowed)

View file

@ -1,4 +1,5 @@
using ABI_RC.Core.Networking.IO.Instancing;
using ABI_RC.Core.IO;
using ABI_RC.Core.Networking.IO.Instancing;
using ABI_RC.Core.Player;
using ABI_RC.Core.Savior;
using ABI_RC.Core.UI;
@ -7,6 +8,7 @@ using ABI_RC.Systems.Gravity;
using NAK.ShareBubbles.Impl;
using NAK.ShareBubbles.Networking;
using UnityEngine;
using UnityEngine.SceneManagement;
using Object = UnityEngine.Object;
namespace NAK.ShareBubbles;
@ -234,6 +236,9 @@ public class ShareBubbleManager
bubbleRootObject.transform.SetLocalPositionAndRotation(position, rotation);
bubbleRootObject.SetActive(true);
// Move to Additive scene to prevent being hit by shader replacement on VR switch
SceneManager.MoveGameObjectToScene(bubbleRootObject, SceneManager.GetSceneByName(CVRObjectLoader.AdditiveContentSceneName));
Transform bubbleTransform = bubbleRootObject.transform.GetChild(0);
if (bubbleTransform == null)
throw new InvalidOperationException("Bubble prefab is missing expected child transform");