Bunch of changes
This commit is contained in:
parent
d6b9d88e87
commit
2c707d28e7
|
@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [1.0.4] - 2023-01-27
|
||||
### Added
|
||||
- Support for `bhl_native_class` token
|
||||
### Changed
|
||||
- `ecs_serializable` now `serializable`
|
||||
- Fields are not serializaed by default
|
||||
- `serializable` token now applicable to fields
|
||||
|
||||
## [1.0.1] - 2023-01-25
|
||||
### Fixed
|
||||
- Wrong type generation
|
||||
|
|
|
@ -4,9 +4,9 @@ This package is used for code generation of C# meta structs for LeoECS using Twi
|
|||
ecs.meta
|
||||
```
|
||||
struct TestComponent
|
||||
@bhl_ecs_component @ecs_gen_component @ecs_gen_authoring @ecs_serializable
|
||||
pos : Vector3
|
||||
fwd : Vector3
|
||||
@bhl_ecs_component @ecs_gen_component @ecs_gen_authoring @serializable
|
||||
pos : Vector3 @serializable
|
||||
fwd : Vector3 @serializable
|
||||
width : float
|
||||
length : float
|
||||
end
|
||||
|
@ -17,5 +17,5 @@ to be added on game object.
|
|||
# Tags:
|
||||
@ecs_gen_component - generates C# component
|
||||
@ecs_gen_authoring - generates authoring monobehaviour to be added on game object
|
||||
@ecs_serializable - makes component editable in inspector
|
||||
@serializable - makes component editable in inspector
|
||||
@ecs_tag - marks component tag
|
|
@ -4,7 +4,7 @@ namespace metagen_cs_ecs;
|
|||
function supported_tokens()
|
||||
{
|
||||
return [
|
||||
'ecs_serializable',
|
||||
'serializable',
|
||||
'ecs_gen_component',
|
||||
'ecs_gen_authoring',
|
||||
'ecs_tag',
|
||||
|
|
|
@ -8,7 +8,7 @@ using {{imp}};
|
|||
namespace {{namespace}}
|
||||
{
|
||||
{% endif %}
|
||||
{% if has_token(obj, 'ecs_serializable') %}
|
||||
{% if has_token(obj, 'serializable') %}
|
||||
[System.Serializable]
|
||||
{% endif %}
|
||||
{% apply trim('\n:, ', 'right') %}
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
{%- macro ecs_component_field(obj, field) -%}
|
||||
{%- if not has_token(field, 'serializable') -%}
|
||||
[System.NonSerialized]
|
||||
{%- endif -%}
|
||||
public {{field.type|ecs_type}} {{field.name}};
|
||||
{%- endmacro -%}
|
Loading…
Reference in New Issue