Beispiel #1
0
        private void PhysicsVolumeOnEntered(Collider collider)
        {
            Torquable torquable = collider.GetComponent <Torquable>();

            if (null != torquable && torquable.CanBeTorquedBy(this))
            {
                _entered.Add(torquable);
                if (_entered.Count == 1)
                {
                    _priorAngle = AngleOfTorquing();
                    MovementInteraction.SetOverrideDampTarget(_auxTransform);
                    MovementInteraction.MoveDamp     = 0;
                    MovementInteraction.RotationDamp = 0;
                    _audioSource.PlayOneShot(_attachSound);
                    MovementInteraction.HeldButtons[0].ParentInteractor.ParentUserController.FireHapticKey("Enter");
                }
            }
        }
        private void PhysicsVolumeOnEntered(Collider collider)
        {
            AttachableHolder holder = collider.GetComponent <AttachableHolder>();

            if (null != holder && holder.CanHold(this))
            {
                if (null != _attachSound)
                {
                    _audioSource.PlayOneShot(_attachSound);
                }
                _entered.Add(holder);
                if (_entered.Count == 1)
                {
                    MovementInteraction.SetOverrideDampTarget(holder.transform);
                }
                _events.Entered.Invoke(this, holder);
            }
        }