Pickupable.Drop C# (CSharp) Method

Drop() public method

public Drop ( GameObject _player, NymphSpawning, _nymphSpawning ) : void
_player GameObject
_nymphSpawning NymphSpawning,
return void
    public virtual void Drop(GameObject _player, NymphSpawning _nymphSpawning)
    {
        Vector3 initPos = gameObject.transform.position;
        Vector3 dropToPos = _player.transform.position;

        if (_player.transform.position.y < 4.21f)
        {
            dropToPos.y = 0.415f;
        }

        gameObject.transform.position = dropToPos;
        
        gameObject.SetActive(true);
        _nymphSpawning.Spawn(dropToPos, initPos);
        isDropped = true;
    }

Usage Example

Beispiel #1
0
    public void Drop()
    {
        _handIKController.LerpPositon(0);
        _handIKController.LerpRotation(0);
        currentHeld.Drop();

        _handIKController.leftHand    = false;
        _handIKController.rightHand   = false;
        _handIKController.leftObject  = null;
        _handIKController.rightObject = null;
    }
All Usage Examples Of Pickupable::Drop