首页 > 其他分享 >IEnumerator Start

IEnumerator Start

时间:2023-09-19 15:33:43浏览次数:25  
标签:procedureType AvailableProcedureTypeNames Log IEnumerator yield Start procedures

private IEnumerator Start()
        {
            ProcedureBase[] procedures = new ProcedureBase[m_AvailableProcedureTypeNames.Length];
            for (int i = 0; i < m_AvailableProcedureTypeNames.Length; i++)
            {
                Type procedureType = Utility.Assembly.GetType(m_AvailableProcedureTypeNames[i]);
                if (procedureType == null)
                {
                    Log.Error("Can not find procedure type '{0}'.", m_AvailableProcedureTypeNames[i]);
                    yield break;
                }

                procedures[i] = (ProcedureBase)Activator.CreateInstance(procedureType);
                if (procedures[i] == null)
                {
                    Log.Error("Can not create procedure instance '{0}'.", m_AvailableProcedureTypeNames[i]);
                    yield break;
                }

                if (m_EntranceProcedureTypeName == m_AvailableProcedureTypeNames[i])
                {
                    m_EntranceProcedure = procedures[i];
                }
            }

            if (m_EntranceProcedure == null)
            {
                Log.Error("Entrance procedure is invalid.");
                yield break;
            }

            m_ProcedureManager.Initialize(GameFrameworkEntry.GetModule<IFsmManager>(), procedures);

            yield return new WaitForEndOfFrame();

            m_ProcedureManager.StartProcedure(m_EntranceProcedure.GetType());
        }

  协程的方式执行unity的生命周期函数

标签:procedureType,AvailableProcedureTypeNames,Log,IEnumerator,yield,Start,procedures
From: https://www.cnblogs.com/mcyushao/p/17714794.html

相关文章

  • ORACLE--Connect By、Level、Start With的使用(Hierarchical query-层次查询)
    查找员工编号为7369的领导:1SELECTLEVEL,E.*FROMEMPECONNECTBYPRIORE.MGR=E.EMPNOSTARTWITHE.EMPNO=78762ORDERBYLEVELDESC"startwith"--thisidentifiesallLEVEL=1nodesinthetree"connectby"--describeshowtowalkfromt......
  • SpringBoot 启动时报错Unable to start embedded Tomcat
    导读最近公司有个gradle构建的工程,需要改造成maven方式构建(点我直达)。转为maven后,启动时一直报tomcat错误,最终排查是因为servlet-api这个包导致的依赖冲突,将这个依赖排除即可启动解决排除依赖,检查项目是否包含:javax.servlet-api<exclusions><exclusi......
  • KingbaseES V8R6集群运维案例之---sys_monitor.sh start启动动态库错误
    案例说明:在KingbaseESV8R6集群部署了postgis后,执行sys_monitor.shstart启动集群时,出现动态库错误,如下图所示:适用版本:KingbaseESV8R6操作系统:KylinV10Server一、问题分析1、手工执行sys_ctl启动数据库服务,启动正常。2、执行sh-xsys_monitor.shstart查看脚本启动......
  • tomcat里web.xml中load-on-startup参数含义
    原文:Theload-on-startupelementindicatesthatthisservletshouldbeloaded(instantiatedandhaveitsinit()called)onthestartupofthewebapplication.Theoptionalcontentsoftheseelementmustbeanintegerindicatingtheorderinwhichtheserv......
  • MySQL 切换数据库、用户卡死:“You can turn off this feature to get a quicker start
    数据量很大的话,常规切换数据库会把里面所有的表遍历一遍,会很慢甚至是卡死。解决方法:登录的时候直接在最后面加一个-A就行了。[root@localhost~]#"/usr/local/mysql-8.0.11/bin/mysql"-uroot-p123456-A 实战演示:我演示的数据库就是一个数据量很大的数据库,切换数据库......
  • 软件测试|全面解析Docker Start/Stop/Restart命令:管理容器生命周期的必备工具
    简介Docker是一种流行的容器化平台,用于构建、分发和运行应用程序。在使用Docker时,经常需要管理容器的生命周期,包括启动、停止和重启容器。本文将详细介绍Docker中的dockerstart、dockerstop和dockerrestart命令,帮助您全面了解如何管理容器的运行状态。在Docker中,容器是独立......
  • SpringBoot 自定义starter汇总
    1、SpringBootstarter机制SpringBoot中的starter是一种非常重要的机制,能够抛弃以前繁杂的配置,将其统一集成进starter,应用者只需要在maven中引入starter依赖,SpringBoot就能自动扫描到要加载的信息并启动相应的默认配置。starter让我们摆脱了各种依赖库的处理,需要配置各种信息......
  • keil51的STARTUP.A51
     翻译后的STARTUP.A51:$NOMOD51;Ax51宏汇编器控制命令,禁止预定义的8051。使编译器不使能预定义的;8051符号,避免产生重复定义的错误。;------------------------------------------------------------------------------;该文件是C51编译器包的一部分;版权所有(c)1988-2005Kei......
  • 【ActiveMQ】Failed to start Apache ActiveMQ (localhost, ID_XXX)
    问题描述使用"bin\win64\activemq.bat"启动apache-activemq-5.18.2出错。jvm1|ERROR|FailedtostartApacheActiveMQ(localhost,ID:)jvm1|java.io.IOException:TransportConnectorcouldnotberegisteredinJMX:java.io.IOException:Failedtobin......
  • Docker - start postgres
        ......