簡體   English   中英

如何使用標准着色器在GameObject上淡化alpha?

[英]How to fade alpha on GameObject using Standard Shader?

如何簡單地淡化應用了標准着色器的游戲對象?

這是我的代碼。 如果我將着色器切換到Sprites.default,則可以使用。

public void foo(float val)
{
     _isFade=true;
     float time=2.0f;
     float alphaVal=0.0f;
     LeanTween.alpha(gameObject, alphaVal, time);

     Debug.Log("YES calling fade in foo !!!! and gameObject = "+gameObject);
}

確保在材質上將標准着色器的類型設置為“淡入”或“透明”。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM