VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
override void AVR.Phys.AVR_Grabbable.Awake ( )
inlineprotectedvirtual

Reimplemented from AVR.Core.AVR_Component.

Definition at line 73 of file AVR_Grabbable.cs.

74  {
75  base.Awake();
76  if (rb == null) rb = GetComponent<Rigidbody>();
77  if (colliders==null || colliders.Count<1) colliders.AddRange(GetComponentsInChildren<Collider>());
78  if (nodes == null || nodes.Count < 1) nodes.AddRange(GetComponentsInChildren<AVR_GrabNode>());
79  if (objectType == null) objectType = GrabbableObjectType.defaultObjectType();
80  if (source == null) source = GetComponent<AudioSource>();
81 
82  //Throw warnings if audiosource isnt a 3D blending source
83  if (source != null)
84  {
85  if (source.spatialBlend == 0.0f)
86  {
87  Debug.Log(this.name +
88  "'s Audio Source has no spatial blend. 3D audio will not work. Consider setting spatial blend to 1");
89  }
90  }
91  }
readonly List< AVR_GrabNode > nodes
AudioSource source
Optional AudioSource to play sounds from GrabbableObjectType data
GrabbableObjectType objectType
Type that describes the objects behaviour when grabbed.
Rigidbody rb
Rigidbody of this grabbable object.
List< Collider > colliders
List of colliders that describe the outer/grabbable surface. All colliders must be convex...