Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public void InitalizeVolumetrics()


BasisDeviceManagement.OnBootModeChanged -= OnBootModeChanged;
OnPickupUse -= OnPickupUseCapture;
OnPickupUse.RemoveListener( OnPickupUseCapture );

base.OnDestroy();
}
Expand Down Expand Up @@ -287,7 +287,7 @@ private void SetupClearMaterial()
public new void Start()
{
base.Start();
OnPickupUse += OnPickupUseCapture;
OnPickupUse.AddListener( OnPickupUseCapture );
}

/// <summary>Pickup “use” callback that triggers a capture on press down.</summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public enum CameraPinSpace
HHC.captureCamera.transform.GetLocalPositionAndRotation(out cameraStartingLocalPos, out cameraStartingLocalRot);
}

OnInteractStartEvent += OnInteractDesktopTweak;
OnInteractStartEvent.AddListener( OnInteractDesktopTweak );
BasisDeviceManagement.OnBootModeChanged += OnBootModeChanged;

BasisLocalPlayer.OnPlayersHeightChangedNextFrame += OnHeightChanged;
Expand Down Expand Up @@ -636,7 +636,7 @@ public void ResetMomentum()
public override void OnDestroy()
{
BasisDeviceManagement.OnBootModeChanged -= OnBootModeChanged;
OnInteractStartEvent -= OnInteractDesktopTweak;
OnInteractStartEvent.RemoveListener(OnInteractDesktopTweak);
BasisLocalPlayer.OnPlayersHeightChangedNextFrame -= OnHeightChanged;

BasisLocalPlayer.AfterSimulateOnLate.RemoveAction(202, UpdateCamera);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ public bool HasState(BasisInputState state, BasisInputKey Key)
/// <summary>
/// Event triggered when interaction starts with an input.
/// </summary>
public Action<BasisInput> OnInteractStartEvent;
public UnityEngine.Events.UnityEvent<BasisInput> OnInteractStartEvent;

/// <summary>
/// Event triggered when interaction ends with an input.
/// </summary>
public Action<BasisInput> OnInteractEndEvent;
public UnityEngine.Events.UnityEvent<BasisInput> OnInteractEndEvent;

/// <summary>
/// Event triggered when hover starts from an input.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public class BasisPickupInteractable : BasisInteractableObject
/// <summary>
/// Event-like callback invoked every frame a trigger state is detected while interacting.
/// </summary>
public Action<BasisPickUpUseMode> OnPickupUse;
public UnityEngine.Events.UnityEvent<BasisPickUpUseMode> OnPickupUse;

/// <summary>
/// Optional hook points that must all return <see langword="true"/> for hover to be allowed.
Expand Down Expand Up @@ -303,7 +303,7 @@ public void Start()
}
}
}
OnInteractStartEvent += OnInteractionEventFired;
OnInteractStartEvent.AddListener(OnInteractionEventFired);
}

