Esempio n. 1
0
 void triggerClicked(object sender, ClickedEventArgs e)
 {
     if (_objectCollidedWithHand == null)
     {
         select(inputManager.hand2.gameObject.transform.position, inputManager.hand2.gameObject.transform.forward);
     }
     else
     {
         _stateManagerMutatorRef.SET_SELECTED_OBJECT(null);
         initialPropParent = _objectCollidedWithHand.transform.parent;
         _objectCollidedWithHand.transform.parent = inputManager.hand2.transform;
     }
 }
Esempio n. 2
0
    void triggerClicked(object sender, ClickedEventArgs e)
    {
        if (_objectCollidedWithHand != null)
        {
            if (_objectCollidedWithHand != _selectedObject)
            {
                _stateManagerMutatorRef.SET_SELECTED_OBJECT(_objectCollidedWithHand);
                _objectCollidedWithHand.AddComponent <activeProp>();
            }

            _stateManagerMutatorRef.SET_SELECTED_OBJECT_IS_ACTIVE(true);
        }
    }
Esempio n. 3
0
    //--This is the raycast way to select this object
    public void receiveHit(RaycastHit hit)
    {
        // selected object selection
        if (gameObject == _selectedObject)
        {
            _stateManagerMutatorRef.SET_SELECTED_OBJECT_IS_ACTIVE(true);
        }

        // if new prop is selected
        else
        {
            _stateManagerMutatorRef.SET_SELECTED_OBJECT(hit.collider.gameObject);
            gameObject.AddComponent <activeProp>();
        }
    }
Esempio n. 4
0
    public void receiveHit(RaycastHit hit)
    {
        //get the correct object from the current chunk
        GameObject newProp = Instantiate(spawnableProp);

        newProp.name             = spawnableProp.name;
        newProp.transform.parent = _props.transform;
        newProp.SetActive(true);

        //set the spawned object to the new selected object
        _stateManagerMutatorRef.SET_SELECTED_OBJECT(newProp);
        newProp.transform.position = hit.point;

        newProp.AddComponent <activeProp>();
        _stateManagerMutatorRef.SET_SELECTED_OBJECT_IS_ACTIVE(true);
    }