Esempio n. 1
0
    public override void onTouch(bool on, manipulator m)
    {
        touching = on;
        if (m != null)
        {
            if (on)
            {
                m.hapticPulse(3000);
            }
            else
            {
                m.hapticPulse(700);
            }
        }

        keyHitCheck();
    }
Esempio n. 2
0
    IEnumerator insertRoutine()
    {
        float   timer = 0;
        Vector3 dest  = new Vector3(0, 0, -.0225f);

        while (timer < 1)
        {
            if (tempM != null && timer < 0.5f)
            {
                tempM.hapticPulse(500);
            }
            timer = Mathf.Clamp01(timer + Time.deltaTime * 2);
            transform.localPosition = Vector3.Lerp(Vector3.zero, dest, timer);
            yield return(null);
        }
    }
Esempio n. 3
0
    void OnCollisionEnter(Collision coll)
    {
        manipulator m = coll.transform.GetComponent <manipulator>();

        if (m == null)
        {
            return;
        }
        if (manips.ContainsKey(m))
        {
            manips[m].colliding = true;
        }
        else
        {
            manips[m] = new scrubber(m.transform, m.triggerDown, true);
        }
        m.hapticPulse();
        {
            scrubberCandidate = manips[m];
            scrubIndicator.gameObject.SetActive(true);
        }
    }