internal void OnInteractionEventFired(BasisInput input)
Expand Down Expand Up @@ -884,7 +884,7 @@ private bool GetOppositeInteracting(out BasisInputWrapper BasisInputWrapper)
/// </summary>
public override void OnDestroy()
{
OnInteractStartEvent -= OnInteractionEventFired;
OnInteractStartEvent.RemoveListener(OnInteractionEventFired);

Destroy(HighlightClone);
if (asyncOperationHighlightMat.IsValid())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void Awake()
{
BasisPickupInteractable.CanHoverInjected.Add(CanHover);
BasisPickupInteractable.CanInteractInjected.Add(CanInteract);
BasisPickupInteractable.OnInteractStartEvent += OnInteractStartEvent;
BasisPickupInteractable.OnInteractStartEvent.AddListener(OnInteractStartEvent);
}
if (BasisPickupInteractable.RigidRef != null)
{
Expand All @@ -46,7 +46,7 @@ public void OnDisable()
{
BasisPickupInteractable.CanHoverInjected.Remove(CanHover);
BasisPickupInteractable.CanInteractInjected.Remove(CanInteract);
BasisPickupInteractable.OnInteractStartEvent -= OnInteractStartEvent;
BasisPickupInteractable.OnInteractStartEvent.RemoveListener(OnInteractStartEvent);
}
}
public override void OnDestroy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public override void OnNetworkReady()
}
if (Seat != null)
{
Seat.OnInteractStartEvent += OnInteractStartEvent;
Seat.OnInteractEndEvent += OnInteractEndEvent;
Seat.OnInteractStartEvent.AddListener(OnInteractStartEvent);
Seat.OnInteractEndEvent.AddListener(OnInteractEndEvent);
}
else
{
Expand Down Expand Up @@ -175,8 +175,8 @@ public override void OnDestroy()
BasisLocalPlayer.JustBeforeNetworkApply.RemoveAction(20, ProvideRemotePlayerTarget);
if (Seat != null)
{
Seat.OnInteractStartEvent -= OnInteractStartEvent;
Seat.OnInteractEndEvent -= OnInteractEndEvent;
Seat.OnInteractStartEvent.RemoveListener(OnInteractStartEvent);
Seat.OnInteractEndEvent.RemoveListener(OnInteractEndEvent);
}
base.OnDestroy();
}
Expand Down
8 changes: 8 additions & 0 deletions Basis/Packages/com.basis.framework/Prefabs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ public void _Init(CueController controller_, bool _isSecondary)
meshRenderer = this.GetComponent<MeshRenderer>();
sphereCollider = this.GetComponent<SphereCollider>();
_Hide();
pickup.OnInteractStartEvent += OnPickup;
pickup.OnInteractEndEvent += OnDrop;
pickup.OnPickupUse += OnPickupUse;
pickup.OnInteractStartEvent.AddListener(OnPickup);
pickup.OnInteractEndEvent.AddListener(OnDrop);
pickup.OnPickupUse.AddListener(OnPickupUse);
if (BasisDeviceManagement.IsCurrentModeVR())
{
pickup.AutoHold = BasisInteractableObject.BasisAutoHold.No;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ public void _Init(BilliardsModule table_, int idx_)
idx = idx_;

pickup = (BasisPickupInteractable)GetComponent(typeof(BasisPickupInteractable));
pickup.OnPickupUse += OnPickupUse;
pickup.OnInteractStartEvent += OnPickup;
pickup.OnInteractEndEvent += OnDrop;
pickup.OnPickupUse.AddListener(OnPickupUse);
pickup.OnInteractStartEvent.AddListener(OnPickup);
pickup.OnInteractEndEvent.AddListener(OnDrop);
}

private void OnPickupUse(BasisPickUpUseMode mode)
Expand Down
8 changes: 8 additions & 0 deletions Basis/Packages/com.basis.shim/Shims/CilboxPropBasis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,19 @@ public class CilboxPropBasis : Cilbox
"UnityEngine.UI.Text",
"UnityEngine.Vector3",
"UnityEngine.Vector4",

"Basis.Scripts.BasisSdk.Interactions.BasisPickUpUseMode",
"Basis.Scripts.Device_Management.Devices.BasisInput", // Restrictive, only used as a type.
"Basis.Scripts.BasisSdk.Interactions.BasisPickupInteractable", // Restrictive (See below), only access field.
"Basis.Scripts.BasisSdk.Interactions.BasisInteractableObject",
};

static HashSet<String> whiteListFields = new HashSet<String>(){
// Unity fields
"UnityEngine.Vector3.x",
"UnityEngine.Vector3.y",
"UnityEngine.Vector3.z",
"Basis.Scripts.BasisSdk.Interactions.BasisPickupInteractable.OnPickupUse",
};

static public HashSet<String> GetWhiteListTypes() { return whiteListType; }
Expand All @@ -111,6 +117,8 @@ override public bool CheckFieldAllowed( String sType, String sFieldName )
{
{ typeof(UnityEngine.MonoBehaviour), new HashSet<string>{ ".ctor" } },
{ typeof(UnityEngine.Events.UnityAction), new HashSet<string>{ ".ctor" } },
{ typeof(Basis.Scripts.BasisSdk.Interactions.BasisPickupInteractable), new HashSet<string> { } },
{ typeof(Basis.Scripts.Device_Management.Devices.BasisInput), new HashSet<string> { } },
{ typeof(UnityEngine.GameObject), new HashSet<string>{ nameof(GameObject.SetActive), nameof(GameObject.GetComponents) } },
{ typeof(System.Type), new HashSet<string>() }, // nothing allowed
};
Expand Down
Loading
Loading