当前位置: 首页 > news >正文

网站品牌词优化怎么做Python能开发WordPress

网站品牌词优化怎么做,Python能开发WordPress,wordpress改菜单字体大小,校园网站做等级保护一.携程概述 官方的解释是#xff0c;携程允许你可以在多个帧中执行任务。在Unity中#xff0c;携程是一个可以暂停并在后续帧中从暂停处继续执行的方法。 二.携程写法 下面示例使用携程和Update打印前5帧的时间间隔#xff0c;展示了携程的基础写法 using System.Colle…一.携程概述 官方的解释是携程允许你可以在多个帧中执行任务。在Unity中携程是一个可以暂停并在后续帧中从暂停处继续执行的方法。 二.携程写法 下面示例使用携程和Update打印前5帧的时间间隔展示了携程的基础写法 using System.Collections; using System.Collections.Generic; using UnityEngine;public class demo2 : MonoBehaviour {private int frameNum 1;void Start(){StartCoroutine(coroutine);}public IEnumerator coroutine(){Debug.Log(coroutine frame1: Time.deltaTime);yield return null;Debug.Log(coroutine frame2: Time.deltaTime);yield return null;Debug.Log(coroutine frame3: Time.deltaTime);yield return null;Debug.Log(coroutine frame4: Time.deltaTime);yield return null;Debug.Log(coroutine frame5: Time.deltaTime);yield return null;}void Update(){if (frameNum 5){Debug.Log(------ Update: frameNum Time.deltaTime);frameNum;}} } 从打印结果来看携程和Update一样会每帧调用一次StartCoroutine用于开启携程返回值类型固定为IEnumerator返回值yield return null表示下一帧从此处之后开始执行等同于yield return 一个数字 这里IEnumerator接口和yield关键字是C#的不了解的可查看前两篇文章 三.Unity规定的携程返回值含义(标红的较为常用) 代码含义yield return null;  yield retun x(x代表任意数字)下一帧再执行后续代码 yield return new WaitForSeconds(0.1f); yield return new WaitForSecondsRealtime(0.1f); //不受timescale影响 等待固定时间执行后续代码yield return FunctionName();函数执行完毕后执行后续代码yield return Coroutine;协程执行完毕后执行后续代码yield return new WaitForEndOfFrame();帧渲染完成后执行后续代码yield return new WaitForFixedUpdate();物理帧更新后执行后续代码yield break;结束该协程yield return startCoroutine(funcName)等携程funName结束后执行后续代码 四.携程在事件函数中的执行顺序 using System; using System.Collections; using System.Collections.Generic; using UnityEngine;public class demo1 : MonoBehaviour {private bool logStart true;void Start(){StartCoroutine(coroutine1);}void Update(){if (Input.GetKeyDown(KeyCode.S)){logStart !logStart;Debug.Log(logStart);}if (logStart){Debug.Log(-------------------);Debug.Log(Update: Time.deltaTime);}}void LateUpdate(){if (logStart){Debug.Log(LateUpdate: Time.deltaTime);}}public IEnumerator coroutine1(){while (true){if (Input.GetKeyDown(KeyCode.S)){yield break;}else{Debug.Log(coroutine1: Time.deltaTime);yield return null;}}} }从打印结果来看携程在Update之后LateUpdate之前执行官网的事件函数示意图也说明了这一点 五.携程的作用 1.替代Update处理一些耗时按帧执行的任务避免Update过于复杂 2.处理调用耗时API(比如切换场景)完成后在做什么的情况 六.携程可以传参可以嵌套 下面例子演示了crt1等待crt2结束后再执行后续并给crt2传递参数 using System.Collections; using System.Collections.Generic; using UnityEngine;public class demo2 : MonoBehaviour {void Start(){StartCoroutine(crt1);}public IEnumerator crt1(){Debug.Log(crt1 do task1);//携程2传参等待携程2执行完成后再执行后续代码yield return StartCoroutine(crt2, 3.0f);Debug.Log(crt1 do task2);}public IEnumerator crt2(float time){yield return new WaitForSeconds(time);Debug.Log(crt2 do task after time sec);yield return new WaitForSeconds(2);Debug.Log(crt2 finish);}void Update(){if (Input.GetKeyDown(KeyCode.S)){StopCoroutine(crt2);Debug.Log(crt2 is stopped);}if (Input.GetKeyDown(KeyCode.A)){StopAllCoroutines();Debug.Log(All crt stopped);}} }七.停止携程 StopCoroutine(funcName); //停止携程funcName StopAllCoroutines(); //停止脚本内所有携程
http://www.hkea.cn/news/14472989/

相关文章:

  • 建设一个购物网站需要什么手机建筑设计app
  • 饥荒网站这么做福州seo建站
  • 长沙建长沙建网站公司网页模板psd
  • 东莞网站建设的方案常用的北京文化馆设计公司
  • 宜都市网站建设上海网站推广有哪些
  • 高端网站建设公司联系电话潍坊做网页的公司
  • 中国网站建设集团模仿大型门户网站做ppt
  • 有没有淄博张店做兼职工作的网站北京免费建站网络营销
  • 网站治做啊app简网站开发平台
  • 泉州网站建设方案详细合肥网站优化哪家好
  • 在北京网站建设的岗位网站文件服务器
  • 八戒网站建设wordpress 自定义 分类
  • 网站建设用款怎样使用仿站小工具做网站
  • 网站怎么做维护做庭院的网站
  • 购物网站图片的放大怎么做的公司网页设计内容方案
  • 做泵阀生意到哪个网站网页设计与制作精品课程网站
  • 页游网站网站标题怎么写
  • 智联招聘网站怎么做微招聘信息吗江苏省建设厅网站 投诉
  • 成都网站建设优创智汇怎么建立挣流量的网站
  • 网站开发路径河南建设工程信息网下载
  • 免费企业建站开源系统杭州外贸网站建设公司价格
  • 湛江免费建站平台wordpress获取用户角色
  • 备案后可以修改网站吗手机app界面设计优秀作品
  • vue 实现网站开发网络推广策划培训班
  • 西安模板建站公司做网站的联系方式
  • dedecms微电影网站模板做网站公司促销海报
  • msn网站制作2345网址导航下载桌面
  • 网站后台设计教程视频亚马逊平台的运营模式
  • 网站开发的形式有附近建网站公司
  • 网站链接优化用别人公司域名做网站