forked from focus-creative-games/luban_examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
299 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
DesignerConfigs/Datas/test/unity_scriptable_objects/1.asset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!114 &11400000 | ||
MonoBehaviour: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 0} | ||
m_Enabled: 1 | ||
m_EditorHideFlags: 0 | ||
m_Script: {fileID: 11500000, guid: 1cbff1bfa4708914aaa381b1dd914663, type: 3} | ||
m_Name: 1 | ||
m_EditorClassIdentifier: | ||
id: 1 | ||
desc: aaaa | ||
rate: 0.45 | ||
num: 12131 | ||
v2: {x: 1, y: 1} | ||
v3: {x: 2, y: 2, z: 2} | ||
v4: {x: 3, y: 3, z: 4, w: 4} |
21 changes: 21 additions & 0 deletions
21
DesignerConfigs/Datas/test/unity_scriptable_objects/2.asset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!114 &11400000 | ||
MonoBehaviour: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 0} | ||
m_Enabled: 1 | ||
m_EditorHideFlags: 0 | ||
m_Script: {fileID: 11500000, guid: 1cbff1bfa4708914aaa381b1dd914663, type: 3} | ||
m_Name: 2 | ||
m_EditorClassIdentifier: | ||
id: 2 | ||
desc: bbbbb | ||
rate: 0.8 | ||
num: 1111 | ||
v2: {x: 1, y: 2} | ||
v3: {x: 1, y: 2, z: 3} | ||
v4: {x: 1, y: 2, z: 3, w: 4} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
|
||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by a tool. | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
using Bright.Serialization; | ||
using System.Collections.Generic; | ||
using System.Text.Json; | ||
|
||
|
||
|
||
namespace cfg.test | ||
{ | ||
|
||
public sealed class Foo : Bright.Config.BeanBase | ||
{ | ||
public Foo(JsonElement _json) | ||
{ | ||
Y1 = _json.GetProperty("y1").GetInt32(); | ||
Y2 = _json.GetProperty("y2").GetInt32(); | ||
Y3 = _json.GetProperty("y3").GetInt32(); | ||
} | ||
|
||
public Foo(int y1, int y2, int y3 ) | ||
{ | ||
this.Y1 = y1; | ||
this.Y2 = y2; | ||
this.Y3 = y3; | ||
} | ||
|
||
public static Foo DeserializeFoo(JsonElement _json) | ||
{ | ||
return new test.Foo(_json); | ||
} | ||
|
||
public int Y1 { get; private set; } | ||
public int Y2 { get; private set; } | ||
public int Y3 { get; private set; } | ||
|
||
public const int __ID__ = -1147950774; | ||
public override int GetTypeId() => __ID__; | ||
|
||
public void Resolve(Dictionary<string, object> _tables) | ||
{ | ||
} | ||
|
||
public void TranslateText(System.Func<string, string, string> translator) | ||
{ | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return "{ " | ||
+ "Y1:" + Y1 + "," | ||
+ "Y2:" + Y2 + "," | ||
+ "Y3:" + Y3 + "," | ||
+ "}"; | ||
} | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
Projects/Csharp_DotNet5_json/Gen/test/TbTestMultiColumn.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
|
||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by a tool. | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
using Bright.Serialization; | ||
using System.Collections.Generic; | ||
using System.Text.Json; | ||
|
||
|
||
|
||
namespace cfg.test | ||
{ | ||
|
||
public sealed class TbTestMultiColumn | ||
{ | ||
private readonly Dictionary<int, test.TestMultiColumn> _dataMap; | ||
private readonly List<test.TestMultiColumn> _dataList; | ||
|
||
public TbTestMultiColumn(JsonElement _json) | ||
{ | ||
_dataMap = new Dictionary<int, test.TestMultiColumn>(); | ||
_dataList = new List<test.TestMultiColumn>(); | ||
|
||
foreach(JsonElement _row in _json.EnumerateArray()) | ||
{ | ||
var _v = test.TestMultiColumn.DeserializeTestMultiColumn(_row); | ||
_dataList.Add(_v); | ||
_dataMap.Add(_v.Id, _v); | ||
} | ||
} | ||
|
||
public Dictionary<int, test.TestMultiColumn> DataMap => _dataMap; | ||
public List<test.TestMultiColumn> DataList => _dataList; | ||
|
||
public test.TestMultiColumn GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null; | ||
public test.TestMultiColumn Get(int key) => _dataMap[key]; | ||
public test.TestMultiColumn this[int key] => _dataMap[key]; | ||
|
||
public void Resolve(Dictionary<string, object> _tables) | ||
{ | ||
foreach(var v in _dataList) | ||
{ | ||
v.Resolve(_tables); | ||
} | ||
} | ||
|
||
public void TranslateText(System.Func<string, string, string> translator) | ||
{ | ||
foreach(var v in _dataList) | ||
{ | ||
v.TranslateText(translator); | ||
} | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
|
||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by a tool. | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
using Bright.Serialization; | ||
using System.Collections.Generic; | ||
using System.Text.Json; | ||
|
||
|
||
|
||
namespace cfg.test | ||
{ | ||
|
||
public sealed class TestMultiColumn : Bright.Config.BeanBase | ||
{ | ||
public TestMultiColumn(JsonElement _json) | ||
{ | ||
Id = _json.GetProperty("id").GetInt32(); | ||
A = test.Foo.DeserializeFoo(_json.GetProperty("a")); | ||
B = test.Foo.DeserializeFoo(_json.GetProperty("b")); | ||
C = test.Foo.DeserializeFoo(_json.GetProperty("c")); | ||
} | ||
|
||
public TestMultiColumn(int id, test.Foo a, test.Foo b, test.Foo c ) | ||
{ | ||
this.Id = id; | ||
this.A = a; | ||
this.B = b; | ||
this.C = c; | ||
} | ||
|
||
public static TestMultiColumn DeserializeTestMultiColumn(JsonElement _json) | ||
{ | ||
return new test.TestMultiColumn(_json); | ||
} | ||
|
||
public int Id { get; private set; } | ||
public test.Foo A { get; private set; } | ||
public test.Foo B { get; private set; } | ||
public test.Foo C { get; private set; } | ||
|
||
public const int __ID__ = -294473599; | ||
public override int GetTypeId() => __ID__; | ||
|
||
public void Resolve(Dictionary<string, object> _tables) | ||
{ | ||
A?.Resolve(_tables); | ||
B?.Resolve(_tables); | ||
C?.Resolve(_tables); | ||
} | ||
|
||
public void TranslateText(System.Func<string, string, string> translator) | ||
{ | ||
A?.TranslateText(translator); | ||
B?.TranslateText(translator); | ||
C?.TranslateText(translator); | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return "{ " | ||
+ "Id:" + Id + "," | ||
+ "A:" + A + "," | ||
+ "B:" + B + "," | ||
+ "C:" + C + "," | ||
+ "}"; | ||
} | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
Projects/GenerateDatas/json/test_tbtestscriptableobject.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
[ | ||
{ | ||
"id": 1, | ||
"desc": "aaaa", | ||
"rate": 0.45, | ||
"num": 12131, | ||
"v2": { | ||
"x": 1, | ||
"y": 1 | ||
}, | ||
"v3": { | ||
"x": 2, | ||
"y": 2, | ||
"z": 2 | ||
}, | ||
"v4": { | ||
"x": 3, | ||
"y": 3, | ||
"z": 4, | ||
"w": 4 | ||
} | ||
}, | ||
{ | ||
"id": 2, | ||
"desc": "bbbbb", | ||
"rate": 0.8, | ||
"num": 1111, | ||
"v2": { | ||
"x": 1, | ||
"y": 2 | ||
}, | ||
"v3": { | ||
"x": 1, | ||
"y": 2, | ||
"z": 3 | ||
}, | ||
"v4": { | ||
"x": 1, | ||
"y": 2, | ||
"z": 3, | ||
"w": 4 | ||
} | ||
} | ||
] |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.