当前位置:   article > 正文

Unity延时操作_unity delay

unity delay

我知道Unity有个Invoke方法可以延时,我也知道协程可以做延时,今天只是分享另外一种延时方式,供大家参考使用。


using System;
using System.Collections.Generic;
using UnityEngine;
public class DelayModel : MonoBehaviour
{
    /// <summary>
    /// 自己生成一个Obj来挂DelayModel 脚本
    /// </summary>
    GameObject go;
    private static DelayModel _instance; 
    public static DelayModel Instance
    {
        get
        {
            if (_instance == null)
            {
                GameObject go = new GameObject("DelayManager");
                go.AddComponent<DelayModel>();
                _instance = go.GetComponent<DelayModel>();
            }
            return _instance;
        }
    }
    private List<Delaytion> Delaylist = 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/article/detail/54427?site
推荐阅读
相关标签
  

闽ICP备14008679号