Exemplo n.º 1
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);
    }
Exemplo n.º 2
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");
            }
        }
    }
 // Update is called once per frame
 void Update()
 {
     position = DialControl.ClampedPosition(position, -width / 2, width / 2);
     this.transform.position = Vector3.Lerp(this.transform.position, new Vector3(position, this.transform.position.y, this.transform.position.z), 6f * Time.deltaTime);
 }