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;
}
}
}
}
使用NGUI更新游戏得分
本文档详细介绍了如何在Unity游戏中利用NGUI组件有效地实现玩家分数的实时增长和显示,涵盖了UI更新、事件监听和逻辑处理等方面。
1724

被折叠的 条评论
为什么被折叠?



