- Floor map markers now also use VRCObjectSync.

- PickupUseCallback can now optionally send ownership transfer requests.
- Added a wood chest decoration for the round 2 room.
- Tweaked the rough and dirty steel material.
This commit is contained in:
2026-05-18 16:37:46 -04:00
parent 29f9b858cf
commit d4e687fb19
29 changed files with 2065 additions and 1470 deletions
@@ -44,7 +44,7 @@ MonoBehaviour:
Data:
- Name:
Entry: 12
Data: 5
Data: 6
- Name:
Entry: 7
Data:
@@ -116,19 +116,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _OnPickupCallbackFunction
Data: _SendOwnershipTransferRequest
- Name: $v
Entry: 7
Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _OnPickupCallbackFunction
Data: _SendOwnershipTransferRequest
- Name: <UserType>k__BackingField
Entry: 7
Data: 8|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.String, mscorlib
Data: System.Boolean, mscorlib
- Name:
Entry: 8
Data:
@@ -185,19 +185,79 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _OnDropCallbackFunction
Data: _OnPickupCallbackFunction
- Name: $v
Entry: 7
Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _OnPickupCallbackFunction
- Name: <UserType>k__BackingField
Entry: 7
Data: 13|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.String, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 13
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 14|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 15|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: _OnDropCallbackFunction
- Name: $v
Entry: 7
Data: 16|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _OnDropCallbackFunction
- Name: <UserType>k__BackingField
Entry: 9
Data: 8
Data: 13
- Name: <SystemType>k__BackingField
Entry: 9
Data: 8
Data: 13
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -212,13 +272,13 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 13|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 17|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 14|UnityEngine.SerializeField, UnityEngine.CoreModule
Data: 18|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
@@ -242,16 +302,16 @@ MonoBehaviour:
Data: _UseDownCallbackFunction
- Name: $v
Entry: 7
Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _UseDownCallbackFunction
- Name: <UserType>k__BackingField
Entry: 9
Data: 8
Data: 13
- Name: <SystemType>k__BackingField
Entry: 9
Data: 8
Data: 13
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -266,13 +326,13 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 16|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 17|UnityEngine.SerializeField, UnityEngine.CoreModule
Data: 21|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
@@ -296,16 +356,16 @@ MonoBehaviour:
Data: _UseUpCallbackFunction
- Name: $v
Entry: 7
Data: 18|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 22|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _UseUpCallbackFunction
- Name: <UserType>k__BackingField
Entry: 9
Data: 8
Data: 13
- Name: <SystemType>k__BackingField
Entry: 9
Data: 8
Data: 13
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -320,13 +380,13 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 19|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 23|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 20|UnityEngine.SerializeField, UnityEngine.CoreModule
Data: 24|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
@@ -9,12 +9,23 @@ public class PickupUseCallback : UdonSharpBehaviour
{
[SerializeField] private UdonSharpBehaviour _CallbackObject;
[Space]
[SerializeField] private bool _SendOwnershipTransferRequest;
[SerializeField] private string _OnPickupCallbackFunction;
[SerializeField] private string _OnDropCallbackFunction;
[SerializeField] private string _UseDownCallbackFunction;
[SerializeField] private string _UseUpCallbackFunction;
public override void OnOwnershipTransferred(VRCPlayerApi Player)
{
if (_SendOwnershipTransferRequest)
{
Networking.SetOwner(Player, _CallbackObject.gameObject);
}
base.OnOwnershipTransferred(Player);
}
public override void OnPickup()
{
if (_OnPickupCallbackFunction != "" && Utilities.IsValid(_CallbackObject))
File diff suppressed because it is too large Load Diff
+13 -20
View File
@@ -12,7 +12,12 @@ using VRC.Udon.Common.Interfaces;
public class FloorMapMarker : UdonSharpBehaviour
{
[SerializeField] private GameManagerRound3 _GameManager;
[Space]
[SerializeField] private UdonSharpBehaviour _MarkerObject;
[SerializeField] private Rigidbody _RigidBodyComponent;
[SerializeField] private VRCPickup _PickupComponent;
[SerializeField] private MeshRenderer _MarkerMesh;
[Space]
[SerializeField] private Material _UnlitLampMaterial;
[SerializeField] private Material _LitLampMaterial;
@@ -27,10 +32,6 @@ public class FloorMapMarker : UdonSharpBehaviour
private int _NoCollisionCounter = 0;
private DataList _CollidingLocations = new DataList();
private Rigidbody _RigidBodyComponent;
private VRCPickup _PickupComponent;
private MeshRenderer _MarkerMesh;
private VRCPlayerApi _CurrentOwner;
private const int MAX_REPEAT_COLLISION_CHECKS = 3;
@@ -40,10 +41,6 @@ public class FloorMapMarker : UdonSharpBehaviour
void Start()
{
_RigidBodyComponent = GetComponent<Rigidbody>();
_PickupComponent = GetComponent<VRCPickup>();
_MarkerMesh = GetComponent<MeshRenderer>();
_CurrentOwner = Networking.GetOwner(gameObject);
}
@@ -58,7 +55,7 @@ public class FloorMapMarker : UdonSharpBehaviour
public void Initialise()
{
_RigidBodyComponent.constraints = RigidbodyConstraints.None;
transform.SetLocalPositionAndRotation(Vector3.zero, Quaternion.identity);
_RigidBodyComponent.transform.SetLocalPositionAndRotation(Vector3.zero, Quaternion.identity);
SetPickupable(false);
Active = false;
@@ -101,18 +98,14 @@ public class FloorMapMarker : UdonSharpBehaviour
}
}
public override void OnPickup()
public void MarkerPickedUp()
{
IsGrabbed = true;
base.OnPickup();
}
public override void OnDrop()
public void MarkerDropped()
{
IsGrabbed = false;
base.OnDrop();
}
private void SwapLampMaterial()
@@ -136,7 +129,7 @@ public class FloorMapMarker : UdonSharpBehaviour
{
if (!_CurrentOwner.IsUserInVR())
{
transform.eulerAngles = new Vector3(0.0f, transform.eulerAngles.y, 0.0f);
_RigidBodyComponent.transform.eulerAngles = new Vector3(0.0f, _RigidBodyComponent.transform.eulerAngles.y, 0.0f);
}
_RigidBodyComponent.constraints = RigidbodyConstraints.FreezePositionX | RigidbodyConstraints.FreezePositionZ;
@@ -267,11 +260,11 @@ public class FloorMapMarker : UdonSharpBehaviour
private void DisableMovementCompletely(Vector3 CorrectLocation = new Vector3())
{
_RigidBodyComponent.constraints = RigidbodyConstraints.FreezePositionX | RigidbodyConstraints.FreezePositionZ | RigidbodyConstraints.FreezeRotation;
transform.eulerAngles = new Vector3(0.0f, transform.eulerAngles.y, 0.0f);
_RigidBodyComponent.transform.eulerAngles = new Vector3(0.0f, _RigidBodyComponent.transform.eulerAngles.y, 0.0f);
if (CorrectLocation != Vector3.zero)
{
transform.position = CorrectLocation;
_RigidBodyComponent.transform.position = CorrectLocation;
}
RequestSerialization();
@@ -279,7 +272,7 @@ public class FloorMapMarker : UdonSharpBehaviour
private bool IsUpright()
{
return (Vector3.Dot(transform.up, Vector3.up) >= 0.8f);
return (Vector3.Dot(_RigidBodyComponent.transform.up, Vector3.up) >= 0.8f);
}