Prebuild Attributes pack
Basic
To activate prebuild generation in a script, you need to specify the activated attributes.
[Prebuild(typeof(Example), typeof(Example2))]
public class MyClass {
...
}
This prebuild pack activates the ClientAttribute, ServerAttribute and SyncVarAttribute's custom attributes.
Create a Custom package
public class MyNetworkPack : PrebuildPackage {
public Type[] Attributes {
get {
return new Type[]{
typeof(ClientAttribute),
typeof(ServerAttribute),
typeof(SyncVarAttribute)
};
}
}
}
public class MyNetworkAttribute : PrebuildAttribute {
public MyNetworkAttribute() : base(typeof(MyNetworkPack)) {}
public MyNetworkAttribute(string region) : base(region, typeof(MyNetworkPack)) {}
}
[MyNetwork]
public class MyClass {
...
}