haha

Posted bambom

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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的主要内容,如果未能解决你的问题,请参考以下文章

haha

haha

测试测试

haha

haha

haha