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; if (!IsOwnBubble) return;
bool isAllowed = implementation.IsPermitted || // Check if requester is allowed to claim
Data.Rule == ShareRule.Everyone || bool isAllowed = Data.Rule == ShareRule.Everyone ||
(Data.Rule == ShareRule.FriendsOnly && Friends.FriendsWith(requesterId)); (Data.Rule == ShareRule.FriendsOnly && Friends.FriendsWith(requesterId));
if (!isAllowed) 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.Player;
using ABI_RC.Core.Savior; using ABI_RC.Core.Savior;
using ABI_RC.Core.UI; using ABI_RC.Core.UI;
@ -7,6 +8,7 @@ using ABI_RC.Systems.Gravity;
using NAK.ShareBubbles.Impl; using NAK.ShareBubbles.Impl;
using NAK.ShareBubbles.Networking; using NAK.ShareBubbles.Networking;
using UnityEngine; using UnityEngine;
using UnityEngine.SceneManagement;
using Object = UnityEngine.Object; using Object = UnityEngine.Object;
namespace NAK.ShareBubbles; namespace NAK.ShareBubbles;
@ -233,6 +235,9 @@ public class ShareBubbleManager
bubbleRootObject = Object.Instantiate(ShareBubblesMod.SharingBubblePrefab); bubbleRootObject = Object.Instantiate(ShareBubblesMod.SharingBubblePrefab);
bubbleRootObject.transform.SetLocalPositionAndRotation(position, rotation); bubbleRootObject.transform.SetLocalPositionAndRotation(position, rotation);
bubbleRootObject.SetActive(true); 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); Transform bubbleTransform = bubbleRootObject.transform.GetChild(0);
if (bubbleTransform == null) if (bubbleTransform == null)