Advertisement
Guest User

RotateSpeedDial

a guest
Apr 7th, 2020
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. THIS IS THE SCRIPT IM TRYING TO REFERENCE
  2.  
  3.  
  4. using System.Collections;
  5. using System.Collections.Generic;
  6. using UnityEngine;
  7.  
  8. public class RotateSpeedDial : MonoBehaviour
  9. {
  10.  
  11.     static float minAngle = 70.64f;
  12.     static float maxAngle = -269.69f;
  13.     static RotateSpeedDial thisSpeedo;
  14.  
  15.     void Start () {
  16.         thisSpeedo = this;
  17.     }
  18.  
  19.     public static void ShowSpeed(float speed, float min, float max) {
  20.         float ang = Mathf.Lerp(minAngle, maxAngle, Mathf.InverseLerp(min, max, speed));
  21.         thisSpeedo.transform.eulerAngles = new Vector3(0,0,ang);
  22.     }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement