mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
Stickers: fixed stickers not parenting to dynamic content
This commit is contained in:
parent
5a6dc316c8
commit
9638e22daf
1 changed files with 10 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
||||||
using ABI_RC.Core;
|
using ABI_RC.Core;
|
||||||
|
using ABI_RC.Core.IO;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Object = UnityEngine.Object;
|
using Object = UnityEngine.Object;
|
||||||
|
|
||||||
|
@ -111,9 +112,16 @@ namespace NAK.Stickers
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// for performance it is best to let them batch, but we also want movable objects to always
|
||||||
|
// be decaled instead of floating in-scene (so avatars/props are always considered movable)
|
||||||
|
|
||||||
Transform rootObject = null;
|
Transform rootObject = null;
|
||||||
if (hit.rigidbody != null) rootObject = hit.rigidbody.transform;
|
GameObject hitGO = hit.transform.gameObject;
|
||||||
|
if (hitGO.TryGetComponent(out Rigidbody _)
|
||||||
|
|| hitGO.TryGetComponent(out Animator _)
|
||||||
|
|| hitGO.scene.buildIndex == 4) // additive (dynamic) content
|
||||||
|
rootObject = hitGO.transform;
|
||||||
|
|
||||||
_lastPlacedPosition = hit.point;
|
_lastPlacedPosition = hit.point;
|
||||||
LastPlacedTime = Time.time;
|
LastPlacedTime = Time.time;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue