private void PutObjectFromFloor() { animator.SetLayerWeight(1, 0); objectInHand.SetParent(null); objectInHand.transform.position = this.gameObject.transform.position + this.gameObject.transform.forward; objectInHand = null; }
private void PickupObjectFromFloor() { animator.SetLayerWeight(1, 1); animator.SetTrigger("grab"); objectInHand = objectOnFloorInteractable; objectInHand.transform.position = transformObjectInHand.position; objectInHand.transform.rotation = transformObjectInHand.rotation; objectInHand.SetParent(transformObjectInHand); objectOnFloorInteractable = null; }
/**Place un object sur la table * * @return Si l'object a été placer ou pas */ public virtual void PutObjectOnTable(MasterObject newObjectOnTable) { if (objectOnTable != null) { Debug.LogError("object already on table"); return; } objectOnTable = newObjectOnTable; //objectOnTable.PlaceOnTable(transformPointForObject); objectOnTable.transform.position = transformPointForObject.position; objectOnTable.transform.rotation = transformPointForObject.rotation; objectOnTable.SetParent(transformPointForObject); }
private void PickupObjectFromTable() { if (tableInteractable == null) { Debug.LogError("PlayerMovement (PickupObjectFromTable) : no table in range)"); return; } animator.SetLayerWeight(1, 1); animator.SetTrigger("grab"); animator.SetInteger("compteurTake", 0); objectInHand = tableInteractable.PickItemOnTable(); objectInHand.transform.position = transformObjectInHand.position; objectInHand.transform.rotation = transformObjectInHand.rotation; objectInHand.SetParent(transformObjectInHand); }