//------------------------ // Init //------------------------ void Start() { if (this.gameObject.GetComponent <SVAbstractGripIndicator>()) { gripIndicatorComponent = this.gameObject.GetComponent <SVAbstractGripIndicator>(); } this.input = this.gameObject.GetComponent <SVControllerInput>(); this.rb = this.GetComponent <Rigidbody>(); this.colliders = (Collider[])SVUtilities.AllComponentsOfType <Collider>(gameObject); if (SVGrabbable.leftHandCollider == null) { GameObject obj = new GameObject("Left Hand Collider"); obj.AddComponent <SVColliderUpdater>().isLeft = true; SVGrabbable.leftHandCollider = obj; } if (SVGrabbable.rightHandCollider == null) { GameObject obj = new GameObject("Right Hand Collider"); obj.AddComponent <SVColliderUpdater>().isLeft = false; SVGrabbable.rightHandCollider = obj; } }
// Use this for initialization void Start() { this.grabComponent = GetComponent <SVGrabbable> (); this.fireBulletComponent = GetComponent <SVFireBullet> (); this.input = this.gameObject.GetComponent <SVControllerInput> (); linearAccelerationTracker = new SVLinearAcceleration(); revolvingBarrel.revolverParent = this; this.SetupComponents(); }
// Use this for initialization void Awake() { this.input = this.GetComponent <SVControllerInput>(); this.controllerCollider = gameObject.AddComponent <SphereCollider>(); this.controllerCollider.radius = kKnockableColliderSize; this.controllerCollider.center = kKnockableColliderPosition; rb = gameObject.AddComponent <Rigidbody>(); rb.mass = kHandMass; rb.isKinematic = false; gameObject.hideFlags = HideFlags.HideInHierarchy; }
void Start() { grabbable = this.GetComponent <SVGrabbable>(); input = this.GetComponent <SVControllerInput>(); }
//------------------------ // Init //------------------------ void Start() { outlineComponent = this.gameObject.GetComponent <SVOutline>(); this.input = this.gameObject.GetComponent <SVControllerInput> (); }