NetCore下ZP的环境配置

程序集:LitJson UniRx UnityEngine

NuGet: MQTTnet MySql.Data

如果是Net.Standard Dll还需要加入

   
   
   

配置中添加:ZP_SERVER;ZP_UNIRX;

NetCore下ZP的环境配置_第1张图片

Demo工程代码如下:



  
    netcoreapp2.2
    InProcess
  

  
    TRACE;DEBUG;NETCOREAPP;NETCOREAPP2_2;ZP_SERVER;ZP_UNIRX;
  
  
    
    
    
    
  

  
    
      ServerLibrary\UniRx.dll
    
    
      ServerLibrary\UnityEngine.CoreModule.dll
    
    
      ServerLibrary\UnityEngine.SharedInternalsModule.dll
    
    
      Assets\Plugins\LitJson.dll
    
  

  
    
    
    
    
    


可以与Console工程合并在一起,融合代码如下:

    public class Program
    {
        public static void Main(string[] args)
        {
            //Task.Run(async () => { await ProgramForMQTT.MainTest(); });
            if (args.Length > 0 && string.CompareOrdinal( args[0], "exe") == 0) {

                ServerTest.TestScene();

                Console.WriteLine("Hello World!");

                Console.ReadKey();
            }
            else
                CreateWebHostBuilder(args).Build().Run();
        }

        public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
            WebHost.CreateDefaultBuilder(args)
                .UseStartup();
    }

HelloWorld

        person = ZPropertyMesh.CreateObject ();
		person.blood.Value = 100;
		person.rank.Value = 2;

		Weapon sword = person.weapon.Value;
		sword.power.Value = 991.0f;

		person.testList.Add(900);
		person.testList.Add(100);

		var testObj = ZPropertyMesh.CreateObject ();
		testObj.testData.Value = 201;

		person.testInterface.Value = testObj;

        var pp = ZPropertyMesh.GetPropertyEx(person, ".weapon.power");

 

你可能感兴趣的:(Unity)