Синтаксис:
Используется csharp
using UnityEngine;
using System.Collections;
public class FightController : MonoBehaviour {
public float animSpeed = 1.0f;
private Animator animator;
public void Start () {animator = GetComponent<Animator>();}
public void FixedUpdate () {
float combo = 0;
int hit = 0;
if (Input.GetKeyDown (KeyCode.S)) {
combo ++;
hit = 1;
}
animator.SetInteger ("Hits", hit);
animator.SetFloat ("Combo", combo);
animator.speed = animSpeed;
}
}
using System.Collections;
public class FightController : MonoBehaviour {
public float animSpeed = 1.0f;
private Animator animator;
public void Start () {animator = GetComponent<Animator>();}
public void FixedUpdate () {
float combo = 0;
int hit = 0;
if (Input.GetKeyDown (KeyCode.S)) {
combo ++;
hit = 1;
}
animator.SetInteger ("Hits", hit);
animator.SetFloat ("Combo", combo);
animator.speed = animSpeed;
}
}
Как сделать так, что бы после нажатия float combo не сразу возвращался в 0, а "сползал" туда постепенно. Например за секунду.
UP. Такс. В апдейте он и будет падать мгновенно. Буду искать обходной путь.