免責事項:この記事はブロガーオリジナル記事です、続くBY-SAのCC 4.0を著作権契約、複製、元のソースのリンクと、この文を添付してください。
I.はじめに
今日シェアはアニメーション処理を待って、進捗を達成するためにUGUIテキスト、負荷の進展を待って、アイデアの実現は比較的簡単ですが、効果は、あくまでも参考のために、比較的簡単であるあなたに感謝
デモンストレーション効果:
第二に、資源
出典ます。https://download.csdn.net/download/q764424567/11644430
第三に、テキスト
スクリプトTextLoading.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class TextLoading : MonoBehaviour
{
public Text m_Text;
float m_CurProgressValue2 = 0;
float m_ProgressValue2 = 100;
float m_CurProgressValueTemp = 0;
void Update()
{
if (m_CurProgressValue2 < m_ProgressValue2)
{
m_CurProgressValue2++;
}
if (m_CurProgressValue2 == 100)
{
m_CurProgressValue2 = 0;
}
m_CurProgressValueTemp = m_CurProgressValue2 / 100f;
if (m_CurProgressValueTemp > 0.1f && m_CurProgressValueTemp <= 0.3f)
{
m_Text.text = "○○○○●";
}
else if (m_CurProgressValueTemp > 0.3f && m_CurProgressValueTemp <= 0.5f)
{
m_Text.text = "●○○○○";
}
else if (m_CurProgressValueTemp > 0.5f && m_CurProgressValueTemp <= 0.7f)
{
m_Text.text = "○●○○○";
}
else if (m_CurProgressValueTemp > 0.7f && m_CurProgressValueTemp <= 0.9f)
{
m_Text.text = "○○●○○";
}
else
{
m_Text.text = "○○○●○";
}
}
}
コードにはコメントをしない、比較的簡単です