我一直在寻找一种在 Unity 中淡化 TextMesh-Text 的 alpha 值的方法,但我无法在网上或LeanTween 文档中找到解决方案。
这就是问题所在。我设置了一个记分牌,并制作它以便我的学生可以在记分牌上减轻一些图像(星星的数量)。
这是调用 void 的代码:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class ScoreBoard : MonoBehaviour
{
public float timerassesshigh; //change for every level (for gold)
public float timerassesslow; //change for every level (for silver)
public timer timer;
private SceneFadeEffect sceneFade;
private Scene scene;
public int nextLevelRecord;
private int levelcurrentat;
public string NextLevel;
public AudioSource leveldonedun;
private GameObject musicg;
public AudioSource music;
public Animator leveldonefade;
public Image leveldonefadesprite;
public GameObject buttons;
public rankaudioandlog rankaudioandlog;
private void Awake() …Run Code Online (Sandbox Code Playgroud) 我使用LeanTween作为我的 Unity 应用程序的补间插件。但令人沮丧的是没有“从到”类型的补间。例如,我想要
//Set initial alpha (from 1f) before animation
var tempColor = forceRing.color;
tempColor.a = 1f;
forceRing.color = tempColor;
//Tween alpha (to 0f)
LeanTween.alpha(forceRing.gameObject, 0f, 0.7f)
Run Code Online (Sandbox Code Playgroud)
看起来像这样。
//Tween alpha from 1f to 0f;
LeanTween.alpha(forceRing.gameObject, 1f, 0f, 0.7f)
Run Code Online (Sandbox Code Playgroud)
我在 LeanTween 中找不到这个功能。实现这一目标的最佳方法是什么,而无需自己为每种补间类型编写包装器或扩展?