Ejemplo n.º 1
0
    public static float Velocity()
    {
        float velocity = (DialControl.Position() - lastPos) / Time.deltaTime;

        lastPos = DialControl.Position();
        return(velocity);
    }
Ejemplo n.º 2
0
    void Rotate(bool limitRotation)
    {
        if (!limitRotation)
        {
            position = DialControl.Position() * sensitivity;
        }
        else
        {
            position = DialControl.ClampedPosition(position * sensitivity, minRotation, maxRotation);
        }



        Quaternion rotation = this.transform.rotation;

        rotation.eulerAngles    = new Vector3(rotation.eulerAngles.x, rotation.eulerAngles.y, position + offsetPos);
        this.transform.rotation = Quaternion.Lerp(this.transform.rotation, rotation, speed * Time.deltaTime);
    }
Ejemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        position = DialControl.ClampedPosition(position, minPossAntennaPos, maxPossAntennaPos);

        if (clampPosition)
        {
            if (position < (antennaNeededAntennaPosition + 2) && position > (antennaNeededAntennaPosition - 2))
            {
                antennaInPosition = true;
                anim.SetTrigger("Pan Down");
            }
        }
        else
        {
            if (DialControl.Position() < (antennaNeededAntennaPosition + 2) && DialControl.Position() > (antennaNeededAntennaPosition - 2))
            {
                antennaInPosition = true;
                anim.SetTrigger("Pan Down");
            }
        }
    }