using UnityEngine;
using System.Collections;
public class PowerShow : MonoBehaviour {
private float StartValue = 0; //开始的值
private int EndValue = 1000; //终点的值
private bool isStart = true; //是否开始
private bool isAdd = true; //是否增涨
public int Speed = 100; //速度
public UILabel Number_Label;
void Update()
{
if(isStart)
{
if (isAdd)
{
StartValue += Speed * Time.deltaTime;
if(StartValue>EndValue)
{
isStart = false;
}
}
else
{
StartValue -= Speed * Time.deltaTime;
if (StartValue < EndValue)
{
isStart = false;
}
using System.Collections;
public class PowerShow : MonoBehaviour {
private float StartValue = 0; //开始的值
private int EndValue = 1000; //终点的值
private bool isStart = true; //是否开始
private bool isAdd = true; //是否增涨
public int Speed = 100; //速度
public UILabel Number_Label;
void Update()
{
if(isStart)
{
if (isAdd)
{
StartValue += Speed * Time.deltaTime;
if(StartValue>EndValue)
{
isStart = false;
}
}
else
{
StartValue -= Speed * Time.deltaTime;
if (StartValue < EndValue)
{
isStart = false;
}
}
}
}