Skip to content

Instantly share code, notes, and snippets.

@n-taku
Created April 29, 2017 17:56
Show Gist options
  • Save n-taku/9332e8ec48b42118ec3fca74700a2f02 to your computer and use it in GitHub Desktop.
Save n-taku/9332e8ec48b42118ec3fca74700a2f02 to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Health : MonoBehaviour {
public Slider slider;
void Update () {
//1秒間に0.5増加する速度でスライダーの値を1まで動かす
slider.value = Mathf.MoveTowards (slider.value, 1, 0.5f*Time.deltaTime);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment