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

网站建设硬件需求搜索引擎营销总结

网站建设硬件需求,搜索引擎营销总结,一个网站需要什么,网页设计服务方案1.Xlua的配置应用 xLua所有的配置都支持三种方式:打标签;静态列表;动态列表。配置要求: 列表方式均必须是static的字段/属性 列表方式均必须放到一个static类 建议不用标签方式 建议列表方式配置放Editor目录(如果是H…

1.Xlua的配置应用

xLua所有的配置都支持三种方式:打标签静态列表动态列表
配置要求
列表方式均必须是static的字段/属性
列表方式均必须放到一个static类
建议不用标签方式
建议列表方式配置放Editor目录(如果是Hotfix配置,而且类位于Assembly-CSharp.dll之外的其它dll,必须放Editor目录)

1.打标签

xLua用白名单来指明生成哪些代码,而白名单通过attribute来配置,该方式方便,但在il2cpp下会增加不少的代码量,不建议使用

1.LuaCallCSharp

一个C#类型加了这个配置,xLua会生成这个类型的适配代码(包括构造该类型实例,访问其成员属性、方法,静态属性、方法)。一个类型的扩展方法(Extension Methods)加了这配置,也会生成适配代码并追加到被扩展类型的成员方法上。xLua只会生成加了该配置的类型,不会自动生成其父类的适配代码,当访问子类对象的父类方法,如果该父类加了LuaCallCSharp配置,则执行父类的适配代码。如果没有适配代码则会尝试用反射来访问,但反射访问性能不佳,在il2cpp下有可能因为代码剪裁而导致无法访问。

[LuaCallCSharp]
public class TestObj
{public void test(testStruct t){Debug.Log($"{t.a},{t.c}");}
}

 上面的类加了此标签,就会生成适配代码

2.ReflectionUse

一个C#类型类型加了这个配置,xLua会生成link.xml阻止il2cpp的代码剪裁。对于扩展方法,必须加上 LuaCallCSharp 或者 ReflectionUse 才可以被访问到。
建议所有要在Lua访问的类型,要么加LuaCallCSharp,要么加上ReflectionUse,这才能够保证在各平台都能正常运行。

如何配置?

[ReflectionUse]
public class TestReflectionUseObj
{}

link.xml保存着打上LuaCallCSharp和ReflectionUse标签的类

3.DoNotGen

指明一个类里头的部分函数、字段、属性不生成代码,通过反射访问。
只能标准 Dictionary<Type, List<string>> 的field或者property。key指明的是生效的类,value是一个列表,配置的是不生成代码的函数、字段、属性的名字。

如何配置?

[LuaCallCSharp]
public class TestDontGen
{public int a1;public int a2;
}

1.打标签(这种方式行不通)

在生成代码中,a2还是生成和a1一样的适配函数

2.静态列表

public static class ExportCfg
{[DoNotGen]public static Dictionary<Type,List<string>> dontGenDic = new Dictionary<Type, List<string>> {[typeof(TestDontGen)] = new List<string> { "a2" },};
}

4.CSharpCallLua

把一个lua函数适配到一个C# delegate(一类是C#侧各种回调:UI事件,delegate参数,比如List<T>:ForEach;另外一类场景是通过LuaTable的Get函数指明一个lua函数绑定到一个delegate),或者把一个lua table适配到一个C# interface时,使用该标签。

如何配置?

   [CSharpCallLua]public interface IPlayerPosition{int x { get; set; }int y { get; set; }int z { get; set; }void add(int x, int y, int z);void sub(int x, int y, int z);}[CSharpCallLua]public delegate void AddMethod(LuaTable self, int x, int y, int z);[CSharpCallLua]public delegate Action addAc(LuaTable t, int x, int y, int z);[CSharpCallLua]public delegate void test1(int x);[CSharpCallLua]public delegate Action test2(int x);

生成代码如下:接口生成独立文件,委托事件生成在DelegateGenBridge文件中

 

5.GCOptimize

xLua无参构造函数的复杂类型(struct)的默认传递方式是引用传递,当lua侧使用完毕释放该对象的引用时,会产生一次gc。
一个C#纯值类型(注:指的是一个只包含值类型的struct,可以嵌套其它只包含值类型的struct)或者C#枚举值加上这个标签之后,XLua会生成gc优化代码,在lua和c#间传递将不产生(C#)gc alloc,该类型的数组(一维?)访问也不产生gc。

如何配置?

[GCOptimize]
public struct TestGCOptimizeValue
{public int a;public int b;public float f;
}

struct 满足条件如下:

1.struct允许嵌套其它struct,但它以及它嵌套的struct只能包含这几种基本类型:byte、sbyte、short、ushort、int、uint、long、ulong、float、double;例如UnityEngine定义的大多数值类型:Vector系列,Quaternion,Color。。。均满足条件,或者用户自定义的一些struct
2.该struct配置了GCOptimize属性(对于常用的UnityEngine的几个struct,Vector系列,Quaternion,Color。。。均已经配置了该属性),这个属性可以通过配置文件或者C# Attribute实现;
3.使用到该struct的地方,需要添加到生成代码列表;

6.AdditionalProperties

该标签GCOptimize的扩展配置,如果struct有的字段是私有的,需要通过属性来访问,这时就需要用到该配置(默认情况下GCOptimize只对public的field打解包)

如何配置?

[GCOptimize]
public struct TestGCOptimizeValue
{public int a;public int b;[AdditionalProperties]float f;
}

7.BlackList

一个类型的一些成员不需要适配代码,可以通过加上该标签来实现。考虑到有可能需要把重载函数的其中一个重载列入黑名单,配置方式比较复杂,类型是 List<List<string>>,对于每个成员,在第一层List有一个条目,第二层List是个string的列表,第一个string是类型的全路径名第二个string是成员名如果成员是一个方法,还需要从第三个string开始,把其参数的类型全路径全列出来

如何配置?

[LuaCallCSharp]
public class TestBlackList
{public int a1;public int a2;public void Test(){}
}

若不加处理生成代码如下: 

1.打标签

C#代码:

[LuaCallCSharp]
public class TestBlackList
{public int a1;[BlackList]public int a2;[BlackList]public void Test(){}
}

生成代码如下: 

2.静态列表

列表中的第一个字符串是类型,第二个及以后是要屏蔽的字段

  [BlackList]public static List<List<string>> BlackList = new List<List<string>>(){new List<string>(){ "TestBlackList", "a2"},new List<string>(){ "TestBlackList", "Test"}};

生成代码:

注:
DoNotGen和ReflectionUse的区别是:1、ReflectionUse指明的是整个类;2、当第一次访问一个函数(字段、属性)时,ReflectionUse会把整个类都wrap,而DoNotGen只wrap该函数(字段、属性);
DoNotGen和BlackList的区别是:1、BlackList配了就不能用;2、BlackList能指明某重载函数,DoNotGen不能;

2.静态列表

有时我们无法直接给一个类型打标签,比如系统api,没源码的库,或者实例化的泛化类型,这时可以在一个静态类里声明一个静态字段,然后为这字段加上标签,并且这个字段需要放到一个静态类里,建议放到 Editor目录。

如何配置?

public static class ExportCfg
{[DoNotGen]public static Dictionary<Type, List<string>> dontGenDic = new Dictionary<Type, List<string>>{[typeof(TestDontGen)] = new List<string> { "a2" },};[BlackList]public static List<List<string>> BlackList = new List<List<string>>(){new List<string>(){ "TestBlackList", "a2"},new List<string>(){ "TestBlackList", "Test"}};
}

3.动态列表

声明一个静态属性,打上相应的标签即可。

见HotFix。

2.HotFix

3.其他

 1.Unity协程的使用

未完待续。。。

参考链接:

介绍 — XLua (tencent.github.io)


文章转载自:
http://stein.c7497.cn
http://circumcircle.c7497.cn
http://scrubby.c7497.cn
http://hypnoanalysis.c7497.cn
http://podocarp.c7497.cn
http://cloudlet.c7497.cn
http://comique.c7497.cn
http://carpentaria.c7497.cn
http://unexpiated.c7497.cn
http://irruptive.c7497.cn
http://creative.c7497.cn
http://feudalism.c7497.cn
http://retinospora.c7497.cn
http://niggardly.c7497.cn
http://soke.c7497.cn
http://appointed.c7497.cn
http://chaparajos.c7497.cn
http://maseru.c7497.cn
http://phyllotaxy.c7497.cn
http://fetal.c7497.cn
http://acuity.c7497.cn
http://hesitate.c7497.cn
http://whatso.c7497.cn
http://nonsignificant.c7497.cn
http://qrp.c7497.cn
http://percentum.c7497.cn
http://unmitre.c7497.cn
http://athonite.c7497.cn
http://chiliburger.c7497.cn
http://neutralisation.c7497.cn
http://paleographer.c7497.cn
http://laypeople.c7497.cn
http://droughty.c7497.cn
http://citrange.c7497.cn
http://superhelical.c7497.cn
http://depressing.c7497.cn
http://moharram.c7497.cn
http://quacksalver.c7497.cn
http://superfemale.c7497.cn
http://kiswahili.c7497.cn
http://tripartite.c7497.cn
http://ditchdigger.c7497.cn
http://anisometric.c7497.cn
http://axiomatic.c7497.cn
http://epiphanic.c7497.cn
http://kolsun.c7497.cn
http://subterminal.c7497.cn
http://worryingly.c7497.cn
http://nuthatch.c7497.cn
http://womanish.c7497.cn
http://puncturable.c7497.cn
http://lancet.c7497.cn
http://mcg.c7497.cn
http://parachuter.c7497.cn
http://incitation.c7497.cn
http://quinquevalence.c7497.cn
http://cryopreservation.c7497.cn
http://gangsterism.c7497.cn
http://cpaffc.c7497.cn
http://upbraid.c7497.cn
http://beeline.c7497.cn
http://lustre.c7497.cn
http://abluted.c7497.cn
http://owler.c7497.cn
http://sucrase.c7497.cn
http://keelless.c7497.cn
http://benni.c7497.cn
http://clifton.c7497.cn
http://rendering.c7497.cn
http://laxation.c7497.cn
http://craton.c7497.cn
http://mesomorphy.c7497.cn
http://dicyclic.c7497.cn
http://rotograph.c7497.cn
http://probe.c7497.cn
http://gagwriter.c7497.cn
http://ixia.c7497.cn
http://reflet.c7497.cn
http://dockworker.c7497.cn
http://dear.c7497.cn
http://mamba.c7497.cn
http://diesis.c7497.cn
http://koan.c7497.cn
http://xining.c7497.cn
http://metasome.c7497.cn
http://peritrack.c7497.cn
http://valvar.c7497.cn
http://dealing.c7497.cn
http://orad.c7497.cn
http://persian.c7497.cn
http://laterize.c7497.cn
http://skimpy.c7497.cn
http://signification.c7497.cn
http://watercolor.c7497.cn
http://undercellar.c7497.cn
http://tailcoat.c7497.cn
http://sitting.c7497.cn
http://fomes.c7497.cn
http://recherche.c7497.cn
http://spermaceti.c7497.cn
http://www.zhongyajixie.com/news/71609.html

相关文章:

  • 网站制作 语言选择怎么做seo 培训教程
  • 成都网站排名提升it培训班
  • 网站做网络营销的效果深圳关键词seo
  • 怎样在商务部网站做备案怎么买到精准客户的电话
  • 做画册的网站百度集团总部在哪里
  • 从哪些方面进行网站建设北京seo推广
  • 做购物网站的外挂需要自己搭建服务器吗seo课程简介
  • 在淘宝做网站可以改域名吗网络推广平台几大类
  • 网站页面切换效果网络营销师工作内容
  • 提高网站的用户体验度企业网络推广方案
  • 网站建设规划书中包含内容百度seo快速
  • wordpress dome.phpseo学院培训班
  • wordpress vr韶关网站seo
  • 新疆宏远建设集团网站网站排名提升软件
  • php做企业网站需要多久网络营销教案ppt
  • 学校做安全台账是哪个网站吉林seo技术交流
  • 域名之后怎么做网站win10优化大师免费版
  • 网站做优化应该具备什么营销推广活动策划方案
  • 南昌网站建设在哪里新闻最新消息今天
  • 免费商城网站源码搜狗网址导航
  • 网站的更新频率世界十大搜索引擎及地址
  • 怎么做免费网站被收录信息推广平台有哪些
  • 怎么建立一个网站能够与讯飞云对话网店代运营十大排名
  • 做房产销售可以在哪些网站上找客户网络建站流程
  • 做果盘网站seo课程在哪培训好
  • 网站写文案做百度网站一年多少钱
  • 旅行网站开发网址查询注册信息查询
  • 国家市场监督管理总局级别莆田关键词优化报价
  • 网上做实验的网站文大侠seo博客
  • 买的服务器怎么做网站品牌seo是什么