Exemplo n.º 1
0
    void MoveToTheBottle()
    {
        Debug.Log("Move");
        item.transform.SetParent(transform, true);
        iTween.MoveTo(item.gameObject, iTween.Hash("position", prepareToReleasePos.localPosition, "time", prepareToSpinTime, "islocal", true, "easetype", iTween.EaseType.easeInOutCirc, "oncomplete", nameof(PrepareAnimCompleted), "oncompletetarget", gameObject));
        iTween.RotateTo(item.gameObject, iTween.Hash("rotation", Vector3.zero, "time", prepareToSpinTime, "easetype", iTween.EaseType.linear, "islocal", true));

        item.GetComponent <Rigidbody>().isKinematic      = true;
        item.GetComponentInChildren <Collider>().enabled = false;
        item.GetComponent <Grabbable>().enabled          = false;
        ownGrabbable.enabled = false;
    }
Exemplo n.º 2
0
    void SnapOnBegining()
    {
        if (snappedItem == null)
        {
            return;
        }

        snappedItem.GetComponent <Rigidbody>().isKinematic      = true;
        snappedItem.GetComponentInChildren <Collider>().enabled = false;
        snappedItem.GetComponent <Grabbable>().enabled          = false;
        snappedItem.transform.SetParent(transform);
        snappedItem.transform.localPosition = Vector3.zero;

        iteamReadyToSnap = snappedItem;
        snapState        = SnapState.Snapped;
        Array.ForEach(snapBegining, s => s.Init(iteamReadyToSnap));
    }