예제 #1
0
파일: TestEntity.cs 프로젝트: xubingyue/def
 //---------------------------------------------------------------------
 public override void update()
 {
     if (mEntityMgr != null)
     {
         mEntityMgr.update(0.0f);
     }
 }
예제 #2
0
        //---------------------------------------------------------------------
        static void Main(string[] args)
        {
            Console.Title           = "EcTest";
            Console.ForegroundColor = ConsoleColor.Green;
            EbLog.NoteCallback      = Console.WriteLine;
            EbLog.WarningCallback   = Console.WriteLine;
            EbLog.ErrorCallback     = Console.WriteLine;

            mEntityMgr = new EntityMgr();
            mEntityMgr.regComponentFactory(new ComponentFactory <EcApp <DefApp> >(mEntityMgr));
            mEntityMgr.create((byte)_eNodeType.Ec, _eNodeType.Ec.ToString(), 0, null);

            Entity et = mEntityMgr.createEmptyEntity("EtApp", null);

            et.addComponent <EcApp <DefApp> >();

            EbLog.Note("按任意键退出。。。");

            while (true)
            {
                mEntityMgr.update(0.0f);

                Thread.Sleep(100);

                if (Console.KeyAvailable)
                {
                    break;
                }
            }

            mEntityMgr.Dispose();
        }