Utilities/Constructors¶
Summary¶
namespace
ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor
namespace ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor
¶
Summary¶
enum
PrefabType
enum
PrefabMaterialType
enum
PumpMode
class
ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::AnimationMovePrefabConstructor
class
ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::CollisionHitPrefabConstructor
This script should be attached to gameObjects that their purpose is to be hit into place. Most common example is the gameObject being a pin ready to be hit by a hammer.
class
ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::DestroyTime
Most prefabs spawned for a specific action are destroyed but the time the action is completed. If a prefab needs to be destroyed in another action, it can be achieved using this class to select the action where it’s going to be destroyed.
class
ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::GenericPrefabConstructor
Almost all prefabs used in a scene have similar properties. Many of these properties are grouped into different types of PrefabConstructor scripts that all inherit this one the GenericPrefabConstructor. These scripts initialize the prefabs with the values provided in the inspector by the script itself. They also check if the prefabs contain all the essential components and it automatically adds them if anything is missing otherwise it produces a runtime error explaining what is wrong with the prefab.
class
ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::InteractableFinalPlacementPrefabConstructor
This script is for the prefabs that are placed to the final position, and wait for the duplicated interactable prefabs to be inserted by the user in their own position
class
ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::InteractablePrefabConstructor
This script is for any prefab that can be grabbed from the User. It has physics properties and when spawned it is stored to the PrefabSpawnManager and it’s observed regularly. In case of a bug (mostly due to physics) it will be respawned with it’s starting transform.
class
ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::InteractableWithParentPrefabConstructor
This script inherits from InteractablePrefabConstructor and works in exactly the same way Only difference is that the gameObject this script is attach to, it is a child of another gameObject that does NOT have interactable attributes
class
ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::NonTriggerColliderPrefabConstructor
This script should be attached to prefabs with only non triggered colliders that can be (physically only) interacted with the user (e.g. pushing)
class
ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::PumpPrefabConstrutor
class
ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::QuestionPrefabConstructor
class
ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::RemoveWithToolsCostructor
This script is for any prefab that needs to be interacted by the user with the use of another Tool. This script as a component by itself will have a dropdown list for the developer to choose the tools that can grab the gameObject that this script is attached to.
class
ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::ToolAndTime
Keeps for each tool how much time it needs to interact with each collider
class
ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::ToolColliderPrefabConstructor
This script should be attach to a gameObject which is just a grouping parent of many children where each one is a separate collider. This gameObject will interact with any tool given with the dropdown list. By interacting we mean that when the tool collides with one of the colliders, it destroys the collider after the time given. if all the colliders-children of the gameObject are destroyed, this script will trigger the EventManager as the gameObject’s function is considered complete.
class
ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::UseColliderPrefabConstructor
Generally the purpose of this script is that the collider attached to the gameObject containing this script expects a collision OLNY with all the prefabs that are dragged n dropped in this component’s dropdown list. If it detects that the collision comes from one of the desired prefabs, and the timer during this collision passed the minimum amount of time given (variable stayTime), this gameObject’s function is considered complete.
Members¶
enum
PrefabType
¶
Generic
Interactable
InteractableWithParent
InteractableFinalPlacement
ToolActionCollider
UseActionCollider
NonTriggerCollider
CollisionHit
ToolRemoval
Question
AnimationPrefab
Pump
enum
PrefabActionOnPerform
¶
Destroy
Remain
enum
PrefabAvailableLayers
¶
Default
GrabbablePrefabs
TriggerColliderLesson
NoTriggerColliderLesson
AvatarLayer
ignoreAll
enum
PrefabMaterialType
¶
Metal
Plastic
Cloth
enum
PrefabInteractableType
¶
Generic
Insert
Remove
enum
OnPrefabDetachFeature
¶
ReInitialize
Destroy
EventTriggerCurrLSAOnDestroy
Nothing
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::AnimationMovePrefabConstructor
¶
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::AnimationMovePrefabConstructor
: public ovidVR.Utilities.prefabSpawnManager.prefabSpawnConstructor.GenericPrefabConstructor
Summary¶
public float
stayTime
public float
targetPercentage
public inline virtual override void
FinalizePrefabAction
()
when action is complete it calls this function on the prefab to finalise it’s behavior
public inline virtual override void
FinalizeByNetwork
()
Internal function for the multiplayer, Ignore
public inline void
SetOnStayTimeAction
(Action< float > _action)
Set a callback function for the collision This function will be called every fixed frame during the collision
protected inline virtual override void
Start
()
Members¶
public float
targetPercentage
¶
public inline virtual override void
FinalizePrefabAction
()
¶
when action is complete it calls theis function on the prefab to finalise it’s behavior
public inline virtual override void
FinalizeByNetwork
()
¶
Internal function for the multiplayer, Ignore
public inline void
SetOnStayTimeAction
(Action< float > _action)
¶
Set a callback function for the collision This function will be called every fixed frame during the collision
Parameters¶
_action
set function with float parameter
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::CollisionHitPrefabConstructor
¶
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::CollisionHitPrefabConstructor
: public ovidVR.Utilities.prefabSpawnManager.prefabSpawnConstructor.GenericPrefabConstructor
This script should be attached to gameObjects that their purpose is to be hit into place. Most common example is the gameObject being a pin ready to be hit by a hammer.
The gameObject’s set up is very specific. It must be placed to it’s final position (where it should be after the hits). Then select in what direction it should go after each hit and finally insert the hit count and the step size per hit. On start the gameObject will translate in the opposide direction of the hit direction selected from the developer. The translated distance is: hitStep * hitCount
The gameObject upon impact with the tool will measure the tool’s velocity. If the velocity is smaller than the value given (minMagnitude) it will ignore the collision.
NOTICE both gameObject and tool need to have Rigidbodies to measure velocity as it is a Physics variable.
Summary¶
public ToolsEnum
tool
public float
hitStep
public int
hitCount
public float
minMagnitude
public float
collisionTimeDiff
public inline virtual override void
FinalizePrefabAction
()
when action is complete it calls this function on the prefab to finalize it’s behavior
public inline virtual override void
FinalizeByNetwork
()
Called when a hit activated by remote user Called for each hit, also display percentage for all other users
protected
VectorSelection
vectorDirection
protected inline virtual override void
Start
()
protected inline virtual override void
OnTriggerEnter
(Collider other)
Members¶
public float
minMagnitude
¶
public float
collisionTimeDiff
¶
public inline virtual override void
FinalizePrefabAction
()
¶
when action is complete it calls theis function on the prefab to finalise it’s behavior
public inline virtual override void
FinalizeByNetwork
()
¶
Called when a hit activated by remote user Called for each hit, also display persentage for all other users
protected
VectorSelection
vectorDirection
¶
protected inline virtual override void
OnTriggerEnter
(Collider other)
¶
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::DestroyTime
¶
Most prefabs spawned for a specific action are destroyed but the time the action is completed. If a prefab needs to be destroyed in another action, it can be achieved using this class to select the action where it’s going to be destoryed.
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::GenericPrefabConstructor
¶
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::GenericPrefabConstructor
: public MonoBehaviour
Almost all prefabs used in a scene have similar properties. Many of these properties are grouped into different types of PrefabConstructor scripts that all inherit this one the GenericPrefabConstructor. These scripts initialize the prefabs with the values provided in the inspector by the script itself. They also check if the prefabs contain all the essential components and it automatically adds them if anything is missing otherwise it produces a runtime error explaining what is wrong with the prefab.
NOTICE This perticular script should not be used by itself on any prefab as it just contains all the common functions. Only the inherited members should be attached.
PrefabMaterialType is used for different sounds. Being still under development it will not -in most cases- work
REQUIREMENTS The Unity Project MUST have at least the layers below in order for the Prefab Constructors to work* Default
GrabbablePrefabs
TriggerColliderLesson
NoTriggerColliderLesson
This is important in order to minimize the observed collision between layers. This can be done by changing the Layer Collision Matrix in Edit->Project Settings->Physics
Summary¶
{property} string
EventManagerTriggerKey
public List<
DestroyTime
>
destroyTime
Selected the actions where the prefab can be deleted. Leave empty if the prefab is goind to be destroyed by the same action that spawned it
public bool
enableKinematicOnReset
If true forces kinematic on rigidbody on reset.
public
PrefabType
prefabType
public
PrefabActionOnPerform
prefabPerformAction
public Action
onPerformDelete
public inline void
SetOnPerformAction
(Action call)
public inline virtual void
ResetPrefab
()
Resets the prefab to the position and rotation it had when spawned
public inline virtual void
[SetNewPrefabStartingTransform
]
(#classovid_v_r_1_1_utilities_1_1prefab_spawn_manager_1_1prefab_spawn_constructor_1_1_generic_prefab_constructor_1a9ace2d16ef224f0a9e3af7c3da71c379)()
Set new starting position and rotation for the prefab if the ones when spawned are not desired it applies the position and rotation at the time this function is called
public inline virtual void
SetNewPrefabCustomStartingTransform
(Vector3 ResetPosition,Quaternion ResetRotation)
THIS FUNCTION MUST BE CALLED AFTER INITIALIZE OR IT WILL BE IGNORED
public inline virtual void
FinalizePrefabAction
()
when action is complete it calls this function on the prefab to finalize it’s behavior
public inline virtual void
FinalizeByNetwork
()
Internal function for the multiplayer, Ignore
public inline virtual void
FindEventKey
()
Set the prefab’s EventManagerTriggerKey internally with teh correct key (action’s name)
protected string
eventTriggerKey
protected
PrefabAvailableLayers
differentLayer
protected
PrefabAvailableLayers
parentDifferentLayer
protected GameObject[]
childrenDifferentLayer
protected List< Transform >
allChildTransforms
protected Rigidbody
addedRigidBody
protected Vector3
startPosition
protected Quaternion
startRotation
protected AudioSource
prefabAudio
protected bool
hideDisplayPercentage
protected Action
onPerformFunction
This method will be set to Invoke after completing a specific pump prefab object
protected inline virtual void
Start
()
protected inline void
SetUpLayer
(int _layer)
protected inline void
SetUpRigidBody
(bool _kinematic)
Sets the prefab’s attributes according to the Rigidbody component
protected inline void
SetUpAudioSource
(string _soundName)
protected inline void
SetUpPrefabSpawnNotifier
()
protected inline virtual void
OnTriggerEnter
(Collider other)
protected inline virtual void
OnDestroy
()
Members¶
{property} string
EventManagerTriggerKey
¶
public List<
DestroyTime
>
destroyTime
¶
Selected the actions where the prefab can be deleted. Leave empty if the prefab is goind to be destroyed by the same action that spawned it
public bool
enableKinematicOnReset
¶
If true forces kinematic on rigidbody on reset.
public
PrefabType
prefabType
¶
public Action
onPerformDelete
¶
public inline void
SetOnPerformAction
(Action call)
¶
public inline virtual void
ResetPrefab
()
¶
Resets the prefab to the position and rotation it had when spawned
public inline virtual void
SetNewPrefabStartingTransform
()
¶
Set new starting position and rotation for the prefab if the ones when spawned are not desired it applies the position and rotation at the time this function is called
public inline virtual void
SetNewPrefabCustomStartingTransform
(Vector3 ResetPosition,Quaternion ResetRotation)
¶
THIS FUNCTION MUST BE CALLED AFTER INITIALIZE OR IT WILL BE IGNORED
Set new starting position and rotation for the prefab if the ones when spawned are not desired it applies the position and rotation at the time this function is called
Parameters¶
ResetPosition
New reset postionResetRotation
New reset rotation
public inline virtual void
FinalizePrefabAction
()
¶
when action is complete it calls theis function on the prefab to finalise it’s behavior
public inline virtual void
FinalizeByNetwork
()
¶
Internal function for the multiplayer, Ignore
public inline virtual void
FindEventKey
()
¶
Set the prefab’s EventManagerTriggerKey internally with teh correct key (action’s name)
protected string
eventTriggerKey
¶
protected
PrefabAvailableLayers
differentLayer
¶
protected
PrefabAvailableLayers
parentDifferentLayer
¶
protected GameObject[]
childrenDifferentLayer
¶
protected List< Transform >
allChildTransforms
¶
protected Rigidbody
addedRigidBody
¶
protected Vector3
startPosition
¶
protected Quaternion
startRotation
¶
protected AudioSource
prefabAudio
¶
protected bool
hideDisplayPercentage
¶
protected Action
onPerformFunction
¶
This method will be set to Invoke after completing a specific pump prefab object
protected inline void
SetUpLayer
(int _layer)
¶
protected inline void
SetUpRigidBody
(bool _kinematic)
¶
Sets the prefab’s attributes according to the Rigidbody component
The Rigidboby Component Initializes The Prefab Constructor
Parameters¶
_kinematic
protected inline void
SetUpAudioSource
(string _soundName)
¶
protected inline void
SetUpPrefabSpawnNotifier
()
¶
protected inline virtual void
OnTriggerEnter
(Collider other)
¶
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::InteractableFinalPlacementPrefabConstructor
¶
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::InteractableFinalPlacementPrefabConstructor
: public ovidVR.Utilities.prefabSpawnManager.prefabSpawnConstructor.GenericPrefabConstructor
This script is for the prefabs that are placed to the final position, and wait for the duplicated interactable prefabs to be inserted by the user in their own position
REQUIREMENTS PrefabLerpPlacement
Summary¶
public inline virtual override void
FinalizePrefabAction
()
when action is complete it calls this function on the prefab to finalize it’s behavior
public inline virtual override void
FinalizeByNetwork
()
Internal function for the multiplayer, Ignore
public inline virtual override void
FindEventKey
()
Set the prefab’s EventManagerTriggerKey internally with teh correct key (action’s name)
protected inline virtual override void
Start
()
Members¶
public inline virtual override void
FinalizePrefabAction
()
¶
when action is complete it calls theis function on the prefab to finalise it’s behavior
public inline virtual override void
FinalizeByNetwork
()
¶
Internal function for the multiplayer, Ignore
public inline virtual override void
FindEventKey
()
¶
Set the prefab’s EventManagerTriggerKey internally with teh correct key (action’s name)
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::InteractablePrefabConstructor
¶
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::InteractablePrefabConstructor
: public ovidVR.Utilities.prefabSpawnManager.prefabSpawnConstructor.GenericPrefabConstructor
This script is for any prefab that can be grabbed from the User. It has physics properties and when spawned it is stored to the PrefabSpawnManager and it’s observed regularly. In case of a bug (mostly due to physics) it will be respawned with it’s strarting transform.
NOTICE ALL prefabs with this script HAVE enabled gravity! if rigidbody is selected to be kinematic then the prefab will be frozen to it’s spawned position as a kinematic until it is grabbed. Upon grabbing the rigidbody will disable it’s kinematic property and re-enable gravity. This is useful for prefabs that spawn into a weird position that in theory should not be affected by gravity.
REQUIREMENTS* Rididbody
Colliders
ovidVRInteractableItem
Summary¶
public
PrefabInteractableType
prefabInteractableType
public
OnPrefabDetachFeature
prefabDetachFeature
public bool
allowPrefabManualReset
public inline virtual override void
ResetPrefab
()
Resets the prefab to the position and rotation it had when spawned
public inline virtual override void
FinalizeByNetwork
()
Internal function for the multiplayer, Ignore
protected float
minDistanceReset
protected OvidVRInteractable
prefabInteract
protected string
audioMaterial
protected bool
prefabDropped
protected bool
isRightHand
protected inline virtual override void
Start
()
protected inline virtual IEnumerator
SetUpInteractableItemListeners
()
protected inline void
PrefabPicked
()
protected inline void
PrefabDropped
()
protected inline virtual override void
OnTriggerEnter
(Collider other)
Members¶
public bool
allowPrefabManualReset
¶
public inline virtual override void
ResetPrefab
()
¶
Resets the prefab to the position and rotation it had when spawned
public inline virtual override void
FinalizeByNetwork
()
¶
Internal function for the multiplayer, Ignore
protected float
minDistanceReset
¶
protected OvidVRInteractable
prefabInteract
¶
protected string
audioMaterial
¶
protected bool
prefabDropped
¶
protected bool
isRightHand
¶
protected inline virtual IEnumerator
SetUpInteractableItemListeners
()
¶
protected inline void
PrefabPicked
()
¶
protected inline void
PrefabDropped
()
¶
protected inline virtual override void
OnTriggerEnter
(Collider other)
¶
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::InteractableWithParentPrefabConstructor
¶
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::InteractableWithParentPrefabConstructor
: public ovidVR.Utilities.prefabSpawnManager.prefabSpawnConstructor.InteractablePrefabConstructor
This script inherits from InteractablePrefabConstructor and works in exactly the same way Only difference is that the gameObject this script is attach to, it is a child of another gameObject that does NOT have interactable attributes
e.g. for a simple tool in the scene that has no parent we attach InteractablePrefabConstructor. But for a lever that is interactable and it is a child of a non interactable wall (wall as a gameObject as well) we attach the InteractableWithParentPrefabConstructorto the lever to be able to be used by the user.
NOTICE Unity’s parenting does not work well with physics behavior and interaction attached to gameObjects. This script is still under development
Summary¶
public inline virtual override void
ResetPrefab
()
Resets the prefab to the position and rotation it had when spawned
public inline virtual override void
FinalizeByNetwork
()
Internal function for the multiplayer, Ignore
protected inline virtual override void
Start
()
protected inline virtual override IEnumerator
[SetUpInteractableItemListeners
(#classovid_v_r_1_1_utilities_1_1prefab_spawn_manager_1_1prefab_spawn_constructor_1_1_interactable_with_parent_prefab_constructor_1a7e1e946ff737693815c441d0e85fde4c)()
protected inline virtual override void
OnTriggerEnter
(Collider other)
Members¶
public inline virtual override void
ResetPrefab
()
¶
Resets the prefab to the position and rotation it had when spawned
public inline virtual override void
FinalizeByNetwork
()
¶
Internal function for the multiplayer, Ignore
protected inline virtual override IEnumerator
SetUpInteractableItemListeners
()
¶
protected inline virtual override void
OnTriggerEnter
(Collider other)
¶
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::NonTriggerColliderPrefabConstructor
¶
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::NonTriggerColliderPrefabConstructor
: public ovidVR.Utilities.prefabSpawnManager.prefabSpawnConstructor.GenericPrefabConstructor
This script should be attached to prefabs with only non triggered colliders that can be (physically only) interacted with the user (e.g. pushing)
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::PumpPrefabConstrutor
¶
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::PumpPrefabConstrutor
: public ovidVR.Utilities.prefabSpawnManager.prefabSpawnConstructor.GenericPrefabConstructor
Summary¶
public int
pumpsToPerform
public bool
pauseAnimationOnPerform
public float
vibration
public bool
reverseAnimation
public bool
playSound
public bool
continious
public bool
pressTrigger
public bool
enableRangeMode
public float
lowEndToPerform
public float
[highEndToPerform
(#classovid_v_r_1_1_utilities_1_1prefab_spawn_manager_1_1prefab_spawn_constructor_1_1_pump_prefab_construtor_1a3560edca6c460245258ad37503740ca8)
public float
stayTime
public AnimationClip
rightHandAnimation
public AnimationClip
leftHandAnimation
public string
gameObjectName
public string
externalStateName
public bool
interacting
public bool
waitForAllPumpPrefabs
public inline void
PlayPumpSound
()
public inline void
SetTotalPumps
(int pumpsID)
public inline void
SetInteracting
(bool value)
public inline string
GetAttachedHand
()
public inline void
SetRestPumpInteractables
(List< GameObject > pumpGoList)
Sets references to all the rest pump gameobjects of the current action.
public inline virtual override void
FinalizePrefabAction
()
Finalizes the Action by removing unnecessary components or destroying the gameObject based on the PrefabActionOnPerform option
public inline float
GetPumpProgressValue
()
public inline virtual override void
FinalizeByNetwork
()
Internal function for the multiplayer, Ignore
protected inline virtual override void
Start
()
Members¶
public int
pumpsToPerform
¶
public bool
pauseAnimationOnPerform
¶
public bool
reverseAnimation
¶
public bool
continious
¶
public bool
pressTrigger
¶
public bool
enableRangeMode
¶
public float
lowEndToPerform
¶
public float
highEndToPerform
¶
public AnimationClip
rightHandAnimation
¶
public AnimationClip
leftHandAnimation
¶
public string
gameObjectName
¶
public string
externalStateName
¶
public bool
interacting
¶
public bool
waitForAllPumpPrefabs
¶
public inline void
PlayPumpSound
()
¶
public inline void
SetTotalPumps
(int pumpsID)
¶
public inline void
SetInteracting
(bool value)
¶
public inline string
GetAttachedHand
()
¶
public inline void
SetRestPumpInteractables
(List< GameObject > pumpGoList)
¶
Sets references to all the rest pump gameobjects of the current action.
public inline virtual override void
FinalizePrefabAction
()
¶
Finalizest the Action by removing unesessary components or destroying the gameObject based on the PrefabActionOnPerform option
public inline float
GetPumpProgressValue
()
¶
public inline virtual override void
FinalizeByNetwork
()
¶
Internal function for the multiplayer, Ignore
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::QuestionPrefabConstructor
¶
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::QuestionPrefabConstructor
: public ovidVR.Utilities.prefabSpawnManager.prefabSpawnConstructor.GenericPrefabConstructor
Summary¶
public string
setChildEventByNetwork
public inline virtual override void
FinalizePrefabAction
()
when action is complete it calls theis function on the prefab to finalise it’s behavior
public inline virtual override void
FinalizeByNetwork
()
Internal function for the multiplayer, Ignore
public inline int
GetNumOfWrongAnswers
()
protected inline virtual override void
Start
()
Members¶
public string
setChildEventByNetwork
¶
public inline virtual override void
FinalizePrefabAction
()
¶
when action is complete it calls theis function on the prefab to finalise it’s behavior
public inline virtual override void
FinalizeByNetwork
()
¶
Internal function for the multiplayer, Ignore
public inline int
GetNumOfWrongAnswers
()
¶
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::RemoveWithToolsCostructor
¶
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::RemoveWithToolsCostructor
: public ovidVR.Utilities.prefabSpawnManager.prefabSpawnConstructor.GenericPrefabConstructor
This script is for any prefab that needs to be interacted by the user with the use of another Tool. This script as a component by itself will have a dropdown list for the developer to choose the tools that can grab the gameObject that this script is attached to.
The list will contain the tools created inside Unity using ovidVR/Create Tools DLL.
NOTICE This script currently ONLY works for prefabs that are already placed somewhere and have the need to be removed from there and be thrown away.
Summary¶
public inline virtual override void
FinalizeByNetwork
()
Internal function for the multiplayer, Ignore
public inline virtual override void
FinalizePrefabAction
()
when action is complete it calls theis function on the prefab to finalise it’s behavior
protected inline virtual override void
Start
()
protected inline virtual override void
OnTriggerEnter
(Collider other)
On Trigger Enter check if it is a Tool that can grab this prefab
protected inline virtual override void
OnDestroy
()
Members¶
public inline virtual override void
FinalizeByNetwork
()
¶
Internal function for the multiplayer, Ignore
public inline virtual override void
FinalizePrefabAction
()
¶
when action is complete it calls theis function on the prefab to finalise it’s behavior
protected inline virtual override void
OnTriggerEnter
(Collider other)
¶
On Trigger Enter check if it is a Tool that can grab this prefab
Parameters¶
other
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::ToolAndTime
¶
Keeps for each tool how much time it needs to itneract with each collider
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::ToolColliderPrefabConstructor
¶
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::ToolColliderPrefabConstructor
: public ovidVR.Utilities.prefabSpawnManager.prefabSpawnConstructor.GenericPrefabConstructor
This script should be attach to a gameObject which is just a grouping parent of many children where each one is a separate collider. This gameObject will interact with any tool given with the dropdown list. By interacting we mean that when the tool collides with one of the colldiers, it destroys the collider after the time given. if all the colliders-children of the gameObject are destoryed, this script will trigger the EventManager as the gameObject’s function is considered complete.
When spawned, every 1st depth child is attached with the script ToolTriggerCollider
REQUIREMENTS* only 1st depth children
all children must be identical (simple colliders)
Summary¶
{property} List<
ToolAndTime
>
ToolsList
public int
numberOfColliders
public string
setChildEventByNetwork
public inline void
CollisionEvent
(GameObject colliderTriggered)
For Internal Use between plug-ins DO NOT call manually
public inline void
SetOnStayTimeAction
(Action< float > _action)
Set a callback function for the collision This function will be called every fixed frame during the collision
public inline virtual override void
FinalizeByNetwork
()
Internal function for the multiplayer, Ignore
protected inline virtual override void
Start
()
Members¶
{property} List<
ToolAndTime
>
ToolsList
¶
public int
numberOfColliders
¶
public string
setChildEventByNetwork
¶
public inline void
CollisionEvent
(GameObject colliderTriggered)
¶
For Internal Use between plug-ins DO NOT call manually
Parameters¶
colliderTriggered
public inline void
SetOnStayTimeAction
(Action< float > _action)
¶
Set a callback function for the collision This function will be called every fixed frame during the collision
Parameters¶
_action
set function with float parameter
public inline virtual override void
FinalizeByNetwork
()
¶
Internal function for the multiplayer, Ignore
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::UseColliderPrefabConstructor
¶
class ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::UseColliderPrefabConstructor
: public ovidVR.Utilities.prefabSpawnManager.prefabSpawnConstructor.GenericPrefabConstructor
Generally the purpose of this script is that the collider attached to the gameObject containing this script expects a collision OLNY with all the prefabs that are dragged n dropped in this component’s dropdown list. If it detects that the collision comes from one of the desired prefabs, and the timer during this collision passed the minimum amount of time given (variable stayTime), this gameObject’s function is considered complete.
Summary¶
public float
stayTime
public inline virtual override void
FinalizeByNetwork
()
Internal function for the multiplayer, Ignore
public inline void
SetOnStayTimeAction
(Action< float > _action)
Set a callback function for the collision This function will be called every fixed frame during the collision
protected inline virtual override void
Start
()
Members¶
public inline virtual override void
FinalizeByNetwork
()
¶
Internal function for the multiplayer, Ignore
public inline void
SetOnStayTimeAction
(Action< float > _action)
¶
Set a callback function for the collision This function will be called every fixed frame during the collision
Parameters¶
_action
set function with float parameter
struct ovidVR::Utilities::prefabSpawnManager::prefabSpawnConstructor::InteractableWithParentPrefabConstructor::InteractableParent
¶
Summary¶
public Transform
parentTransform
public Rigidbody
parentRigidbody
public OvidVRInteractable
parentInteract
public inline
InteractableParent
(Transform _t,Rigidbody _r,OvidVRInteractable _i)