本文整理匯總了C#中Text.CrossFadeAlpha方法的典型用法代碼示例。如果您正苦於以下問題:C# Text.CrossFadeAlpha方法的具體用法?C# Text.CrossFadeAlpha怎麽用?C# Text.CrossFadeAlpha使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Text
的用法示例。
在下文中一共展示了Text.CrossFadeAlpha方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Awake
// Use this for initialization
void Awake() // Or awake? haven't had problems.
{
S = this;
targetText = transform.GetChild(0).GetComponent<Text>(); // Only if you place this on my specific object setup of UI Image with child UI Text.
this.GetComponent<Image>().CrossFadeAlpha(0, 0, true);
targetText.CrossFadeAlpha(0, 0, true);
}
示例2: BlinkText
IEnumerator BlinkText(Text text)
{
while (true)
{
yield return new WaitForSeconds(1.2f);
float alpha = 1f;
if (text.canvasRenderer.GetAlpha() == 1f) alpha = 0.1f;
text.CrossFadeAlpha(alpha, 1.2f, false);
}
}
示例3: Start
void Start()
{
// Set the fade and next scene time
fadeInAt = Time.time + FADE_DELAY;
fadeOutAt = Time.time + WARNING_TIME - FADE_DURATION;
nextSceneAt = Time.time + WARNING_TIME;
// Get the text objects
warningTextComp = warningTextObj.GetComponent<Text>();
loadingTextComp = loadingTextObj.GetComponent<Text>();
// Fade out (instantly)
warningTextComp.CrossFadeAlpha(0.0f, 0.0f, false);
loadingTextComp.CrossFadeAlpha(0.0f, 0.0f, false);
}
示例4: Start
// Use this for initialization
void Start()
{
cachedText = this.GetComponent<Text>();
cachedText.CrossFadeAlpha(0, DestroyAfter, true);
Destroy(this.gameObject, DestroyAfter + 0.5f);
}
示例5: FlashText
IEnumerator FlashText(Text txt, int times)
{
yield return new WaitForSeconds(0.25f);
int i = 0;
while (i < times) {
txt.CrossFadeAlpha(0.0f, 0.2f, false);
yield return new WaitForSeconds(0.2f);
txt.CrossFadeAlpha(1.0f, 0.2f, false);
yield return new WaitForSeconds(0.2f);
i += 1;
}
}
示例6: FadeOut
IEnumerator FadeOut(GameObject FadingPanel, Text FadingText)
{
yield return new WaitForSeconds(FadeTimer);
FadingPanel.GetComponent<Image>().CrossFadeAlpha(0f, (Time.deltaTime * 100), false);
FadingText.CrossFadeAlpha(0f, (Time.deltaTime * 100), false);
NodeToDelete.SetActive(false);
}