Пример #1
0
        private void CreateObject()
        {
            CurrentState = ObjectManagerState.CREATING;

            // Create the object at midpoint between the two pinches
            Vector3 position = (_rightHandPinchDetector.Position - _leftHandPinchDetector.Position) * 0.5f;

            // Create the object and add to a list of objects
            GameObject newObject = Instantiate(_interactableObjects[_currentObjectTypeIndex].prefab, position, Quaternion.identity, _objectContainer) as GameObject;

            _currentObject = newObject.GetComponent <IInteractableObjectController>();
            CreatedObjects.Add(_currentObject);
            _currentObject.Create(_interactionManager, _leftHandPinchDetector, _rightHandPinchDetector);
        }
Пример #2
0
        private void MaterializeObject()
        {
            // If we don't have an object to materialize - return
            if (_currentObject == null)
            {
                return;
            }

            _currentObject.Materialize();

            // Set the gravity status
            _currentObject.LeapInteractionBehaviour.useGravity = GameManager.Instance.IsGravityOn;

            // Reset the ObjectManager state to READY so we can continue creating
            CurrentState   = ObjectManagerState.READY;
            _currentObject = null;
        }
Пример #3
0
 private void Awake()
 {
     objectController = GetComponent <IInteractableObjectController>();
     animator         = GetComponent <Animator>();
 }