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.

AnimationState.weight

Sugiere un cambio

¡Éxito!

Gracias por ayudarnos a mejorar la calidad de la documentación de Unity. A pesar de que no podemos aceptar todas las sugerencias, leemos cada cambio propuesto por nuestros usuarios y actualizaremos los que sean aplicables.

Cerrar

No se puedo enviar

Por alguna razón su cambio sugerido no pudo ser enviado. Por favor <a>intente nuevamente</a> en unos minutos. Gracias por tomarse un tiempo para ayudarnos a mejorar la calidad de la documentación de Unity.

Cerrar

Cancelar

Cambiar al Manual
public var weight: float;
public float weight;

Descripción

The weight of animation.

This calculates the blend weights for one curve.

Weights are distributed so that the top layer gets everything. If it doesn't use the full weight then the next layer gets to distribute the remaining weights and so on. Once all weights are used by the top layers, no weights will be available for lower layers anymore Unity uses fair weighting, which means if a lower layer wants 80% and 50% have already been used up, the layer will NOT use up all weights. instead it will take up 80% of the 50%.

Example: a upper body which is affected by wave, walk and idle a lower body which is affected by only walk and idle.

	weight  name   layer   lower   upper
	 20%    wave     2        0%      20% 
	 50%    walk      1        50%    40% 
	 100%   idle       0        50%    40%

- Blend weights can change per animated value because of mixing. Even without mixing, sometimes a curve is just not defined. Still you want the blend weights to add up to 1. Most of the time weights are similar between curves.


        
using UnityEngine;
using System.Collections;

public class ExampleScript : MonoBehaviour { public Animation anim;

void Start() { // Set the blend weight of the walk animation to 0.5 anim["Walk"].weight = 0.5f; } }