首页 > 代码库 > haha
haha
using UnityEngine; using System.Collections; public class tes : MonoBehaviour { public AnimationCurve time; public float timeSkip = 0.5f; public int duration = 7; public int endCount = 0; float allCount = 0; public RectTransform[] poss; public RectTransform eff; // Use this for initialization void Start () { // endCount = Random.Range(0, 10); allCount = duration * 11 + endCount; // timeSkip = duration / allCount; } float timeTmp = 0; IEnumerator StarRun() { yield return 1; } public bool begin = false; public bool start { get { return begin; } set { begin = value; allCount = duration * 11 + endCount; } } // Update is called once per frame void Update() { if (start) { if(runCoun> allCount) { start = false; runCoun = 0; count = 0; } timeTmp += Time.deltaTime; if (timeTmp >= tags) { // Debug.Log("timeSkip:"+tag+" "+"runCount:"+ runCoun); eff.localPosition = GetNext(); timeTmp = 0; } } } int count = 0; public int runCoun = 0; float tags = 0; Vector3 GetNext() { // Debug.Log("time.Evaluate(" + runCoun / allCount + ")="+time.Evaluate(runCoun / allCount)); tags = timeSkip * time.Evaluate(runCoun / allCount); Debug.Log("tags=" + tags); if (count>10) { count = 0; } runCoun++; return poss[count++].localPosition; } }
haha
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。