作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这就是问题所在。我设置了一个记分牌,并制作它以便我的学生可以在记分牌上缓解一些图像(星星的数量)。
这是调用 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()
{
}
// Start is called before the first frame update
void Start()
{
scene = SceneManager.GetActiveScene();
levelcurrentat = PlayerPrefs.GetInt("levelreached");
sceneFade = FindObjectOfType<SceneFadeEffect>();
timer = FindObjectOfType<timer>();
leveldonefade.enabled = false;
leveldonefadesprite.enabled = false;
buttons.SetActive(false);
}
public void leveldone()
{
buttons.SetActive(true);
leveldonefadesprite.enabled = true;
leveldonefade.Rebind();
leveldonedun.Play();
music.Stop();
if (timerassesshigh >= timer.time)
{
rankaudioandlog.gotgold();
}
}
public class rankaudioandlog : MonoBehaviour
{
public AudioSource bronze;
public AudioSource silver;
public AudioSource gold;
public GameObject goldobject;
public GameObject silverobject;
public GameObject bronzeobject;
public AudioSource leveldonecue;
private int levelnumberrank;
public string levelnumber;
public LeanTweenType InType;
private void Start()
{
levelnumberrank = PlayerPrefs.GetInt(("rankoflevel") + (levelnumber));
}
public void gotgold()
{
Debug.Log("You got gold!" + "on level" + levelnumber);
LeanTween.scale(bronzeobject, new Vector3(6.5f, 6.5f, 0f), 0.2f).setDelay(1.2f).setEase(InType);
bronze.PlayDelayed(2f);
LeanTween.scale(silverobject, new Vector3(6.5f, 6.5f, 0f), 0.2f).setDelay(2.2f).setEase(InType);
silver.PlayDelayed(3f);
LeanTween.scale(goldobject, new Vector3(6.5f, 6.5f, 0f), 0.2f).setDelay(3.2f).setEase(InType);
gold.PlayDelayed(4f);
cueendsong();
if (levelnumberrank == 3)
{
return;
}
else
{
Debug.Log("I logged gold");
PlayerPrefs.SetInt(("rankoflevel") + (levelnumber), 3);
}
}
}
最佳答案
好的,我想通了!
我只需要添加 .setIgnoreTimeScale(true);到补间。
很抱歉给您带来麻烦,希望我也帮助了某人 ^^。
关于unity3d - 由于时间尺度 0,LeanTween 没有做任何事情。有什么解决办法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60730454/
我是一名优秀的程序员,十分优秀!