标签: leantween

如何使用 LeanTween 淡化 TextMesh alpha?

我一直在寻找一种在 Unity 中淡化 TextMesh-Text 的 alpha 值的方法,但我无法在网上或LeanTween 文档中找到解决方案。

  • LeanTween.alphaText()只适用于普通的 UI 文本(不适用于 TextMesh)
  • LeanTween.alpha()在文本上对我没有任何作用。

user-interface fade unity-game-engine leantween

3
推荐指数
1
解决办法
9096
查看次数

由于时间尺度 0,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)

unity-game-engine leantween

2
推荐指数
1
解决办法
1742
查看次数

LeanTween“从到”值动画

我使用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 中找不到这个功能。实现这一目标的最佳方法是什么,而无需自己为每种补间类型编写包装器或扩展?

c# unity-game-engine leantween

1
推荐指数
1
解决办法
3706
查看次数

标签 统计

leantween ×3

unity-game-engine ×3

c# ×1

fade ×1

user-interface ×1