• 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;
        }
    }
    

      

  • 相关阅读:
    洛谷 P2678 跳石头
    洛谷 P1145 约瑟夫
    LibreOJ #515. 「LibreOJ β Round #2」贪心只能过样例
    洛谷 P2966 [USACO09DEC]牛收费路径Cow Toll Paths
    网络编程 --- TCP
    进程
    并发编程
    网络编程 --- UDP
    网络编程
    面向对象编程 --- 反射
  • 原文地址:https://www.cnblogs.com/bambomtan/p/6132436.html
Copyright © 2020-2023  润新知