本文整理汇总了C#中UnityEngine.UI.Text.DOFade方法的典型用法代码示例。如果您正苦于以下问题:C# Text.DOFade方法的具体用法?C# Text.DOFade怎么用?C# Text.DOFade使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.UI.Text
的用法示例。
在下文中一共展示了Text.DOFade方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Fade
public static void Fade(Text element, float fadeTo, float fadeAfter, float timeToFade)
{
DOTween.Sequence()
.AppendInterval(fadeAfter)
.Append(element.DOFade(fadeTo, timeToFade)
.SetEase(Ease.InOutExpo));
}
示例2: AnimateDisappearLeft
void AnimateDisappearLeft(Text text)
{
RectTransform rect = text.rectTransform;
Vector2 realPosition = rect.anchoredPosition;
rect.anchoredPosition = new Vector2(realPosition.x - xOffset, realPosition.y);
rect.DOAnchorPos(realPosition, animationTime + 0.1f, true);
text.DOFade(0, animationTime);
DOTween.Play(text);
}
示例3: PostTweet
public static IEnumerator PostTweet(string text, string mediaID, string consumerKey, string consumerSecret, AccessTokenResponse response, Text outputText)
{
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters.Add("status", text);
parameters.Add("media_ids", mediaID);
// Add data to the form to post.
WWWForm form = new WWWForm();
form.AddField("status", text);
form.AddField("media_ids", mediaID);
Debug.Log(mediaID);
Debug.Log("Posting to Twitter...");
// HTTP header
var headers = new Dictionary<string, string>();
headers["Authorization"] = GetHeaderWithAccessToken("POST", "https://api.twitter.com/1.1/statuses/update.json", consumerKey, consumerSecret, response, parameters);
WWW web = new WWW("https://api.twitter.com/1.1/statuses/update.json", form.data, headers);
yield return web;
Debug.Log(web.text);
if (web.error != "Null")
{
outputText.text = "Upload complete!";
yield return new WaitForSeconds(2);
outputText.DOFade(0, 1);
}
else
{
Debug.Log(web.error);
}
}