Ejemplo n.º 1
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);
        }
    }
Ejemplo n.º 2
0
 void triggerUnclicked(object sender, ClickedEventArgs e)
 {
     if (_objectCollidedWithHand == null)
     {
         _stateManagerMutatorRef.SET_SELECTED_OBJECT_IS_ACTIVE(false);
     }
 }
Ejemplo n.º 3
0
    void triggerUnclicked(object sender, ClickedEventArgs e)
    {
        _stateManagerMutatorRef.SET_SELECTED_OBJECT_IS_ACTIVE(false);

        if (_objectCollidedWithHand != null)
        {
            _objectCollidedWithHand.transform.parent = initialPropParent;
            _stateManagerMutatorRef.SET_SELECTED_OBJECT(_objectCollidedWithHand);
            _objectCollidedWithHand.AddComponent <activeProp>();
        }
    }
Ejemplo n.º 4
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>();
        }
    }
Ejemplo n.º 5
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);
    }