Version: 5.3 (switch to 5.4b)
IdiomaEnglish
  • C#
  • JS

Idioma de script

Selecciona tu lenguaje de programación favorito. Todos los fragmentos de código serán mostrados en este lenguaje.

Mathf.LerpAngle

Cambiar al Manual
public static float LerpAngle(float a, float b, float t);

Parámetros

Descripción

Same as Lerp but makes sure the values interpolate correctly when they wrap around 360 degrees.

Variables a y b son asumidas en grados

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public float minAngle = 0.0F; public float maxAngle = 90.0F; void Update() { float angle = Mathf.LerpAngle(minAngle, maxAngle, Time.time); transform.eulerAngles = new Vector3(0, angle, 0); } }

See Also: Lerp.