unity3d_协同进程研究(1)
来源:互联网 发布:天猫 淘宝商城长靴 编辑:程序博客网 时间:2024/06/10 00:10
在开发项目的时候,unity的协同进程是经常用的一个功能。
现在就StartCoroutine()的常用方式列出如下,以便日后学习使用。
方式1:单参传递
- void Start(){
- StartCoroutine(CoroutineWithMultipleParameters(1.0F));
- }
- IEnumeratorCoroutineWithMultipleParameters(float aNum){
- //stuff
- }
- void Start(){
- StartCoroutine("CoroutineWithMultipleParameters", 1.0F);
- }
- IEnumeratorCoroutineWithMultipleParameters(float aNum){
- //stuff
- }
- void Start(){
- StartCoroutine(CoroutineWithMultipleParameters(1.0F,2.0F,"foo"));
- }
- IEnumeratorCoroutineWithMultipleParameters(float aNum,float bNum,string aWord){
- //stuff
- }
- void CallCoroutine()
- {
- float floatParameter= 1.43434f;
- string stringParameter ="blablabla";
- object[] parms= new object[2]{floatParameter, stringParameter};
- StartCoroutine("MyCoroutine", parms);
- }
- voidStopCoroutine()
- {
- StopCoroutine("MyCoroutine");
- }
- IEnumeratorMyCoroutine(object[] parms)
- {
- bool achieved= false;
- float floatParameter= (float)parms[0];
- string stringParameter= (string)parms[1];
- while(achieved==false){
- if(---- something-----){
- achieved =true;
- }
- yieldreturnnull;
- }
- }
稍后会继续讲解一些 协同进程的原理。
enjoy!
- unity3d_协同进程研究(1)
- 协同进程
- 协同进程
- 协同进程
- 人工智能研究综述与协同智能研究展望(简纲)
- 协同进程coprocess
- 进程通信之协同进程
- 协同过滤推荐算法研究
- 协同过滤算法的研究
- Unity3D_算法与数据结构(向量)
- 协同过滤算法(1)
- APUE协同进程的讨论
- SVD 与 LSI教程(5):LSI关键字研究与协同理论
- [转帖] 协同设计技术的研究
- linux 内核研究--1--进程调度
- unity3D_自学笔记:第1天-简单了解unity3d
- 真Unity3d_基于profiler的优化(三)
- Unity3D_直线运动
- JavaScript:函数的可选参数
- netgen.5.0.0下载地址与Windows下编译方法
- Java 生产者和消费者问题
- Score
- Linux下递归创建目录
- unity3d_协同进程研究(1)
- C语言--输出打印表格
- cuda by example 的代码的问题
- 纯真IP数据库格式详解
- DataNode2: java.io.IOException: Could not find my address: datanode2 in list of ZooKeeper quorum ser
- 内存分配(mallloc,calloc,realloc,new)
- C语言--随机数(二)
- dpkg
- jQuery性能优化