deltavr multiplayer 2.0
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
|
||||
namespace UnityEngine.XR.Content.Interaction.Analytics
|
||||
{
|
||||
/// <summary>
|
||||
/// Class that connects the 3DUI Interaction station scene objects with their respective analytics events.
|
||||
/// </summary>
|
||||
[AddComponentMenu("")]
|
||||
[DisallowMultipleComponent]
|
||||
class Xrc3DUIInteractionStationAnalytics : MonoBehaviour
|
||||
{
|
||||
[Header("3DUI Simple Controls Substation")]
|
||||
[SerializeField]
|
||||
XRLever m_Lever;
|
||||
|
||||
[SerializeField]
|
||||
XRJoystick m_Joystick;
|
||||
|
||||
[SerializeField]
|
||||
XRKnob m_Dial;
|
||||
|
||||
[SerializeField]
|
||||
XRKnob m_Wheel;
|
||||
|
||||
[SerializeField]
|
||||
XRSlider m_Slider;
|
||||
|
||||
[SerializeField]
|
||||
XRGripButton m_GripButton;
|
||||
|
||||
[SerializeField]
|
||||
XRPushButton m_PushButton;
|
||||
|
||||
[Header("Claw Machine Substation")]
|
||||
[SerializeField]
|
||||
XRJoystick m_ClawMachineJoystick;
|
||||
|
||||
[SerializeField]
|
||||
XRPushButton m_ClawMachinePushButton;
|
||||
|
||||
[SerializeField]
|
||||
XRSocketInteractor m_UfoGrabberSocket;
|
||||
|
||||
[SerializeField]
|
||||
XRBaseInteractable[] m_PrizeInteractables;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
XrcAnalyticsUtils.Register(m_Lever, new LeverInteraction());
|
||||
XrcAnalyticsUtils.Register(m_Joystick, new JoystickInteraction());
|
||||
XrcAnalyticsUtils.Register(m_Dial, new DialInteraction());
|
||||
XrcAnalyticsUtils.Register(m_Wheel, new WheelInteraction());
|
||||
XrcAnalyticsUtils.Register(m_Slider, new SliderInteraction());
|
||||
XrcAnalyticsUtils.Register(m_GripButton, new GripButtonPressed());
|
||||
XrcAnalyticsUtils.Register(m_PushButton, new PushButtonPressed());
|
||||
|
||||
XrcAnalyticsUtils.Register(m_ClawMachineJoystick, new ClawMachineJoystickInteraction());
|
||||
XrcAnalyticsUtils.Register(m_ClawMachinePushButton, new ClawMachinePushButtonPressed());
|
||||
XrcAnalyticsUtils.Register(m_UfoGrabberSocket, new ConnectClawMachineToPrize());
|
||||
XrcAnalyticsUtils.Register(m_PrizeInteractables, new GrabClawMachinePrize());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b5d488e69bc9d004dbebfd7cfe3f3103
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,59 @@
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
|
||||
namespace UnityEngine.XR.Content.Interaction.Analytics
|
||||
{
|
||||
/// <summary>
|
||||
/// Class that connects the Active Interactable station scene objects with their respective analytics events.
|
||||
/// </summary>
|
||||
[AddComponentMenu("")]
|
||||
[DisallowMultipleComponent]
|
||||
class XrcActiveInteractableStationAnalytics : MonoBehaviour
|
||||
{
|
||||
[Header("Active SimpleObject Substation")]
|
||||
[SerializeField]
|
||||
XRBaseInteractable[] m_SimpleActiveInteractables;
|
||||
|
||||
[Header("Candle Substation")]
|
||||
[SerializeField]
|
||||
XRBaseInteractable m_LighterInteractable;
|
||||
|
||||
[SerializeField]
|
||||
XRBaseInteractable[] m_CandleInteractables;
|
||||
|
||||
[SerializeField]
|
||||
OnTrigger[] m_CandleTriggers;
|
||||
|
||||
[Header("Launcher Substation")]
|
||||
[SerializeField]
|
||||
XRBaseInteractable m_LauncherInteractable;
|
||||
|
||||
[SerializeField]
|
||||
OnTrigger m_EasyRingTrigger;
|
||||
|
||||
[SerializeField]
|
||||
OnTrigger m_MediumRingTrigger;
|
||||
|
||||
[SerializeField]
|
||||
OnTrigger m_HardRingTrigger;
|
||||
|
||||
[Header("Megaphone Substation")]
|
||||
[SerializeField]
|
||||
XRBaseInteractable m_MegaphoneInteractable;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
XrcAnalyticsUtils.Register(m_SimpleActiveInteractables, new GrabActiveSimpleObject(), new SimpleObjectActivated());
|
||||
|
||||
XrcAnalyticsUtils.Register(m_LighterInteractable, new GrabLighter(), new LighterActivated());
|
||||
XrcAnalyticsUtils.Register(m_CandleInteractables, new GrabCandle());
|
||||
XrcAnalyticsUtils.Register(m_CandleTriggers, new LightCandle());
|
||||
|
||||
XrcAnalyticsUtils.Register(m_LauncherInteractable, new GrabLauncher(), new LauncherActivated());
|
||||
XrcAnalyticsUtils.Register(m_EasyRingTrigger, new LauncherEasyTargetHit());
|
||||
XrcAnalyticsUtils.Register(m_MediumRingTrigger, new LauncherMediumTargetHit());
|
||||
XrcAnalyticsUtils.Register(m_HardRingTrigger, new LauncherHardTargetHit());
|
||||
|
||||
XrcAnalyticsUtils.Register(m_MegaphoneInteractable, new GrabMegaphone(), new MegaphoneActivated());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d919f1db183c42d4cac3edda16164e63
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,94 @@
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
|
||||
namespace UnityEngine.XR.Content.Interaction.Analytics
|
||||
{
|
||||
/// <summary>
|
||||
/// Class that connects the Grab Interactable station scene objects with their respective analytics events.
|
||||
/// </summary>
|
||||
[AddComponentMenu("")]
|
||||
[DisallowMultipleComponent]
|
||||
class XrcGrabInteractableStationAnalytics : MonoBehaviour
|
||||
{
|
||||
const float k_FrequencyToSendWateringPlant = 4f;
|
||||
|
||||
static readonly WateringPlant k_WateringPlantParameter = new WateringPlant();
|
||||
static readonly BreakPiggyBank k_BreakPiggyBankParameter = new BreakPiggyBank();
|
||||
|
||||
[Header("Simple Object Substation")]
|
||||
[SerializeField]
|
||||
XRBaseInteractable[] m_InstantInteractables;
|
||||
|
||||
[SerializeField]
|
||||
XRBaseInteractable[] m_KinematicInteractables;
|
||||
|
||||
[SerializeField]
|
||||
XRBaseInteractable[] m_VelocityInteractables;
|
||||
|
||||
[Header("Watering Can Substation")]
|
||||
[SerializeField]
|
||||
XRBaseInteractable m_WateringCanInteractable;
|
||||
|
||||
[SerializeField]
|
||||
OnTrigger m_OnPlantGrowsTrigger;
|
||||
|
||||
[Header("Piggy Bank Substation")]
|
||||
[SerializeField]
|
||||
XRBaseInteractable m_MalletInteractable;
|
||||
|
||||
[SerializeField]
|
||||
GameObject m_PigBank;
|
||||
|
||||
[Header("Ribbon Stick Substation")]
|
||||
[SerializeField]
|
||||
XRBaseInteractable m_RibbonStickInteractable;
|
||||
|
||||
float m_TimeToSendWateringPlant;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
XrcAnalyticsUtils.Register(m_InstantInteractables, new GrabSimpleObjectInstant());
|
||||
XrcAnalyticsUtils.Register(m_KinematicInteractables, new GrabSimpleObjectKinematic());
|
||||
XrcAnalyticsUtils.Register(m_VelocityInteractables, new GrabSimpleObjectVelocity());
|
||||
|
||||
XrcAnalyticsUtils.Register(m_WateringCanInteractable, new GrabWateringCan());
|
||||
if (m_OnPlantGrowsTrigger != null)
|
||||
m_OnPlantGrowsTrigger.onEnter.AddListener(OnWateringPlant);
|
||||
|
||||
XrcAnalyticsUtils.Register(m_MalletInteractable, new GrabMallet());
|
||||
OnRestorePiggyBank(m_PigBank);
|
||||
|
||||
XrcAnalyticsUtils.Register(m_RibbonStickInteractable, new GrabRibbonStick());
|
||||
}
|
||||
|
||||
void OnWateringPlant(GameObject otherGameObject)
|
||||
{
|
||||
if (Time.unscaledTime < m_TimeToSendWateringPlant)
|
||||
return;
|
||||
|
||||
m_TimeToSendWateringPlant = Time.unscaledTime + k_FrequencyToSendWateringPlant;
|
||||
XrcAnalytics.interactionEvent.Send(k_WateringPlantParameter);
|
||||
}
|
||||
|
||||
void OnRestorePiggyBank(GameObject piggyBank)
|
||||
{
|
||||
if (piggyBank == null)
|
||||
return;
|
||||
|
||||
var breakable = piggyBank.GetComponent<Breakable>();
|
||||
if (breakable != null)
|
||||
breakable.onBreak.AddListener(OnBreakPiggyBank);
|
||||
}
|
||||
|
||||
void OnBreakPiggyBank(GameObject otherGameObject, GameObject brokenGameObject)
|
||||
{
|
||||
XrcAnalytics.interactionEvent.Send(k_BreakPiggyBankParameter);
|
||||
|
||||
if (brokenGameObject == null)
|
||||
return;
|
||||
|
||||
var unbreakable = brokenGameObject.GetComponent<Unbreakable>();
|
||||
if (unbreakable != null)
|
||||
unbreakable.onRestore.AddListener(OnRestorePiggyBank);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 64441dc1ef91cb442884a1d08fffdc1c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,72 @@
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
|
||||
namespace UnityEngine.XR.Content.Interaction.Analytics
|
||||
{
|
||||
/// <summary>
|
||||
/// Class that connects the Physics Interaction station scene objects with their respective analytics events.
|
||||
/// </summary>
|
||||
[AddComponentMenu("")]
|
||||
[DisallowMultipleComponent]
|
||||
class XrcPhysicsInteractionStationAnalytics : MonoBehaviour
|
||||
{
|
||||
const float k_FrequencyToSendPushFlopDoor = 4f;
|
||||
|
||||
static readonly PushFlipDoor k_PushFlipDoorParameter = new PushFlipDoor();
|
||||
|
||||
[Header("Physics Simple Controls Substation")]
|
||||
[SerializeField]
|
||||
XRBaseInteractable[] m_SpringInteractables;
|
||||
|
||||
[SerializeField]
|
||||
XRBaseInteractable[] m_HingeInteractables;
|
||||
|
||||
[Header("Cabinet Example Substation")]
|
||||
[SerializeField]
|
||||
XRBaseInteractable m_Cabinet1Interactable;
|
||||
|
||||
[SerializeField]
|
||||
XRBaseInteractable m_Cabinet2Interactable;
|
||||
|
||||
[Header("Doors Example Substation")]
|
||||
[SerializeField]
|
||||
Rigidbody m_FlipDoorRigidbody;
|
||||
|
||||
[SerializeField]
|
||||
XRBaseInteractable m_DoorKeyInteractable;
|
||||
|
||||
[SerializeField]
|
||||
Door m_DoorLocked;
|
||||
|
||||
[SerializeField]
|
||||
XRBaseInteractable m_DoorHandleInteractable;
|
||||
|
||||
float m_TimeToSendPushFlopDoor;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
XrcAnalyticsUtils.Register(m_SpringInteractables, new GrabSpringJoint());
|
||||
XrcAnalyticsUtils.Register(m_HingeInteractables, new GrabHingeJoint());
|
||||
|
||||
XrcAnalyticsUtils.Register(m_Cabinet1Interactable, new GrabCabinet1());
|
||||
XrcAnalyticsUtils.Register(m_Cabinet2Interactable, new GrabCabinet2());
|
||||
|
||||
if (m_FlipDoorRigidbody != null)
|
||||
{
|
||||
var onCollision = m_FlipDoorRigidbody.gameObject.AddComponent<OnCollision>();
|
||||
onCollision.onEnter.AddListener(OnFlipDoorCollision);
|
||||
}
|
||||
XrcAnalyticsUtils.Register(m_DoorKeyInteractable, new GrabDoorKey());
|
||||
XrcAnalyticsUtils.Register(m_DoorLocked, new DoorLocked(), new DoorUnlocked());
|
||||
XrcAnalyticsUtils.Register(m_DoorHandleInteractable, new GrabDoorHandle());
|
||||
}
|
||||
|
||||
void OnFlipDoorCollision(Collision collision)
|
||||
{
|
||||
if (Time.unscaledTime < m_TimeToSendPushFlopDoor)
|
||||
return;
|
||||
|
||||
m_TimeToSendPushFlopDoor = Time.unscaledTime + k_FrequencyToSendPushFlopDoor;
|
||||
XrcAnalytics.interactionEvent.Send(k_PushFlipDoorParameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1af61162fa5f63a439f65912f4410ee5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace UnityEngine.XR.Content.Interaction.Analytics
|
||||
{
|
||||
/// <summary>
|
||||
/// Class that manages scene analytics events for <c>XRContent</c>.
|
||||
/// </summary>
|
||||
[AddComponentMenu("")]
|
||||
[DisallowMultipleComponent]
|
||||
class XrcSceneAnalytics : MonoBehaviour
|
||||
{
|
||||
void Awake()
|
||||
{
|
||||
XrcAnalytics.interactionEvent.Send(new SceneStarted());
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
void OnValidate()
|
||||
{
|
||||
gameObject.hideFlags = UnityEditor.Unsupported.IsDeveloperMode() ? HideFlags.None : HideFlags.HideInHierarchy | HideFlags.NotEditable;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1ff0aed9f9ef7084ca7f59a711befd28
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,48 @@
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
|
||||
namespace UnityEngine.XR.Content.Interaction.Analytics
|
||||
{
|
||||
/// <summary>
|
||||
/// Class that connects the Socket Interactors station scene objects with their respective analytics events.
|
||||
/// </summary>
|
||||
[AddComponentMenu("")]
|
||||
[DisallowMultipleComponent]
|
||||
class XrcSocketInteractorsStationAnalytics : MonoBehaviour
|
||||
{
|
||||
[Header("Socket Simple Object Substation")]
|
||||
[SerializeField]
|
||||
XRSocketInteractor m_SimpleSocket;
|
||||
|
||||
[Header("Perler Machine")]
|
||||
[SerializeField]
|
||||
XRSocketInteractor m_BatterySlotSocket;
|
||||
|
||||
[SerializeField]
|
||||
XRSocketInteractor[] m_InfinityPegSockets;
|
||||
|
||||
[SerializeField]
|
||||
Transform m_GridCenter;
|
||||
|
||||
void Start()
|
||||
{
|
||||
XrcAnalyticsUtils.Register(m_SimpleSocket, new ConnectSocketSimpleObject(), new DisconnectSocketSimpleObject());
|
||||
|
||||
XrcAnalyticsUtils.Register(m_BatterySlotSocket, new ConnectPerlerMachineBattery());
|
||||
|
||||
var grabPerlerBeadParameter = new GrabPerlerBead();
|
||||
foreach (var socket in m_InfinityPegSockets)
|
||||
{
|
||||
foreach (var interactable in socket.interactablesSelected)
|
||||
{
|
||||
XrcAnalyticsUtils.Register(interactable as XRBaseInteractable, grabPerlerBeadParameter);
|
||||
}
|
||||
|
||||
socket.selectEntered.AddListener(args => XrcAnalyticsUtils.Register(args.interactableObject as XRBaseInteractable, grabPerlerBeadParameter));
|
||||
}
|
||||
|
||||
var connectPerlerBeadParameter = new ConnectPerlerBead();
|
||||
foreach (var gridSocket in m_GridCenter.GetComponentsInChildren<XRSocketInteractor>())
|
||||
XrcAnalyticsUtils.Register(gridSocket, connectPerlerBeadParameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51e2b2d7ea5934243ad1542b8dc5f501
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user