本文整理汇总了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);
}