- 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:
File diff suppressed because it is too large
Load Diff
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user