From 11e4c1c1f2342a908dc9b473ddc8b0821aff3115 Mon Sep 17 00:00:00 2001 From: SepComet <202308010230@stu.csust.edu.cn> Date: Thu, 26 Feb 2026 21:36:29 +0800 Subject: [PATCH] =?UTF-8?q?P0-02=20=E8=A1=A5=E9=BD=90=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=A1=A8=EF=BC=9A=E7=BB=84=E4=BB=B6=E3=80=81=E6=95=8C=E4=BA=BA?= =?UTF-8?q?=E3=80=81=E6=B3=A2=E6=AC=A1=E3=80=81=E8=8A=82=E7=82=B9=E3=80=81?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E3=80=81=E5=95=86=E5=BA=97=E5=95=86=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 组件: - 底座:Assets\GameMain\DataTables\BaseComp.txt - 轴承:Assets\GameMain\DataTables\BearingComp.txt - 枪口:Assets\GameMain\DataTables\MuzzleComp.txt - 敌人:Assets\GameMain\DataTables\Enemy.txt - 波次: - 关卡:Assets\GameMain\DataTables\Level.txt - 关卡阶段(波次):Assets\GameMain\DataTables\LevelPhase.txt - 波次条目(波次出怪规则):Assets\GameMain\DataTables\LevelSpawnEntry.txt - 事件:Assets\GameMain\DataTables\Event.txt - 商店:Assets\GameMain\DataTables\ShopPrice.txt --- .gitignore | 1 + Assets/GameMain/DataTables/BaseComp.txt | 5 +- Assets/GameMain/DataTables/BearingComp.txt | 5 +- Assets/GameMain/DataTables/Enemy.txt | 5 + .../{Weapon.txt.meta => Enemy.txt.meta} | 2 +- Assets/GameMain/DataTables/Entity.txt | 7 +- Assets/GameMain/DataTables/Event.txt | 6 + Assets/GameMain/DataTables/Event.txt.meta | 7 + Assets/GameMain/DataTables/Level.txt | 7 + Assets/GameMain/DataTables/Level.txt.meta | 7 + Assets/GameMain/DataTables/LevelPhase.txt | 23 + .../GameMain/DataTables/LevelPhase.txt.meta | 7 + .../GameMain/DataTables/LevelSpawnEntry.txt | 33 + .../DataTables/LevelSpawnEntry.txt.meta | 7 + Assets/GameMain/DataTables/MuzzleComp.txt | 7 +- Assets/GameMain/DataTables/ShopPrice.txt | 8 + Assets/GameMain/DataTables/ShopPrice.txt.meta | 7 + Assets/GameMain/DataTables/UIForm.txt | 1 + Assets/GameMain/DataTables/Weapon.txt | 5 - .../GameMain/Scripts/Base/GameEntry.Custom.cs | 8 +- .../CustomComponent/CombatNodeComponent.cs | 145 ++ .../CombatNodeComponent.cs.meta | 3 + .../CustomComponent/EventNodeComponent.cs | 172 +++ .../EventNodeComponent.cs.meta | 3 + Assets/GameMain/Scripts/DataTable/DREnemy.cs | 63 + .../Scripts/DataTable/DREnemy.cs.meta | 3 + Assets/GameMain/Scripts/DataTable/DREvent.cs | 52 + .../Scripts/DataTable/DREvent.cs.meta | 3 + Assets/GameMain/Scripts/DataTable/DRLevel.cs | 72 + .../Scripts/DataTable/DRLevel.cs.meta | 3 + .../Scripts/DataTable/DRLevelPhase.cs | 64 + .../Scripts/DataTable/DRLevelPhase.cs.meta | 3 + .../Scripts/DataTable/DRLevelSpawnEntry.cs | 94 ++ .../DataTable/DRLevelSpawnEntry.cs.meta | 3 + .../GameMain/Scripts/DataTable/DRShopPrice.cs | 38 + .../Scripts/DataTable/DRShopPrice.cs.meta | 3 + .../Definition/DataStruct/EventItem.cs | 18 + .../Definition/DataStruct/EventItem.cs.meta | 3 + .../Definition/DataStruct/EventOption.cs | 25 + .../Definition/DataStruct/EventOption.cs.meta | 3 + .../Definition/Enum/AttackPropertyType.cs | 2 +- .../Scripts/Definition/Enum/EntryType.cs | 13 + .../Scripts/Definition/Enum/EntryType.cs.meta | 3 + .../Definition/Enum/EventEffectType.cs | 21 + .../Definition/Enum/EventEffectType.cs.meta | 3 + .../Definition/Enum/EventRequirementType.cs | 11 + .../Enum/EventRequirementType.cs.meta | 3 + .../Scripts/Definition/Enum/LevelThemeType.cs | 10 + .../Definition/Enum/LevelThemeType.cs.meta | 3 + .../Definition/Enum/LevelVictoryType.cs | 10 + .../Definition/Enum/LevelVictoryType.cs.meta | 3 + .../Scripts/Definition/Enum/PhaseEndType.cs | 13 + .../Definition/Enum/PhaseEndType.cs.meta | 3 + .../Scripts/Definition/Enum/UIFormType.cs | 5 + .../Scripts/Definition/EventEffect.meta | 3 + .../Definition/EventEffect/AddGoldEffect.cs | 25 + .../EventEffect/AddGoldEffect.cs.meta | 3 + .../EventEffect/AddRandomCompsEffect.cs | 28 + .../EventEffect/AddRandomCompsEffect.cs.meta | 3 + .../DamageRandomTowerEnduranceEffect.cs | 34 + .../DamageRandomTowerEnduranceEffect.cs.meta | 3 + .../Definition/EventEffect/EventEffectBase.cs | 14 + .../EventEffect/EventEffectBase.cs.meta | 3 + .../EventEffect/RemoveRandomCompEffect.cs | 27 + .../RemoveRandomCompEffect.cs.meta | 3 + .../Scripts/Definition/EventEffectFactory.cs | 76 ++ .../Definition/EventEffectFactory.cs.meta | 3 + .../Scripts/Definition/EventRequirement.meta | 3 + .../CompCountAtLeastRequirement.cs | 26 + .../CompCountAtLeastRequirement.cs.meta | 3 + .../EventRequirement/EventRequirementBase.cs | 12 + .../EventRequirementBase.cs.meta | 3 + .../GoldAtLeastRequirement.cs | 24 + .../GoldAtLeastRequirement.cs.meta | 3 + .../EventRequirement/HasRelicRequirement.cs | 24 + .../HasRelicRequirement.cs.meta | 3 + .../TowerCountAtLeastRequirement.cs | 24 + .../TowerCountAtLeastRequirement.cs.meta | 3 + .../Definition/EventRequirementFactory.cs | 74 ++ .../EventRequirementFactory.cs.meta | 3 + Assets/GameMain/Scripts/Event.meta | 3 + .../Event/EventOptionItemSelectedEventArgs.cs | 27 + .../EventOptionItemSelectedEventArgs.cs.meta | 3 + .../Scripts/Procedure/ProcedureChangeScene.cs | 26 +- .../Scripts/Procedure/ProcedureMenu.cs | 49 + .../Scripts/Procedure/ProcedureMenu.cs.meta | 3 + .../Scripts/Procedure/ProcedurePreload.cs | 77 +- .../Scripts/Procedure/ProcedureTest.cs | 30 + .../Scripts/Procedure/ProcedureTest.cs.meta | 3 + .../UI/GameScene/Context.meta} | 2 +- .../UI/GameScene/Context/EventFormContext.cs | 12 + .../Context/EventFormContext.cs.meta | 3 + .../Context/EventOptionItemContext.cs | 8 + .../Context/EventOptionItemContext.cs.meta | 3 + .../Scripts/UI/GameScene/Controller.meta | 8 + .../Controller/EventFormController.cs | 124 ++ .../Controller/EventFormController.cs.meta | 3 + .../Scripts/UI/GameScene/RawData.meta | 8 + .../UI/GameScene/RawData/EventFormRawData.cs | 9 + .../RawData/EventFormRawData.cs.meta | 3 + .../Scripts/UI/GameScene/UseCase.meta | 8 + .../UI/GameScene/UseCase/EventFormUseCase.cs | 46 + .../UseCase/EventFormUseCase.cs.meta | 3 + .../GameMain/Scripts/UI/GameScene/View.meta | 8 + .../Scripts/UI/GameScene/View/EventForm.cs | 81 ++ .../UI/GameScene/View/EventForm.cs.meta | 3 + .../UI/GameScene/View/EventOptionItem.cs | 50 + .../UI/GameScene/View/EventOptionItem.cs.meta | 3 + .../GameMain/Scripts/Utility/AssetUtility.cs | 12 +- .../Scripts/Utility/JsonNetUtility.cs | 26 + ...nHelper.cs.meta => JsonNetUtility.cs.meta} | 5 +- .../GameMain/Scripts/Utility/LitJsonHelper.cs | 52 - Assets/Launcher.unity | 1178 ++++++++++++++++- Packages/manifest.json | 3 +- Packages/packages-lock.json | 7 + 115 files changed, 3218 insertions(+), 135 deletions(-) create mode 100644 Assets/GameMain/DataTables/Enemy.txt rename Assets/GameMain/DataTables/{Weapon.txt.meta => Enemy.txt.meta} (75%) create mode 100644 Assets/GameMain/DataTables/Event.txt create mode 100644 Assets/GameMain/DataTables/Event.txt.meta create mode 100644 Assets/GameMain/DataTables/Level.txt create mode 100644 Assets/GameMain/DataTables/Level.txt.meta create mode 100644 Assets/GameMain/DataTables/LevelPhase.txt create mode 100644 Assets/GameMain/DataTables/LevelPhase.txt.meta create mode 100644 Assets/GameMain/DataTables/LevelSpawnEntry.txt create mode 100644 Assets/GameMain/DataTables/LevelSpawnEntry.txt.meta create mode 100644 Assets/GameMain/DataTables/ShopPrice.txt create mode 100644 Assets/GameMain/DataTables/ShopPrice.txt.meta delete mode 100644 Assets/GameMain/DataTables/Weapon.txt create mode 100644 Assets/GameMain/Scripts/CustomComponent/CombatNodeComponent.cs create mode 100644 Assets/GameMain/Scripts/CustomComponent/CombatNodeComponent.cs.meta create mode 100644 Assets/GameMain/Scripts/CustomComponent/EventNodeComponent.cs create mode 100644 Assets/GameMain/Scripts/CustomComponent/EventNodeComponent.cs.meta create mode 100644 Assets/GameMain/Scripts/DataTable/DREnemy.cs create mode 100644 Assets/GameMain/Scripts/DataTable/DREnemy.cs.meta create mode 100644 Assets/GameMain/Scripts/DataTable/DREvent.cs create mode 100644 Assets/GameMain/Scripts/DataTable/DREvent.cs.meta create mode 100644 Assets/GameMain/Scripts/DataTable/DRLevel.cs create mode 100644 Assets/GameMain/Scripts/DataTable/DRLevel.cs.meta create mode 100644 Assets/GameMain/Scripts/DataTable/DRLevelPhase.cs create mode 100644 Assets/GameMain/Scripts/DataTable/DRLevelPhase.cs.meta create mode 100644 Assets/GameMain/Scripts/DataTable/DRLevelSpawnEntry.cs create mode 100644 Assets/GameMain/Scripts/DataTable/DRLevelSpawnEntry.cs.meta create mode 100644 Assets/GameMain/Scripts/DataTable/DRShopPrice.cs create mode 100644 Assets/GameMain/Scripts/DataTable/DRShopPrice.cs.meta create mode 100644 Assets/GameMain/Scripts/Definition/DataStruct/EventItem.cs create mode 100644 Assets/GameMain/Scripts/Definition/DataStruct/EventItem.cs.meta create mode 100644 Assets/GameMain/Scripts/Definition/DataStruct/EventOption.cs create mode 100644 Assets/GameMain/Scripts/Definition/DataStruct/EventOption.cs.meta create mode 100644 Assets/GameMain/Scripts/Definition/Enum/EntryType.cs create mode 100644 Assets/GameMain/Scripts/Definition/Enum/EntryType.cs.meta create mode 100644 Assets/GameMain/Scripts/Definition/Enum/EventEffectType.cs create mode 100644 Assets/GameMain/Scripts/Definition/Enum/EventEffectType.cs.meta create mode 100644 Assets/GameMain/Scripts/Definition/Enum/EventRequirementType.cs create mode 100644 Assets/GameMain/Scripts/Definition/Enum/EventRequirementType.cs.meta create mode 100644 Assets/GameMain/Scripts/Definition/Enum/LevelThemeType.cs create mode 100644 Assets/GameMain/Scripts/Definition/Enum/LevelThemeType.cs.meta create mode 100644 Assets/GameMain/Scripts/Definition/Enum/LevelVictoryType.cs create mode 100644 Assets/GameMain/Scripts/Definition/Enum/LevelVictoryType.cs.meta create mode 100644 Assets/GameMain/Scripts/Definition/Enum/PhaseEndType.cs create mode 100644 Assets/GameMain/Scripts/Definition/Enum/PhaseEndType.cs.meta create mode 100644 Assets/GameMain/Scripts/Definition/EventEffect.meta create mode 100644 Assets/GameMain/Scripts/Definition/EventEffect/AddGoldEffect.cs create mode 100644 Assets/GameMain/Scripts/Definition/EventEffect/AddGoldEffect.cs.meta create mode 100644 Assets/GameMain/Scripts/Definition/EventEffect/AddRandomCompsEffect.cs create mode 100644 Assets/GameMain/Scripts/Definition/EventEffect/AddRandomCompsEffect.cs.meta create mode 100644 Assets/GameMain/Scripts/Definition/EventEffect/DamageRandomTowerEnduranceEffect.cs create mode 100644 Assets/GameMain/Scripts/Definition/EventEffect/DamageRandomTowerEnduranceEffect.cs.meta create mode 100644 Assets/GameMain/Scripts/Definition/EventEffect/EventEffectBase.cs create mode 100644 Assets/GameMain/Scripts/Definition/EventEffect/EventEffectBase.cs.meta create mode 100644 Assets/GameMain/Scripts/Definition/EventEffect/RemoveRandomCompEffect.cs create mode 100644 Assets/GameMain/Scripts/Definition/EventEffect/RemoveRandomCompEffect.cs.meta create mode 100644 Assets/GameMain/Scripts/Definition/EventEffectFactory.cs create mode 100644 Assets/GameMain/Scripts/Definition/EventEffectFactory.cs.meta create mode 100644 Assets/GameMain/Scripts/Definition/EventRequirement.meta create mode 100644 Assets/GameMain/Scripts/Definition/EventRequirement/CompCountAtLeastRequirement.cs create mode 100644 Assets/GameMain/Scripts/Definition/EventRequirement/CompCountAtLeastRequirement.cs.meta create mode 100644 Assets/GameMain/Scripts/Definition/EventRequirement/EventRequirementBase.cs create mode 100644 Assets/GameMain/Scripts/Definition/EventRequirement/EventRequirementBase.cs.meta create mode 100644 Assets/GameMain/Scripts/Definition/EventRequirement/GoldAtLeastRequirement.cs create mode 100644 Assets/GameMain/Scripts/Definition/EventRequirement/GoldAtLeastRequirement.cs.meta create mode 100644 Assets/GameMain/Scripts/Definition/EventRequirement/HasRelicRequirement.cs create mode 100644 Assets/GameMain/Scripts/Definition/EventRequirement/HasRelicRequirement.cs.meta create mode 100644 Assets/GameMain/Scripts/Definition/EventRequirement/TowerCountAtLeastRequirement.cs create mode 100644 Assets/GameMain/Scripts/Definition/EventRequirement/TowerCountAtLeastRequirement.cs.meta create mode 100644 Assets/GameMain/Scripts/Definition/EventRequirementFactory.cs create mode 100644 Assets/GameMain/Scripts/Definition/EventRequirementFactory.cs.meta create mode 100644 Assets/GameMain/Scripts/Event.meta create mode 100644 Assets/GameMain/Scripts/Event/EventOptionItemSelectedEventArgs.cs create mode 100644 Assets/GameMain/Scripts/Event/EventOptionItemSelectedEventArgs.cs.meta create mode 100644 Assets/GameMain/Scripts/Procedure/ProcedureMenu.cs create mode 100644 Assets/GameMain/Scripts/Procedure/ProcedureMenu.cs.meta create mode 100644 Assets/GameMain/Scripts/Procedure/ProcedureTest.cs create mode 100644 Assets/GameMain/Scripts/Procedure/ProcedureTest.cs.meta rename Assets/GameMain/{Components.meta => Scripts/UI/GameScene/Context.meta} (77%) create mode 100644 Assets/GameMain/Scripts/UI/GameScene/Context/EventFormContext.cs create mode 100644 Assets/GameMain/Scripts/UI/GameScene/Context/EventFormContext.cs.meta create mode 100644 Assets/GameMain/Scripts/UI/GameScene/Context/EventOptionItemContext.cs create mode 100644 Assets/GameMain/Scripts/UI/GameScene/Context/EventOptionItemContext.cs.meta create mode 100644 Assets/GameMain/Scripts/UI/GameScene/Controller.meta create mode 100644 Assets/GameMain/Scripts/UI/GameScene/Controller/EventFormController.cs create mode 100644 Assets/GameMain/Scripts/UI/GameScene/Controller/EventFormController.cs.meta create mode 100644 Assets/GameMain/Scripts/UI/GameScene/RawData.meta create mode 100644 Assets/GameMain/Scripts/UI/GameScene/RawData/EventFormRawData.cs create mode 100644 Assets/GameMain/Scripts/UI/GameScene/RawData/EventFormRawData.cs.meta create mode 100644 Assets/GameMain/Scripts/UI/GameScene/UseCase.meta create mode 100644 Assets/GameMain/Scripts/UI/GameScene/UseCase/EventFormUseCase.cs create mode 100644 Assets/GameMain/Scripts/UI/GameScene/UseCase/EventFormUseCase.cs.meta create mode 100644 Assets/GameMain/Scripts/UI/GameScene/View.meta create mode 100644 Assets/GameMain/Scripts/UI/GameScene/View/EventForm.cs create mode 100644 Assets/GameMain/Scripts/UI/GameScene/View/EventForm.cs.meta create mode 100644 Assets/GameMain/Scripts/UI/GameScene/View/EventOptionItem.cs create mode 100644 Assets/GameMain/Scripts/UI/GameScene/View/EventOptionItem.cs.meta create mode 100644 Assets/GameMain/Scripts/Utility/JsonNetUtility.cs rename Assets/GameMain/Scripts/Utility/{LitJsonHelper.cs.meta => JsonNetUtility.cs.meta} (69%) delete mode 100644 Assets/GameMain/Scripts/Utility/LitJsonHelper.cs diff --git a/.gitignore b/.gitignore index e94f411..8687a76 100644 --- a/.gitignore +++ b/.gitignore @@ -101,3 +101,4 @@ InitTestScene*.unity* /数据表 /.vscode AGENTS.md +/.dotnet-home diff --git a/Assets/GameMain/DataTables/BaseComp.txt b/Assets/GameMain/DataTables/BaseComp.txt index abcce00..d4522ad 100644 --- a/Assets/GameMain/DataTables/BaseComp.txt +++ b/Assets/GameMain/DataTables/BaseComp.txt @@ -1,7 +1,6 @@ -# 底座表 -# Id EntityId Name AttackSpeed PropertyType Constraint PossibleTag +# Id 策划备注 EntityId Name AttackSpeed PropertyType Constraint PossibleTag # int int string float[] AttackPropertyType string TagType[] -# 底座编号 策划备注 实体Id 底座名 攻击速度(秒/次) 攻击属性 属性约束 可能出现的Tag +# 底座编号 实体Id 底座名 攻击速度(秒/次) 攻击属性 属性约束 可能出现的Tag 1 301 元素底座 [2,1.5,1,0.8,0.7] Fire [Fire,BurnSpread,IgniteBurst,Inferno] 2 301 控制底座 [4,3.8,3.6,3.4,3.2] Ice [Ice,FreezeMask,Shatter,AbsoluteZero] 3 301 穿透底座 [1,0,8,0,6,0.4,0.2] Physics [Pierce,Crit,Overpenetrate,Execution] diff --git a/Assets/GameMain/DataTables/BearingComp.txt b/Assets/GameMain/DataTables/BearingComp.txt index 5e9c166..981351b 100644 --- a/Assets/GameMain/DataTables/BearingComp.txt +++ b/Assets/GameMain/DataTables/BearingComp.txt @@ -1,7 +1,6 @@ -# 轴承表 -# Id EntityId Name RotateSpeed AttackRange Constraint PossibleTag +# Id 策划备注 EntityId Name RotateSpeed AttackRange Constraint PossibleTag # int int string float[] float[] string TagType[] -# 轴承编号 策划备注 实体Id 轴承名 各品质旋转速度 各品质攻击范围 属性约束 可能出现的Tag +# 轴承编号 实体Id 轴承名 各品质旋转速度 各品质攻击范围 属性约束 可能出现的Tag 1 201 元素轴承 [10,12,13,14,15] [2,2,2,2,2] [Fire,BurnSpread,IgniteBurst,Inferno] 2 201 控制轴承 [20,25,30,32,35] [6,6.5,7,8,8] [Ice,FreezeMask,Shatter,AbsoluteZero] 3 201 穿透轴承 [60,70,80,90,100] [4,4.5,5,5.5,6] [Pierce,Crit,Overpenetrate,Execution] diff --git a/Assets/GameMain/DataTables/Enemy.txt b/Assets/GameMain/DataTables/Enemy.txt new file mode 100644 index 0000000..0503cc2 --- /dev/null +++ b/Assets/GameMain/DataTables/Enemy.txt @@ -0,0 +1,5 @@ +# Id 策划备注 EntityId BaseHp BaseDamage Speed DropCoin +# int int int int float int +# 敌人Id 敌人实体Id 基础血量 基地伤害 移动速度 掉落硬币 + 1 1001 500 5 1 5 + 2 1002 5000 50 0.5 100 diff --git a/Assets/GameMain/DataTables/Weapon.txt.meta b/Assets/GameMain/DataTables/Enemy.txt.meta similarity index 75% rename from Assets/GameMain/DataTables/Weapon.txt.meta rename to Assets/GameMain/DataTables/Enemy.txt.meta index bca7511..da23901 100644 --- a/Assets/GameMain/DataTables/Weapon.txt.meta +++ b/Assets/GameMain/DataTables/Enemy.txt.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d2ccda2aca4a348428805b273ee2aaf2 +guid: d860a5c1c09addf4ba7539e97c85c0bd TextScriptImporter: externalObjects: {} userData: diff --git a/Assets/GameMain/DataTables/Entity.txt b/Assets/GameMain/DataTables/Entity.txt index 6c4209e..6b548f6 100644 --- a/Assets/GameMain/DataTables/Entity.txt +++ b/Assets/GameMain/DataTables/Entity.txt @@ -1,7 +1,8 @@ -# 实体表 -# Id AssetName +# Id 策划备注 AssetName # int string -# 实体编号 策划备注 资源名称 +# 实体编号 资源名称 101 测试枪口 TestMuzzle 201 测试轴承 TestBearing 301 测试底座 TestBase + 1001 测试普通敌人 TestEnemy + 1002 测试Boss TestBoss diff --git a/Assets/GameMain/DataTables/Event.txt b/Assets/GameMain/DataTables/Event.txt new file mode 100644 index 0000000..b8190fb --- /dev/null +++ b/Assets/GameMain/DataTables/Event.txt @@ -0,0 +1,6 @@ +# Id 列1 Title Description Options +# int string string string +# 事件编号 策划备注 事件题目 事件描述 事件选项 + 1 赌马 一名商人邀请你下注。赢了就能赚一笔。 [{"optionText":"下注 100(金)- 稳健:70% 赢 150","requirements":[{"type":"GoldAtLeast","param":{"Count":100}}],"costEffects":[{"type":"AddGold","param":{"Count":-100}}],"rewardEffects":[{"type":"AddGold","param":{"Count":150}}],"probability":0.7},{"optionText":"下注 100(金)- 激进:30% 赢 250","requirements":[{"type":"GoldAtLeast","param":{"Count":100}}],"costEffects":[{"type":"AddGold","param":{"Count":-100}}],"rewardEffects":[{"type":"AddGold","param":{"Count":250}}],"probability":0.3}] + 2 工匠的熔炉 工匠以金币交换防御塔组件。 [{"optionText":"交出 3 个白色组件,获得 50 金币","requirements":[{"type":"CompCountAtLeast","param":{"Count":3,"Rarity":"White"}}],"costEffects":[{"type":"RemoveRandomComps","param":{"Count":3,"Rarity":"White"}}],"rewardEffects":[{"type":"AddGold","param":{"Count":50}}]},{"optionText":"交出 2 个绿色组件,获得 70 金币","requirements":[{"type":"CompCountAtLeast","param":{"Count":2,"Rarity":"Green"}}],"costEffects":[{"type":"RemoveRandomComps","param":{"Count":2,"Rarity":"Green"}}],"rewardEffects":[{"type":"AddGold","param":{"Count":70}}]},{"optionText":"交出 1 个蓝色组件,获得 80 金币","requirements":[{"type":"CompCountAtLeast","param":{"Count":1,"Rarity":"Blue"}}],"costEffects":[{"type":"RemoveRandomComps","param":{"Count":1,"Rarity":"Blue"}}],"rewardEffects":[{"type":"AddGold","param":{"Count":80}}]},{"optionText":"拒绝","rewardEffects":[]}] + 3 代价与回报 某种黑暗力量向你索取代价。 [{"optionText":"展示你的防御塔","requirements":[{"type":"TowerCountAtLeast","param":{"Count":2}}],"rewardEffects":[{"type":"AddGold","param":{"Count":50}}]},{"optionText":"离开","rewardEffects":[]}] diff --git a/Assets/GameMain/DataTables/Event.txt.meta b/Assets/GameMain/DataTables/Event.txt.meta new file mode 100644 index 0000000..d881993 --- /dev/null +++ b/Assets/GameMain/DataTables/Event.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d64aa32f74f749c42847421244466515 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/DataTables/Level.txt b/Assets/GameMain/DataTables/Level.txt new file mode 100644 index 0000000..ab6d063 --- /dev/null +++ b/Assets/GameMain/DataTables/Level.txt @@ -0,0 +1,7 @@ +# Id 列1 LevelThemeType BaseHp StartCoin VictoryType VictoryParam RewardGold +# int LevelThemeType int int VictoryType string int +# 关卡号 策划备注 关卡所属主题类型 基地初始生命 初始硬币 胜利条件 胜利参数 奖励金币 + 1 平原1 Plain 100 100 PhasesCleared 30 + 2 平原2 Plain 100 100 PhasesCleared 30 + 3 平原3 Plain 100 100 PhasesCleared 40 + 4 平原4 Plain 100 100 BossDead 100 diff --git a/Assets/GameMain/DataTables/Level.txt.meta b/Assets/GameMain/DataTables/Level.txt.meta new file mode 100644 index 0000000..e245e31 --- /dev/null +++ b/Assets/GameMain/DataTables/Level.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 05abbe814ec127b46a5e1a640a899e09 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/DataTables/LevelPhase.txt b/Assets/GameMain/DataTables/LevelPhase.txt new file mode 100644 index 0000000..784028c --- /dev/null +++ b/Assets/GameMain/DataTables/LevelPhase.txt @@ -0,0 +1,23 @@ +# Id 列1 DurationSeconds EndType EndParam +# int int PhaseEndType string +# 关卡阶段号 策划备注 波次持续时间 波次结束条件 结束参数 + 1001 平原1.1 60 TimeElapsed 60 + 1002 平原1.2 60 TimeElapsed 60 + 1003 平原1.3 60 TimeElapsed 60 + 1004 平原1.4 60 EnemiesCleared 60 + 1005 平原1.* 0 + 2001 平原2.1 60 TimeElapsed 60 + 2002 平原2.2 60 TimeElapsed 60 + 2003 平原2.3 60 TimeElapsed 60 + 2004 平原2.4 60 EnemiesCleared 60 + 2005 平原2.* 0 + 3001 平原3.1 60 TimeElapsed 60 + 3002 平原3.2 60 TimeElapsed 60 + 3003 平原3.3 60 TimeElapsed 60 + 3004 平原3.4 60 EnemiesCleared 60 + 3005 平原3.* 0 + 4001 平原4.1 60 TimeElapsed 60 + 4002 平原4.2 60 TimeElapsed 60 + 4003 平原4.3 60 TimeElapsed 60 + 4004 平原4.4 60 TimeElapsed 60 + 4005 平原4.5 0 BossDead diff --git a/Assets/GameMain/DataTables/LevelPhase.txt.meta b/Assets/GameMain/DataTables/LevelPhase.txt.meta new file mode 100644 index 0000000..45a8307 --- /dev/null +++ b/Assets/GameMain/DataTables/LevelPhase.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 392984cd87843f34989251453d4a455b +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/DataTables/LevelSpawnEntry.txt b/Assets/GameMain/DataTables/LevelSpawnEntry.txt new file mode 100644 index 0000000..ac1cd94 --- /dev/null +++ b/Assets/GameMain/DataTables/LevelSpawnEntry.txt @@ -0,0 +1,33 @@ +# Id 列1 SpawnPointId StartTime EntryType EnemyId Count Interval Duration Gap +# int int int EntryType int int float int float +# 阶段条目号 策划备注 敌人出生口Id 相对时间 条目类型 敌人Id 单次出怪数量 出怪间隔 持续时间 单怪出生时间间隔 + 1001001 1 5 Stream 1 3 5 60 0 + 1001002 2 5 Burst 1 10 0 0 0.5 + 1002001 1 3 Stream 1 3 5 60 0 + 1002002 2 3 Burst 1 10 0 0 0.5 + 1003001 1 5 Stream 1 3 5 60 0 + 1003002 2 5 Burst 1 10 0 0 0.5 + 1004001 1 3 Stream 1 3 5 60 0 + 1004002 2 3 Burst 1 10 0 0 0.5 + 1005001 1 5 Stream 1 3 5 60 0 + 1005002 2 5 Burst 1 10 0 0 0.5 + 2001001 1 5 Stream 1 3 5 60 0 + 2002001 1 5 Burst 1 10 0 0 0.5 + 2003001 1 5 Stream 1 3 5 60 0 + 2004001 1 5 Burst 1 10 0 0 0.5 + 2005001 1 5 Stream 1 3 5 60 0 + 3001001 1 5 Stream 1 3 5 60 0 + 3001002 2 5 Burst 1 10 0 0 0.5 + 3002001 1 3 Stream 1 3 5 60 0 + 3002002 2 3 Burst 1 10 0 0 0.5 + 3003001 1 5 Stream 1 3 5 60 0 + 3003002 2 5 Burst 1 10 0 0 0.5 + 3004001 1 3 Stream 1 3 5 60 0 + 3004002 2 3 Burst 1 10 0 0 0.5 + 3005001 1 5 Stream 1 3 5 60 0 + 3005002 2 5 Burst 1 10 0 0 0.5 + 4001001 1 5 Stream 1 3 5 60 0 + 4002001 1 5 Burst 1 10 0 0 0.5 + 4003001 1 5 Stream 1 3 5 60 0 + 4004001 1 5 Burst 1 10 0 0 0.5 + 4005001 1 5 Boss 2 1 5 60 0 diff --git a/Assets/GameMain/DataTables/LevelSpawnEntry.txt.meta b/Assets/GameMain/DataTables/LevelSpawnEntry.txt.meta new file mode 100644 index 0000000..f57c75c --- /dev/null +++ b/Assets/GameMain/DataTables/LevelSpawnEntry.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 554836c1a57522a4e887ae48023708fc +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/DataTables/MuzzleComp.txt b/Assets/GameMain/DataTables/MuzzleComp.txt index bd22919..00a1460 100644 --- a/Assets/GameMain/DataTables/MuzzleComp.txt +++ b/Assets/GameMain/DataTables/MuzzleComp.txt @@ -1,7 +1,6 @@ -# 枪口表 -# Id EntityId Name AttackDamage DamageRandomRate Method Constraint PossibleTag -# int int string int[] float AttackMethodType string TagType[] -# 枪口编号 策划备注 实体Id 枪口名 各品质伤害 伤害浮动 攻击方式 属性约束 可能出现的Tag +# Id 策划备注 EntityId Name AttackDamage DamageRandomRate Method Constraint PossibleTag +# int int string int[] float AttackMethodType Constraint TagType[] +# 枪口编号 策划备注 实体Id 枪口名 各品质伤害 伤害浮动 攻击方式 Constraint 可能出现的Tag 1 101 元素枪口 [20,30,40,50,80] 0.05 NormalBullet [Fire,BurnSpread,IgniteBurst,Inferno] 2 101 控制枪口 [30,50,70,90,100] 0.01 NormalBullet [Ice,FreezeMask,Shatter,AbsoluteZero] 3 101 穿透枪口 [50,55,60,80,90] 0.02 NormalBullet [Pierce,Crit,Overpenetrate,Execution] diff --git a/Assets/GameMain/DataTables/ShopPrice.txt b/Assets/GameMain/DataTables/ShopPrice.txt new file mode 100644 index 0000000..38c4897 --- /dev/null +++ b/Assets/GameMain/DataTables/ShopPrice.txt @@ -0,0 +1,8 @@ +# Id 列1 Rarity MinPrice MaxPrice +# int RarityType int int +# 定价编号 策划备注 商品品质 最低价格 最高价格 + 1 White 10 30 + 2 Green 50 70 + 3 Blue 100 120 + 4 Purple 150 170 + 5 Red 200 220 diff --git a/Assets/GameMain/DataTables/ShopPrice.txt.meta b/Assets/GameMain/DataTables/ShopPrice.txt.meta new file mode 100644 index 0000000..5d1a1a6 --- /dev/null +++ b/Assets/GameMain/DataTables/ShopPrice.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 55f4464fd7c6ad14584b9b10aabc18ba +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/DataTables/UIForm.txt b/Assets/GameMain/DataTables/UIForm.txt index 6b11bd8..2cc76c3 100644 --- a/Assets/GameMain/DataTables/UIForm.txt +++ b/Assets/GameMain/DataTables/UIForm.txt @@ -6,3 +6,4 @@ 100 主菜单 MenuForm Default False True 101 设置 SettingForm Default False True 102 关于 AboutForm Default False True + 201 事件UI EventForm Default False True diff --git a/Assets/GameMain/DataTables/Weapon.txt b/Assets/GameMain/DataTables/Weapon.txt deleted file mode 100644 index 8d2b3fd..0000000 --- a/Assets/GameMain/DataTables/Weapon.txt +++ /dev/null @@ -1,5 +0,0 @@ -# 武器表 -# Id Attack AttackInterval BulletId BulletSpeed BulletSoundId -# int int float int float int -# 武器编号 策划备注 攻击力 攻击间隔 子弹编号 子弹速度 子弹声音编号 - 30000 玩家武器 100 0.2 50000 20 10000 diff --git a/Assets/GameMain/Scripts/Base/GameEntry.Custom.cs b/Assets/GameMain/Scripts/Base/GameEntry.Custom.cs index 1d5532a..b5fec7b 100644 --- a/Assets/GameMain/Scripts/Base/GameEntry.Custom.cs +++ b/Assets/GameMain/Scripts/Base/GameEntry.Custom.cs @@ -19,10 +19,16 @@ public partial class GameEntry : MonoBehaviour public static EnemyManagerComponent EnemyManager { get; private set; } + public static EventNodeComponent EventNode { get; private set; } + + public static CombatNodeComponent CombatNode { get; private set; } + private static void InitCustomComponents() { BuiltinData = UnityGameFramework.Runtime.GameEntry.GetComponent(); HPBar = UnityGameFramework.Runtime.GameEntry.GetComponent(); EnemyManager = UnityGameFramework.Runtime.GameEntry.GetComponent(); + EventNode = UnityGameFramework.Runtime.GameEntry.GetComponent(); + CombatNode = UnityGameFramework.Runtime.GameEntry.GetComponent(); } -} \ No newline at end of file +} diff --git a/Assets/GameMain/Scripts/CustomComponent/CombatNodeComponent.cs b/Assets/GameMain/Scripts/CustomComponent/CombatNodeComponent.cs new file mode 100644 index 0000000..a303ec1 --- /dev/null +++ b/Assets/GameMain/Scripts/CustomComponent/CombatNodeComponent.cs @@ -0,0 +1,145 @@ +using System.Collections.Generic; +using GameFramework.DataTable; +using GeometryTD.DataTable; +using GeometryTD.Definition; +using UnityEngine; +using UnityGameFramework.Runtime; + +namespace GeometryTD.CustomComponent +{ + /// + /// 战斗节点组件 + /// + public class CombatNodeComponent : GameFrameworkComponent + { + // Level.Id => Level + private readonly Dictionary _levelsById = new(); + + // LevelId => LevelPhases + private readonly Dictionary> _phasesByLevelId = new(); + + // LevelPhase.Id => LevelSpawnEntries + private readonly Dictionary> _spawnEntriesByPhaseId = new(); + + private readonly List _levelIdBuffer = new(); + + public LevelThemeType CurrentThemeType { get; private set; } + public DRLevel CurrentLevel { get; private set; } + + public void OnInit(LevelThemeType themeType) + { + CurrentThemeType = themeType; + CurrentLevel = null; + _levelsById.Clear(); + _phasesByLevelId.Clear(); + _spawnEntriesByPhaseId.Clear(); + _levelIdBuffer.Clear(); + + IDataTable dtLevel = GameEntry.DataTable.GetDataTable(); + IDataTable dtLevelPhase = GameEntry.DataTable.GetDataTable(); + IDataTable dtSpawnEntry = GameEntry.DataTable.GetDataTable(); + if (dtLevel == null || dtLevelPhase == null || dtSpawnEntry == null) + { + Log.Warning("CombatNodeComponent init failed. Missing data table(s)."); + return; + } + + DRLevel[] levels = dtLevel.GetAllDataRows(); + foreach (var level in levels) + { + if (level.LevelThemeType != themeType) + { + continue; + } + + _levelsById[level.Id] = level; + _phasesByLevelId[level.Id] = new List(); + _levelIdBuffer.Add(level.Id); + } + + DRLevelPhase[] levelPhases = dtLevelPhase.GetAllDataRows(); + foreach (var phase in levelPhases) + { + int levelId = phase.Id / 1000; + if (!_levelsById.ContainsKey(levelId)) + { + continue; + } + + if (!_phasesByLevelId.TryGetValue(levelId, out List phases)) + { + phases = new List(); + _phasesByLevelId[levelId] = phases; + } + + phases.Add(phase); + _spawnEntriesByPhaseId[phase.Id] = new List(); + } + + DRLevelSpawnEntry[] spawnEntries = dtSpawnEntry.GetAllDataRows(); + for (int i = 0; i < spawnEntries.Length; i++) + { + DRLevelSpawnEntry spawnEntry = spawnEntries[i]; + int phaseId = spawnEntry.Id / 1000; + int levelId = phaseId / 1000; + if (!_levelsById.ContainsKey(levelId)) + { + continue; + } + + if (!_spawnEntriesByPhaseId.TryGetValue(phaseId, out List entries)) + { + entries = new List(); + _spawnEntriesByPhaseId[phaseId] = entries; + } + + entries.Add(spawnEntry); + } + + Log.Info( + "CombatNodeComponent initialized. Theme={0}, Levels={1}, Phases={2}, Entries={3}", + themeType, + _levelsById.Count, + CountPhases(), + CountEntries()); + } + + public void StartCombat() + { + if (_levelIdBuffer.Count <= 0) + { + Log.Warning("CombatNodeComponent has no level cache. Call OnInit(levelThemeType) first."); + return; + } + + int randomIndex = Random.Range(0, _levelIdBuffer.Count); + int randomLevelId = _levelIdBuffer[randomIndex]; + CurrentLevel = _levelsById[randomLevelId]; + + // TODO: 在这里接入真实战斗节点玩法启动流程(场景进入、敌人生成、结算等)。 + Log.Info("StartCombat selected level '{0}' (Theme={1}).", CurrentLevel.Id, CurrentThemeType); + } + + private int CountPhases() + { + int count = 0; + foreach (List phases in _phasesByLevelId.Values) + { + count += phases.Count; + } + + return count; + } + + private int CountEntries() + { + int count = 0; + foreach (var list in _spawnEntriesByPhaseId.Values) + { + count += list.Count; + } + + return count; + } + } +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/CustomComponent/CombatNodeComponent.cs.meta b/Assets/GameMain/Scripts/CustomComponent/CombatNodeComponent.cs.meta new file mode 100644 index 0000000..445fa19 --- /dev/null +++ b/Assets/GameMain/Scripts/CustomComponent/CombatNodeComponent.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 5e646500b9304d438746f2351c71a0f4 +timeCreated: 1772103300 diff --git a/Assets/GameMain/Scripts/CustomComponent/EventNodeComponent.cs b/Assets/GameMain/Scripts/CustomComponent/EventNodeComponent.cs new file mode 100644 index 0000000..1d3786c --- /dev/null +++ b/Assets/GameMain/Scripts/CustomComponent/EventNodeComponent.cs @@ -0,0 +1,172 @@ +using System.Collections.Generic; +using GameFramework.DataTable; +using GeometryTD.DataTable; +using GeometryTD.Definition; +using Newtonsoft.Json.Linq; +using GeometryTD.UI; +using UnityEngine; +using UnityGameFramework.Runtime; + +namespace GeometryTD.CustomComponent +{ + public class EventNodeComponent : GameFrameworkComponent + { + private readonly List _eventItems = new List(); + + private EventFormUseCase _eventFormUseCase; + private EventFormController _eventFormController; + private bool _initialized; + + public void OnInit() + { + _eventItems.Clear(); + + IDataTable dtEvent = GameEntry.DataTable.GetDataTable(); + if (dtEvent == null) + { + Log.Warning("Event data table is not loaded."); + _initialized = true; + return; + } + + DREvent[] rows = dtEvent.GetAllDataRows(); + foreach (var drEvent in rows) + { + EventOption[] options = ParseOptions(drEvent.OptionsRaw); + _eventItems.Add(new EventItem(drEvent.Id, drEvent.Title, drEvent.Description, options)); + } + + if (_eventFormUseCase == null) + { + _eventFormUseCase = new EventFormUseCase(); + } + + if (_eventFormController == null) + { + _eventFormController = new EventFormController(); + _eventFormController.BindUseCase(_eventFormUseCase); + } + + _initialized = true; + Log.Info("EventNodeComponent initialized with {0} events.", _eventItems.Count); + } + + public void StartEvent() + { + if (!_initialized) + { + OnInit(); + } + + if (_eventItems.Count <= 0) + { + Log.Warning("EventNodeComponent has no event data."); + return; + } + + int index = Random.Range(0, _eventItems.Count); + EventItem randomEvent = _eventItems[index]; + + if (_eventFormUseCase == null || _eventFormController == null) + { + Log.Warning("EventNodeComponent StartEvent failed. Event form is not initialized."); + return; + } + + _eventFormUseCase.SetCurrentEvent(randomEvent); + _eventFormController.OpenUI(); + } + + private static EventOption[] ParseOptions(string optionsRaw) + { + if (string.IsNullOrWhiteSpace(optionsRaw)) + { + return System.Array.Empty(); + } + + try + { + JArray array = JArray.Parse(optionsRaw); + List options = new List(array.Count); + + for (int i = 0; i < array.Count; i++) + { + if (!(array[i] is JObject optionObj)) + { + continue; + } + + string optionText = optionObj.Value("optionText") ?? string.Empty; + float probability = optionObj.Value("probability") ?? 1f; + + EventRequirementBase[] requirements = ParseRequirements(optionObj["requirements"] as JArray); + EventEffectBase[] costEffects = ParseEffects(optionObj["costEffects"] as JArray, probability); + EventEffectBase[] rewardEffects = ParseEffects(optionObj["rewardEffects"] as JArray, probability); + + options.Add(new EventOption(optionText, requirements, costEffects, rewardEffects, probability)); + } + + return options.ToArray(); + } + catch (System.Exception e) + { + Log.Warning("Failed to parse event options json. {0}", e.Message); + return System.Array.Empty(); + } + } + + private static EventRequirementBase[] ParseRequirements(JArray requirementsArray) + { + if (requirementsArray == null || requirementsArray.Count == 0) + { + return System.Array.Empty(); + } + + List requirements = new List(requirementsArray.Count); + for (int i = 0; i < requirementsArray.Count; i++) + { + if (!(requirementsArray[i] is JObject reqObj)) + { + continue; + } + + string type = reqObj.Value("type"); + JObject param = reqObj["param"] as JObject; + EventRequirementBase requirement = EventRequirementFactory.Create(type, param); + if (requirement != null) + { + requirements.Add(requirement); + } + } + + return requirements.ToArray(); + } + + private static EventEffectBase[] ParseEffects(JArray effectsArray, float probability) + { + if (effectsArray == null || effectsArray.Count == 0) + { + return System.Array.Empty(); + } + + List effects = new List(effectsArray.Count); + for (int i = 0; i < effectsArray.Count; i++) + { + if (!(effectsArray[i] is JObject effectObj)) + { + continue; + } + + string type = effectObj.Value("type"); + JObject param = effectObj["param"] as JObject; + EventEffectBase effect = EventEffectFactory.Create(type, param, probability); + if (effect != null) + { + effects.Add(effect); + } + } + + return effects.ToArray(); + } + } +} diff --git a/Assets/GameMain/Scripts/CustomComponent/EventNodeComponent.cs.meta b/Assets/GameMain/Scripts/CustomComponent/EventNodeComponent.cs.meta new file mode 100644 index 0000000..80e3e23 --- /dev/null +++ b/Assets/GameMain/Scripts/CustomComponent/EventNodeComponent.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 0a0c1c547ca24c95819f5f62f0bd3ea3 +timeCreated: 1772102402 diff --git a/Assets/GameMain/Scripts/DataTable/DREnemy.cs b/Assets/GameMain/Scripts/DataTable/DREnemy.cs new file mode 100644 index 0000000..6082c4b --- /dev/null +++ b/Assets/GameMain/Scripts/DataTable/DREnemy.cs @@ -0,0 +1,63 @@ +using UnityGameFramework.Runtime; + +namespace GeometryTD.DataTable +{ + /// + /// 敌人配置表 + /// + public class DREnemy : DataRowBase + { + private int m_Id = 0; + + /// + /// 获取敌人编号 + /// + public override int Id => m_Id; + + /// + /// 获取敌人实体编号 + /// + public int EntityId { get; private set; } + + /// + /// 获取敌人基础血量 + /// + public int BaseHp { get; private set; } + + /// + /// 获取敌人基础基地伤害 + /// + public int BaseDamage { get; private set; } + + /// + /// 获取敌人移动速度 + /// + public float Speed { get; private set; } + + /// + /// 获取敌人掉落金币 + /// + public int DropCoin { get; private set; } + + public override bool ParseDataRow(string dataRowString, object userData) + { + string[] columnStrings = dataRowString.Split(DataTableExtension.DataSplitSeparators); + for (int i = 0; i < columnStrings.Length; i++) + { + columnStrings[i] = columnStrings[i].Trim(DataTableExtension.DataTrimSeparators); + } + + int index = 0; + index++; + m_Id = int.Parse(columnStrings[index++]); + index++; + EntityId = int.Parse(columnStrings[index++]); + BaseHp = int.Parse(columnStrings[index++]); + BaseDamage = int.Parse(columnStrings[index++]); + Speed = float.Parse(columnStrings[index++]); + DropCoin = int.Parse(columnStrings[index++]); + + return true; + } + } +} diff --git a/Assets/GameMain/Scripts/DataTable/DREnemy.cs.meta b/Assets/GameMain/Scripts/DataTable/DREnemy.cs.meta new file mode 100644 index 0000000..9403740 --- /dev/null +++ b/Assets/GameMain/Scripts/DataTable/DREnemy.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 0f9832b810954c4eb0f45ad735bb5a58 +timeCreated: 1772101800 diff --git a/Assets/GameMain/Scripts/DataTable/DREvent.cs b/Assets/GameMain/Scripts/DataTable/DREvent.cs new file mode 100644 index 0000000..fac79cd --- /dev/null +++ b/Assets/GameMain/Scripts/DataTable/DREvent.cs @@ -0,0 +1,52 @@ +using UnityGameFramework.Runtime; + +namespace GeometryTD.DataTable +{ + /// + /// 事件配置表 + /// + public class DREvent : DataRowBase + { + private int m_Id = 0; + + /// + /// 获取事件编号 + /// + public override int Id => m_Id; + + /// + /// 获取事件题目 + /// + public string Title { get; private set; } + + /// + /// 获取事件描述 + /// + public string Description { get; private set; } + + /// + /// 获取事件选项 + /// + /// 原始字符串(如 JSON 文本),不在此处做解析。 + public string OptionsRaw { get; private set; } + + public override bool ParseDataRow(string dataRowString, object userData) + { + string[] columnStrings = dataRowString.Split(DataTableExtension.DataSplitSeparators); + for (int i = 0; i < columnStrings.Length; i++) + { + columnStrings[i] = columnStrings[i].Trim(DataTableExtension.DataTrimSeparators); + } + + int index = 0; + index++; + m_Id = int.Parse(columnStrings[index++]); + index++; + Title = columnStrings[index++]; + Description = columnStrings[index++]; + OptionsRaw = columnStrings[index++]; + + return true; + } + } +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/DataTable/DREvent.cs.meta b/Assets/GameMain/Scripts/DataTable/DREvent.cs.meta new file mode 100644 index 0000000..75637bc --- /dev/null +++ b/Assets/GameMain/Scripts/DataTable/DREvent.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 57e29dfa7f1044a1acfbf3abde81859f +timeCreated: 1772097514 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/DataTable/DRLevel.cs b/Assets/GameMain/Scripts/DataTable/DRLevel.cs new file mode 100644 index 0000000..fecd64e --- /dev/null +++ b/Assets/GameMain/Scripts/DataTable/DRLevel.cs @@ -0,0 +1,72 @@ +using System; +using GeometryTD.Definition; +using GeometryTD.CustomUtility; +using UnityGameFramework.Runtime; + +namespace GeometryTD.DataTable +{ + /// + /// 关卡表 + /// + public class DRLevel : DataRowBase + { + private int m_Id = 0; + + /// + /// 获取关卡编号 + /// + public override int Id => m_Id; + + /// + /// 获取关卡所属主题类型 + /// + public LevelThemeType LevelThemeType { get; private set; } + + /// + /// 获取关卡初始基地生命 + /// + public int BaseHp { get; private set; } + + /// + /// 获取关卡初始硬币数量 + /// + public int StartCoin { get; private set; } + + /// + /// 获取关卡胜利条件 + /// + public LevelVictoryType LevelVictoryType { get; private set; } + + /// + /// 获取关卡胜利奖励金币 + /// + public int RewardGold { get; private set; } + + /// + /// 获取关卡胜利条件参数 + /// + public string VictoryParams { get; private set; } + + public override bool ParseDataRow(string dataRowString, object userData) + { + string[] columnStrings = dataRowString.Split(DataTableExtension.DataSplitSeparators); + for (int i = 0; i < columnStrings.Length; i++) + { + columnStrings[i] = columnStrings[i].Trim(DataTableExtension.DataTrimSeparators); + } + + int index = 0; + index++; + m_Id = int.Parse(columnStrings[index++]); + index++; + LevelThemeType = EnumUtility.Get(columnStrings[index++]); + BaseHp = int.Parse(columnStrings[index++]); + StartCoin = int.Parse(columnStrings[index++]); + LevelVictoryType = EnumUtility.Get(columnStrings[index++]); + VictoryParams = columnStrings[index++]; + RewardGold = int.Parse(columnStrings[index++]); + + return true; + } + } +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/DataTable/DRLevel.cs.meta b/Assets/GameMain/Scripts/DataTable/DRLevel.cs.meta new file mode 100644 index 0000000..6dcc879 --- /dev/null +++ b/Assets/GameMain/Scripts/DataTable/DRLevel.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e0eb47d184fe4204b38dc7c9e86da609 +timeCreated: 1772089145 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/DataTable/DRLevelPhase.cs b/Assets/GameMain/Scripts/DataTable/DRLevelPhase.cs new file mode 100644 index 0000000..c98fe1e --- /dev/null +++ b/Assets/GameMain/Scripts/DataTable/DRLevelPhase.cs @@ -0,0 +1,64 @@ +using System; +using GeometryTD.CustomUtility; +using GeometryTD.Definition; +using UnityGameFramework.Runtime; + +namespace GeometryTD.DataTable +{ + /// + /// 关卡阶段表 + /// + public class DRLevelPhase : DataRowBase + { + private int m_Id = 0; + + /// + /// 获取关卡阶段编号 + /// + public override int Id => m_Id; + + /// + /// 获取阶段持续时间(秒) + /// + public int DurationSeconds { get; private set; } + + /// + /// 获取阶段结束条件类型 + /// + public PhaseEndType EndType { get; private set; } + + /// + /// 获取阶段结束参数 + /// + public string EndParam { get; private set; } + + public override bool ParseDataRow(string dataRowString, object userData) + { + string[] columnStrings = dataRowString.Split(DataTableExtension.DataSplitSeparators); + for (int i = 0; i < columnStrings.Length; i++) + { + columnStrings[i] = columnStrings[i].Trim(DataTableExtension.DataTrimSeparators); + } + + int index = 0; + index++; + m_Id = int.Parse(columnStrings[index++]); + index++; + DurationSeconds = int.Parse(columnStrings[index++]); + EndType = ParsePhaseEndType(columnStrings[index++]); + EndParam = columnStrings[index++]; + + return true; + } + + private PhaseEndType ParsePhaseEndType(string raw) + { + if (string.IsNullOrWhiteSpace(raw)) + { + return PhaseEndType.None; + } + + return EnumUtility.Get(raw); + } + } +} diff --git a/Assets/GameMain/Scripts/DataTable/DRLevelPhase.cs.meta b/Assets/GameMain/Scripts/DataTable/DRLevelPhase.cs.meta new file mode 100644 index 0000000..84eec4b --- /dev/null +++ b/Assets/GameMain/Scripts/DataTable/DRLevelPhase.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f1fd79e88eca4bfbb38f5bcb8091e2dd +timeCreated: 1772090000 diff --git a/Assets/GameMain/Scripts/DataTable/DRLevelSpawnEntry.cs b/Assets/GameMain/Scripts/DataTable/DRLevelSpawnEntry.cs new file mode 100644 index 0000000..f8c41b3 --- /dev/null +++ b/Assets/GameMain/Scripts/DataTable/DRLevelSpawnEntry.cs @@ -0,0 +1,94 @@ +using System; +using GeometryTD.CustomUtility; +using GeometryTD.Definition; +using UnityGameFramework.Runtime; + +namespace GeometryTD.DataTable +{ + /// + /// 关卡阶段出怪条目表 + /// + public class DRLevelSpawnEntry : DataRowBase + { + private int m_Id = 0; + + /// + /// 获取阶段条目编号 + /// + public override int Id => m_Id; + + /// + /// 获取敌人出生口编号 + /// + public int SpawnPointId { get; private set; } + + /// + /// 获取相对开始时间(秒) + /// + public int StartTime { get; private set; } + + /// + /// 获取出怪条目类型 + /// + public EntryType EntryType { get; private set; } + + /// + /// 获取敌人编号 + /// + public int EnemyId { get; private set; } + + /// + /// 获取单次出怪数量 + /// + public int Count { get; private set; } + + /// + /// 获取出怪间隔(秒) + /// + public float Interval { get; private set; } + + /// + /// 获取持续时间(秒) + /// + public int Duration { get; private set; } + + /// + /// 获取单怪出生间隔(秒) + /// + public float Gap { get; private set; } + + public override bool ParseDataRow(string dataRowString, object userData) + { + string[] columnStrings = dataRowString.Split(DataTableExtension.DataSplitSeparators); + for (int i = 0; i < columnStrings.Length; i++) + { + columnStrings[i] = columnStrings[i].Trim(DataTableExtension.DataTrimSeparators); + } + + int index = 0; + index++; + m_Id = int.Parse(columnStrings[index++]); + index++; + SpawnPointId = int.Parse(columnStrings[index++]); + StartTime = int.Parse(columnStrings[index++]); + EntryType = ParseEntryType(columnStrings[index++]); + EnemyId = int.Parse(columnStrings[index++]); + Count = int.Parse(columnStrings[index++]); + Interval = float.Parse(columnStrings[index++]); + Duration = int.Parse(columnStrings[index++]); + Gap = float.Parse(columnStrings[index++]); + + return true; + } + + private EntryType ParseEntryType(string raw) + { + if (string.IsNullOrWhiteSpace(raw)) + { + return EntryType.None; + } + + return EnumUtility.Get(raw); + } + } +} diff --git a/Assets/GameMain/Scripts/DataTable/DRLevelSpawnEntry.cs.meta b/Assets/GameMain/Scripts/DataTable/DRLevelSpawnEntry.cs.meta new file mode 100644 index 0000000..cebe8fb --- /dev/null +++ b/Assets/GameMain/Scripts/DataTable/DRLevelSpawnEntry.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b06804b242d247bd8a937cdce930cee1 +timeCreated: 1772090001 diff --git a/Assets/GameMain/Scripts/DataTable/DRShopPrice.cs b/Assets/GameMain/Scripts/DataTable/DRShopPrice.cs new file mode 100644 index 0000000..14d2bdb --- /dev/null +++ b/Assets/GameMain/Scripts/DataTable/DRShopPrice.cs @@ -0,0 +1,38 @@ +using GeometryTD.CustomUtility; +using GeometryTD.Definition; +using UnityGameFramework.Runtime; + +namespace GeometryTD.DataTable +{ + public class DRShopPrice : DataRowBase + { + private int m_Id = 0; + + public override int Id => m_Id; + + public RarityType Rarity { get; set; } + + public int MinPrice { get; set; } + + public int MaxPrice { get; set; } + + public override bool ParseDataRow(string dataRowString, object userData) + { + string[] columnStrings = dataRowString.Split(DataTableExtension.DataSplitSeparators); + for (int i = 0; i < columnStrings.Length; i++) + { + columnStrings[i] = columnStrings[i].Trim(DataTableExtension.DataTrimSeparators); + } + + int index = 0; + index++; + m_Id = int.Parse(columnStrings[index++]); + index++; + Rarity = EnumUtility.Get(columnStrings[index++]); + MinPrice = int.Parse(columnStrings[index++]); + MaxPrice = int.Parse(columnStrings[index++]); + + return true; + } + } +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/DataTable/DRShopPrice.cs.meta b/Assets/GameMain/Scripts/DataTable/DRShopPrice.cs.meta new file mode 100644 index 0000000..f8d7919 --- /dev/null +++ b/Assets/GameMain/Scripts/DataTable/DRShopPrice.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7c47aaecd99446f2b8c9ec84c797005b +timeCreated: 1772105886 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/DataStruct/EventItem.cs b/Assets/GameMain/Scripts/Definition/DataStruct/EventItem.cs new file mode 100644 index 0000000..62883e6 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/DataStruct/EventItem.cs @@ -0,0 +1,18 @@ +namespace GeometryTD.Definition +{ + public class EventItem + { + public EventItem(int id, string title, string description, EventOption[] options) + { + Id = id; + Title = title; + Description = description; + Options = options ?? System.Array.Empty(); + } + + public int Id { get; private set; } + public string Title { get; private set; } + public string Description { get; private set; } + public EventOption[] Options { get; private set; } + } +} diff --git a/Assets/GameMain/Scripts/Definition/DataStruct/EventItem.cs.meta b/Assets/GameMain/Scripts/Definition/DataStruct/EventItem.cs.meta new file mode 100644 index 0000000..55b73a4 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/DataStruct/EventItem.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c2a6dce0183e4efdbada20c25be949c0 +timeCreated: 1772097196 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/DataStruct/EventOption.cs b/Assets/GameMain/Scripts/Definition/DataStruct/EventOption.cs new file mode 100644 index 0000000..3afb457 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/DataStruct/EventOption.cs @@ -0,0 +1,25 @@ +namespace GeometryTD.Definition +{ + public class EventOption + { + public string OptionText { get; private set; } + public EventRequirementBase[] Requirements { get; private set; } + public EventEffectBase[] CostEffects { get; private set; } + public EventEffectBase[] RewardEffects { get; private set; } + public float Probability { get; private set; } + + public EventOption( + string optionText, + EventRequirementBase[] requirements, + EventEffectBase[] costEffects, + EventEffectBase[] rewardEffects, + float probability = 1f) + { + OptionText = optionText; + Requirements = requirements ?? System.Array.Empty(); + CostEffects = costEffects ?? System.Array.Empty(); + RewardEffects = rewardEffects ?? System.Array.Empty(); + Probability = probability; + } + } +} diff --git a/Assets/GameMain/Scripts/Definition/DataStruct/EventOption.cs.meta b/Assets/GameMain/Scripts/Definition/DataStruct/EventOption.cs.meta new file mode 100644 index 0000000..b8f7674 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/DataStruct/EventOption.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: bcb612057a454fcf97f41fdf5c6d9b22 +timeCreated: 1772097742 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/Enum/AttackPropertyType.cs b/Assets/GameMain/Scripts/Definition/Enum/AttackPropertyType.cs index 04fd7ec..5a0f3d9 100644 --- a/Assets/GameMain/Scripts/Definition/Enum/AttackPropertyType.cs +++ b/Assets/GameMain/Scripts/Definition/Enum/AttackPropertyType.cs @@ -3,7 +3,7 @@ namespace GeometryTD.Definition public enum AttackPropertyType : byte { None = 0, - Physical = 1, + Physics = 1, Fire = 2, Water = 3, Earth = 4, diff --git a/Assets/GameMain/Scripts/Definition/Enum/EntryType.cs b/Assets/GameMain/Scripts/Definition/Enum/EntryType.cs new file mode 100644 index 0000000..e29a644 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/Enum/EntryType.cs @@ -0,0 +1,13 @@ +namespace GeometryTD.Definition +{ + /// + /// 出怪条目类型 + /// + public enum EntryType : byte + { + None = 0, + Stream = 1, + Burst = 2, + Boss = 3 + } +} diff --git a/Assets/GameMain/Scripts/Definition/Enum/EntryType.cs.meta b/Assets/GameMain/Scripts/Definition/Enum/EntryType.cs.meta new file mode 100644 index 0000000..ff6783b --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/Enum/EntryType.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 14433e1048844c5d942c885c2f50ffe0 +timeCreated: 1772090003 diff --git a/Assets/GameMain/Scripts/Definition/Enum/EventEffectType.cs b/Assets/GameMain/Scripts/Definition/Enum/EventEffectType.cs new file mode 100644 index 0000000..0231272 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/Enum/EventEffectType.cs @@ -0,0 +1,21 @@ +namespace GeometryTD.Definition +{ + public enum EventEffectType + { + None, + + AddGold, + RemoveGold, + + AddRandomComps, + RemoveRandomComps, + + AddRandomCompsEndurance, + RemoveRandomCompsEndurance, + + AddRandomTowersEndurance, + DamageRandomTowersEndurance, + + TransformComponents, + } +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/Enum/EventEffectType.cs.meta b/Assets/GameMain/Scripts/Definition/Enum/EventEffectType.cs.meta new file mode 100644 index 0000000..9f5851a --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/Enum/EventEffectType.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6f11ba35aa8f491f942964435b32cba6 +timeCreated: 1772095333 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/Enum/EventRequirementType.cs b/Assets/GameMain/Scripts/Definition/Enum/EventRequirementType.cs new file mode 100644 index 0000000..eb02abd --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/Enum/EventRequirementType.cs @@ -0,0 +1,11 @@ +namespace GeometryTD.Definition +{ + public enum EventRequirementType + { + None, + GoldAtLeast, + CompCountAtLeast, + TowerCountAtLeast, + HasRelic, + } +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/Enum/EventRequirementType.cs.meta b/Assets/GameMain/Scripts/Definition/Enum/EventRequirementType.cs.meta new file mode 100644 index 0000000..f4fd47e --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/Enum/EventRequirementType.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f9da1af87a4f4115b9a5da706b4e1092 +timeCreated: 1772095290 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/Enum/LevelThemeType.cs b/Assets/GameMain/Scripts/Definition/Enum/LevelThemeType.cs new file mode 100644 index 0000000..8efa818 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/Enum/LevelThemeType.cs @@ -0,0 +1,10 @@ +namespace GeometryTD.Definition +{ + public enum LevelThemeType + { + None, + Plain, + Volcano, + Mountain + } +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/Enum/LevelThemeType.cs.meta b/Assets/GameMain/Scripts/Definition/Enum/LevelThemeType.cs.meta new file mode 100644 index 0000000..a7fa133 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/Enum/LevelThemeType.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 06ec7c0ec8924c7988e521abdd97bffe +timeCreated: 1772089321 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/Enum/LevelVictoryType.cs b/Assets/GameMain/Scripts/Definition/Enum/LevelVictoryType.cs new file mode 100644 index 0000000..b58db43 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/Enum/LevelVictoryType.cs @@ -0,0 +1,10 @@ +namespace GeometryTD.Definition +{ + public enum LevelVictoryType + { + None, + PhasesCleared, + BossDead, + TimeElapsed + } +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/Enum/LevelVictoryType.cs.meta b/Assets/GameMain/Scripts/Definition/Enum/LevelVictoryType.cs.meta new file mode 100644 index 0000000..826abdb --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/Enum/LevelVictoryType.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ea9b7c078511464fa572923f66cc200e +timeCreated: 1772089447 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/Enum/PhaseEndType.cs b/Assets/GameMain/Scripts/Definition/Enum/PhaseEndType.cs new file mode 100644 index 0000000..a8b1e2e --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/Enum/PhaseEndType.cs @@ -0,0 +1,13 @@ +namespace GeometryTD.Definition +{ + /// + /// 关卡阶段结束类型 + /// + public enum PhaseEndType : byte + { + None = 0, + TimeElapsed = 1, + EnemiesCleared = 2, + BossDead = 3 + } +} diff --git a/Assets/GameMain/Scripts/Definition/Enum/PhaseEndType.cs.meta b/Assets/GameMain/Scripts/Definition/Enum/PhaseEndType.cs.meta new file mode 100644 index 0000000..1f9e21c --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/Enum/PhaseEndType.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: eed7685430c24cdaac639581331393f3 +timeCreated: 1772090002 diff --git a/Assets/GameMain/Scripts/Definition/Enum/UIFormType.cs b/Assets/GameMain/Scripts/Definition/Enum/UIFormType.cs index 85c19ef..aae9d9a 100644 --- a/Assets/GameMain/Scripts/Definition/Enum/UIFormType.cs +++ b/Assets/GameMain/Scripts/Definition/Enum/UIFormType.cs @@ -26,5 +26,10 @@ /// 关于。 /// AboutForm = 102, + + /// + /// 事件节点界面。 + /// + EventForm = 200, } } diff --git a/Assets/GameMain/Scripts/Definition/EventEffect.meta b/Assets/GameMain/Scripts/Definition/EventEffect.meta new file mode 100644 index 0000000..255fe15 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventEffect.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 8a291a17879242cc8c7cec678aa5aaf1 +timeCreated: 1772101365 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/EventEffect/AddGoldEffect.cs b/Assets/GameMain/Scripts/Definition/EventEffect/AddGoldEffect.cs new file mode 100644 index 0000000..a3ed1f7 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventEffect/AddGoldEffect.cs @@ -0,0 +1,25 @@ +namespace GeometryTD.Definition +{ + public class AddGoldEffect : EventEffectBase + { + public override EventEffectType EffectType => EventEffectType.AddGold; + public override EventEffectParam Param => _param; + private AddGoldParam _param; + + public AddGoldEffect(AddGoldParam param, float? probability = null) + { + _param = param; + Probability = probability; + } + } + + public class AddGoldParam : EventEffectParam + { + public int Count; + + public AddGoldParam(int count) + { + Count = count; + } + } +} diff --git a/Assets/GameMain/Scripts/Definition/EventEffect/AddGoldEffect.cs.meta b/Assets/GameMain/Scripts/Definition/EventEffect/AddGoldEffect.cs.meta new file mode 100644 index 0000000..5f4a58d --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventEffect/AddGoldEffect.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 75cacc997d8f414ca73f381cad303b5b +timeCreated: 1772101474 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/EventEffect/AddRandomCompsEffect.cs b/Assets/GameMain/Scripts/Definition/EventEffect/AddRandomCompsEffect.cs new file mode 100644 index 0000000..3760cdb --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventEffect/AddRandomCompsEffect.cs @@ -0,0 +1,28 @@ +namespace GeometryTD.Definition +{ + public class AddRandomCompsEffect : EventEffectBase + { + public override EventEffectType EffectType => EventEffectType.AddRandomComps; + public override EventEffectParam Param => _param; + private AddRandomCompsParam _param; + + public AddRandomCompsEffect(AddRandomCompsParam param, float? probability = null) + { + _param = param; + Probability = probability; + } + } + + + public class AddRandomCompsParam : EventEffectParam + { + public int Count; + public RarityType Rarity; + + public AddRandomCompsParam(int count, RarityType rarity) + { + Count = count; + Rarity = rarity; + } + } +} diff --git a/Assets/GameMain/Scripts/Definition/EventEffect/AddRandomCompsEffect.cs.meta b/Assets/GameMain/Scripts/Definition/EventEffect/AddRandomCompsEffect.cs.meta new file mode 100644 index 0000000..93cdd67 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventEffect/AddRandomCompsEffect.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 35656d42c28448268d0547c19938b2d8 +timeCreated: 1772101530 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/EventEffect/DamageRandomTowerEnduranceEffect.cs b/Assets/GameMain/Scripts/Definition/EventEffect/DamageRandomTowerEnduranceEffect.cs new file mode 100644 index 0000000..6dcddfa --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventEffect/DamageRandomTowerEnduranceEffect.cs @@ -0,0 +1,34 @@ +namespace GeometryTD.Definition +{ + public class DamageRandomTowerEnduranceEffect : EventEffectBase + { + public override EventEffectType EffectType => EventEffectType.DamageRandomTowersEndurance; + public override EventEffectParam Param => _param; + private DamageRandomTowerEnduranceParam _param; + + public DamageRandomTowerEnduranceEffect(DamageRandomTowerEnduranceParam param, float? probability = null) + { + _param = param; + Probability = probability; + } + } + + public class DamageRandomTowerEnduranceParam : EventEffectParam + { + /// + /// 减少耐久的防御塔数量 + /// + public int Count; + + /// + /// 防御塔耐久减少的量 + /// + public int Amount; + + public DamageRandomTowerEnduranceParam(int count, int amount) + { + Count = count; + Amount = amount; + } + } +} diff --git a/Assets/GameMain/Scripts/Definition/EventEffect/DamageRandomTowerEnduranceEffect.cs.meta b/Assets/GameMain/Scripts/Definition/EventEffect/DamageRandomTowerEnduranceEffect.cs.meta new file mode 100644 index 0000000..b8bbe7e --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventEffect/DamageRandomTowerEnduranceEffect.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a1b06f274c054844ad68b1db02d3737a +timeCreated: 1772101563 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/EventEffect/EventEffectBase.cs b/Assets/GameMain/Scripts/Definition/EventEffect/EventEffectBase.cs new file mode 100644 index 0000000..e80516a --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventEffect/EventEffectBase.cs @@ -0,0 +1,14 @@ +namespace GeometryTD.Definition +{ + public abstract class EventEffectBase + { + public abstract EventEffectType EffectType { get; } + public abstract EventEffectParam Param { get; } + public float? Probability; + } + + public class EventEffectParam + { + + } +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/EventEffect/EventEffectBase.cs.meta b/Assets/GameMain/Scripts/Definition/EventEffect/EventEffectBase.cs.meta new file mode 100644 index 0000000..1c3331b --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventEffect/EventEffectBase.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2be5a7ff782240f79bde2dd0310d11ea +timeCreated: 1772101392 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/EventEffect/RemoveRandomCompEffect.cs b/Assets/GameMain/Scripts/Definition/EventEffect/RemoveRandomCompEffect.cs new file mode 100644 index 0000000..7ac22d5 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventEffect/RemoveRandomCompEffect.cs @@ -0,0 +1,27 @@ +namespace GeometryTD.Definition +{ + public class RemoveRandomCompsEffect : EventEffectBase + { + public override EventEffectType EffectType => EventEffectType.RemoveRandomComps; + public override EventEffectParam Param => _param; + private RemoveRandomCompsParam _param; + + public RemoveRandomCompsEffect(RemoveRandomCompsParam param, float? probability = null) + { + _param = param; + Probability = probability; + } + } + + public class RemoveRandomCompsParam : EventEffectParam + { + public int Count; + public RarityType Rarity; + + public RemoveRandomCompsParam(int Count, RarityType Rarity) + { + this.Count = Count; + this.Rarity = Rarity; + } + } +} diff --git a/Assets/GameMain/Scripts/Definition/EventEffect/RemoveRandomCompEffect.cs.meta b/Assets/GameMain/Scripts/Definition/EventEffect/RemoveRandomCompEffect.cs.meta new file mode 100644 index 0000000..4c736eb --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventEffect/RemoveRandomCompEffect.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 77f8e0d1879b48108e6ad5faca07d7f7 +timeCreated: 1772101548 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/EventEffectFactory.cs b/Assets/GameMain/Scripts/Definition/EventEffectFactory.cs new file mode 100644 index 0000000..5f116c3 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventEffectFactory.cs @@ -0,0 +1,76 @@ +using GeometryTD.CustomUtility; +using Newtonsoft.Json.Linq; +using UnityGameFramework.Runtime; + +namespace GeometryTD.Definition +{ + public static class EventEffectFactory + { + public static EventEffectBase Create(string rawType, JObject param, float? probability = null) + { + if (string.IsNullOrWhiteSpace(rawType)) + { + return null; + } + + EventEffectType type = EnumUtility.Get(rawType); + switch (type) + { + case EventEffectType.AddGold: + { + int count = GetInt(param, "Count"); + return new AddGoldEffect(new AddGoldParam(count), probability); + } + case EventEffectType.RemoveRandomComps: + { + int count = GetInt(param, "Count"); + RarityType rarity = EnumUtility.Get(GetString(param, "Rarity")); + return new RemoveRandomCompsEffect(new RemoveRandomCompsParam(count, rarity), probability); + } + case EventEffectType.AddRandomComps: + { + int count = GetInt(param, "Count"); + RarityType rarity = EnumUtility.Get(GetString(param, "Rarity")); + return new AddRandomCompsEffect(new AddRandomCompsParam(count, rarity), probability); + } + case EventEffectType.DamageRandomTowersEndurance: + { + int count = GetInt(param, "Count"); + int amount = GetInt(param, "Amount"); + return new DamageRandomTowerEnduranceEffect(new DamageRandomTowerEnduranceParam(count, amount), probability); + } + default: + Log.Warning("Unsupported EventEffectType '{0}'.", rawType); + return null; + } + } + + private static int GetInt(JObject param, params string[] keys) + { + if (param == null) + { + return 0; + } + + foreach (string key in keys) + { + if (param.TryGetValue(key, out JToken token) && token.Type != JTokenType.Null) + { + return token.Value(); + } + } + + return 0; + } + + private static string GetString(JObject param, string key) + { + if (param == null || !param.TryGetValue(key, out JToken token) || token.Type == JTokenType.Null) + { + return string.Empty; + } + + return token.Value(); + } + } +} diff --git a/Assets/GameMain/Scripts/Definition/EventEffectFactory.cs.meta b/Assets/GameMain/Scripts/Definition/EventEffectFactory.cs.meta new file mode 100644 index 0000000..1f0012a --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventEffectFactory.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: fae04d7a401d4c7fbe2de385c3f23580 +timeCreated: 1772102401 diff --git a/Assets/GameMain/Scripts/Definition/EventRequirement.meta b/Assets/GameMain/Scripts/Definition/EventRequirement.meta new file mode 100644 index 0000000..d9cbfa0 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventRequirement.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: cee1f415e08743a9914efd2ecbc6273e +timeCreated: 1772100925 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/EventRequirement/CompCountAtLeastRequirement.cs b/Assets/GameMain/Scripts/Definition/EventRequirement/CompCountAtLeastRequirement.cs new file mode 100644 index 0000000..d54a09b --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventRequirement/CompCountAtLeastRequirement.cs @@ -0,0 +1,26 @@ +namespace GeometryTD.Definition +{ + public class CompCountAtLeastRequirement : EventRequirementBase + { + public override EventRequirementType RequirementType => EventRequirementType.CompCountAtLeast; + public override EventRequirementParam Param => _param; + private CompCountAtLeastParam _param; + + public CompCountAtLeastRequirement(CompCountAtLeastParam param) + { + _param = param; + } + } + + public class CompCountAtLeastParam : EventRequirementParam + { + public int Count; + public RarityType Rarity; + + public CompCountAtLeastParam(int count, RarityType rarity) + { + Count = count; + Rarity = rarity; + } + } +} diff --git a/Assets/GameMain/Scripts/Definition/EventRequirement/CompCountAtLeastRequirement.cs.meta b/Assets/GameMain/Scripts/Definition/EventRequirement/CompCountAtLeastRequirement.cs.meta new file mode 100644 index 0000000..b71b679 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventRequirement/CompCountAtLeastRequirement.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b845abef81934b75b266a738597bb890 +timeCreated: 1772101103 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/EventRequirement/EventRequirementBase.cs b/Assets/GameMain/Scripts/Definition/EventRequirement/EventRequirementBase.cs new file mode 100644 index 0000000..179e497 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventRequirement/EventRequirementBase.cs @@ -0,0 +1,12 @@ +namespace GeometryTD.Definition +{ + public abstract class EventRequirementBase + { + public abstract EventRequirementType RequirementType { get; } + public abstract EventRequirementParam Param { get; } + } + + public class EventRequirementParam + { + } +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/EventRequirement/EventRequirementBase.cs.meta b/Assets/GameMain/Scripts/Definition/EventRequirement/EventRequirementBase.cs.meta new file mode 100644 index 0000000..510f7f3 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventRequirement/EventRequirementBase.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: eaa757b9c4cd4bcca38d73a30ab06285 +timeCreated: 1772100961 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/EventRequirement/GoldAtLeastRequirement.cs b/Assets/GameMain/Scripts/Definition/EventRequirement/GoldAtLeastRequirement.cs new file mode 100644 index 0000000..13325c8 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventRequirement/GoldAtLeastRequirement.cs @@ -0,0 +1,24 @@ +namespace GeometryTD.Definition +{ + public class GoldAtLeastRequirement : EventRequirementBase + { + public override EventRequirementType RequirementType => EventRequirementType.GoldAtLeast; + public override EventRequirementParam Param => _param; + private GoldAtLeastParam _param; + + public GoldAtLeastRequirement(GoldAtLeastParam param) + { + _param = param; + } + } + + public class GoldAtLeastParam : EventRequirementParam + { + public int Gold; + + public GoldAtLeastParam(int gold) + { + Gold = gold; + } + } +} diff --git a/Assets/GameMain/Scripts/Definition/EventRequirement/GoldAtLeastRequirement.cs.meta b/Assets/GameMain/Scripts/Definition/EventRequirement/GoldAtLeastRequirement.cs.meta new file mode 100644 index 0000000..9063673 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventRequirement/GoldAtLeastRequirement.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 5a2de86ff2b442dd9f7d6af64f518bb8 +timeCreated: 1772101058 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/EventRequirement/HasRelicRequirement.cs b/Assets/GameMain/Scripts/Definition/EventRequirement/HasRelicRequirement.cs new file mode 100644 index 0000000..7aff552 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventRequirement/HasRelicRequirement.cs @@ -0,0 +1,24 @@ +namespace GeometryTD.Definition +{ + public class HasRelicRequirement : EventRequirementBase + { + public override EventRequirementType RequirementType => EventRequirementType.HasRelic; + public override EventRequirementParam Param => _param; + private HasRelicParam _param; + + public HasRelicRequirement(HasRelicParam param) + { + _param = param; + } + } + + public class HasRelicParam : EventRequirementParam + { + public int RelicId; + + public HasRelicParam(int relicId) + { + RelicId = relicId; + } + } +} diff --git a/Assets/GameMain/Scripts/Definition/EventRequirement/HasRelicRequirement.cs.meta b/Assets/GameMain/Scripts/Definition/EventRequirement/HasRelicRequirement.cs.meta new file mode 100644 index 0000000..b2112e6 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventRequirement/HasRelicRequirement.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b06e03ee597d4345b95c524c7a6a27d4 +timeCreated: 1772101234 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/EventRequirement/TowerCountAtLeastRequirement.cs b/Assets/GameMain/Scripts/Definition/EventRequirement/TowerCountAtLeastRequirement.cs new file mode 100644 index 0000000..d0d3723 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventRequirement/TowerCountAtLeastRequirement.cs @@ -0,0 +1,24 @@ +namespace GeometryTD.Definition +{ + public class TowerCountAtLeastRequirement : EventRequirementBase + { + public override EventRequirementType RequirementType => EventRequirementType.TowerCountAtLeast; + public override EventRequirementParam Param => _param; + private TowerCountAtLeastParam _param; + + public TowerCountAtLeastRequirement(TowerCountAtLeastParam param) + { + _param = param; + } + } + + public class TowerCountAtLeastParam : EventRequirementParam + { + public int Count; + + public TowerCountAtLeastParam(int count) + { + Count = count; + } + } +} diff --git a/Assets/GameMain/Scripts/Definition/EventRequirement/TowerCountAtLeastRequirement.cs.meta b/Assets/GameMain/Scripts/Definition/EventRequirement/TowerCountAtLeastRequirement.cs.meta new file mode 100644 index 0000000..f572665 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventRequirement/TowerCountAtLeastRequirement.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 81a1102b3c0e4a53ae74ebb779ea7c19 +timeCreated: 1772101156 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/EventRequirementFactory.cs b/Assets/GameMain/Scripts/Definition/EventRequirementFactory.cs new file mode 100644 index 0000000..cbfdb01 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventRequirementFactory.cs @@ -0,0 +1,74 @@ +using GeometryTD.CustomUtility; +using Newtonsoft.Json.Linq; +using UnityGameFramework.Runtime; + +namespace GeometryTD.Definition +{ + public static class EventRequirementFactory + { + public static EventRequirementBase Create(string rawType, JObject param) + { + if (string.IsNullOrWhiteSpace(rawType)) + { + return null; + } + + EventRequirementType type = EnumUtility.Get(rawType); + switch (type) + { + case EventRequirementType.GoldAtLeast: + { + int count = GetInt(param, "Count", "Gold"); + return new GoldAtLeastRequirement(new GoldAtLeastParam(count)); + } + case EventRequirementType.CompCountAtLeast: + { + int count = GetInt(param, "Count"); + RarityType rarity = EnumUtility.Get(GetString(param, "Rarity")); + return new CompCountAtLeastRequirement(new CompCountAtLeastParam(count, rarity)); + } + case EventRequirementType.TowerCountAtLeast: + { + int count = GetInt(param, "Count"); + return new TowerCountAtLeastRequirement(new TowerCountAtLeastParam(count)); + } + case EventRequirementType.HasRelic: + { + int relicId = GetInt(param, "RelicId", "Id"); + return new HasRelicRequirement(new HasRelicParam(relicId)); + } + default: + Log.Warning("Unsupported EventRequirementType '{0}'.", rawType); + return null; + } + } + + private static int GetInt(JObject param, params string[] keys) + { + if (param == null) + { + return 0; + } + + foreach (string key in keys) + { + if (param.TryGetValue(key, out JToken token) && token.Type != JTokenType.Null) + { + return token.Value(); + } + } + + return 0; + } + + private static string GetString(JObject param, string key) + { + if (param == null || !param.TryGetValue(key, out JToken token) || token.Type == JTokenType.Null) + { + return string.Empty; + } + + return token.Value(); + } + } +} diff --git a/Assets/GameMain/Scripts/Definition/EventRequirementFactory.cs.meta b/Assets/GameMain/Scripts/Definition/EventRequirementFactory.cs.meta new file mode 100644 index 0000000..21f215d --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/EventRequirementFactory.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e3b92d366cac404394c9e6aa1aa4062b +timeCreated: 1772102400 diff --git a/Assets/GameMain/Scripts/Event.meta b/Assets/GameMain/Scripts/Event.meta new file mode 100644 index 0000000..50f2901 --- /dev/null +++ b/Assets/GameMain/Scripts/Event.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7e5a261a50044ebe841fc7ae36c96f16 +timeCreated: 1772112201 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Event/EventOptionItemSelectedEventArgs.cs b/Assets/GameMain/Scripts/Event/EventOptionItemSelectedEventArgs.cs new file mode 100644 index 0000000..d7b10d8 --- /dev/null +++ b/Assets/GameMain/Scripts/Event/EventOptionItemSelectedEventArgs.cs @@ -0,0 +1,27 @@ +using GameFramework; +using GameFramework.Event; + +namespace GeometryTD.CustomEvent +{ + public class EventOptionItemSelectedEventArgs : GameEventArgs + { + public static int EventId => typeof(EventOptionItemSelectedEventArgs).GetHashCode(); + + public override int Id => EventId; + + public int SelectedItemId { get; private set; } = -1; + + public static EventOptionItemSelectedEventArgs Create(int selectedItemId) + { + var args = ReferencePool.Acquire(); + args.SelectedItemId = selectedItemId; + + return args; + } + + public override void Clear() + { + SelectedItemId = -1; + } + } +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Event/EventOptionItemSelectedEventArgs.cs.meta b/Assets/GameMain/Scripts/Event/EventOptionItemSelectedEventArgs.cs.meta new file mode 100644 index 0000000..f56a8c0 --- /dev/null +++ b/Assets/GameMain/Scripts/Event/EventOptionItemSelectedEventArgs.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e6152ef428a64a08a9dd279b73f45520 +timeCreated: 1772112224 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Procedure/ProcedureChangeScene.cs b/Assets/GameMain/Scripts/Procedure/ProcedureChangeScene.cs index 54b3f3f..9326daa 100644 --- a/Assets/GameMain/Scripts/Procedure/ProcedureChangeScene.cs +++ b/Assets/GameMain/Scripts/Procedure/ProcedureChangeScene.cs @@ -46,7 +46,7 @@ namespace GeometryTD.Procedure GameEntry.Base.ResetNormalGameSpeed(); _nextSceneId = procedureOwner.GetData("NextSceneId"); - + IDataTable dtScene = GameEntry.DataTable.GetDataTable(); DRScene drScene = dtScene.GetDataRow(_nextSceneId); if (drScene == null) @@ -55,7 +55,8 @@ namespace GeometryTD.Procedure return; } - GameEntry.Scene.LoadScene(AssetUtility.GetSceneAsset(drScene.AssetName), Constant.AssetPriority.SceneAsset, this); + GameEntry.Scene.LoadScene(AssetUtility.GetSceneAsset(drScene.AssetName), Constant.AssetPriority.SceneAsset, + this); _backgroundMusicId = drScene.BackgroundMusicId; } @@ -81,13 +82,15 @@ namespace GeometryTD.Procedure SceneType sceneType = (SceneType)_nextSceneId; switch (sceneType) { - //TODO:场景切换 - // case SceneId.StressTest: - // ChangeState(procedureOwner); - // break; - // default: - // Log.Debug($"Scene {sceneId.ToString()} don't configure a procedure"); - // break; + case SceneType.Menu: + ChangeState(procedureOwner); + break; + case SceneType.Main: + ChangeState(procedureOwner); + break; + default: + Log.Debug($"Scene {sceneType.ToString()} don't configure a procedure"); + break; } } @@ -139,7 +142,8 @@ namespace GeometryTD.Procedure return; } - Log.Info("Load scene '{0}' dependency asset '{1}', count '{2}/{3}'.", ne.SceneAssetName, ne.DependencyAssetName, ne.LoadedCount.ToString(), ne.TotalCount.ToString()); + Log.Info("Load scene '{0}' dependency asset '{1}', count '{2}/{3}'.", ne.SceneAssetName, + ne.DependencyAssetName, ne.LoadedCount.ToString(), ne.TotalCount.ToString()); } } -} +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Procedure/ProcedureMenu.cs b/Assets/GameMain/Scripts/Procedure/ProcedureMenu.cs new file mode 100644 index 0000000..de85f21 --- /dev/null +++ b/Assets/GameMain/Scripts/Procedure/ProcedureMenu.cs @@ -0,0 +1,49 @@ +using GameFramework.Fsm; +using GameFramework.Procedure; +using GeometryTD.Definition; +using UnityGameFramework.Runtime; + +namespace GeometryTD.Procedure +{ + public class ProcedureMenu : ProcedureBase + { + public override bool UseNativeDialog => false; + + public bool GameStart { get; set; } + + #region FSM + + protected override void OnInit(IFsm procedureOwner) + { + base.OnInit(procedureOwner); + } + + protected override void OnEnter(IFsm procedureOwner) + { + base.OnEnter(procedureOwner); + + GameStart = false; + GameEntry.EventNode.OnInit(); + GameEntry.CombatNode.OnInit(LevelThemeType.Plain); + } + + protected override void OnUpdate(IFsm procedureOwner, float elapseSeconds, + float realElapseSeconds) + { + base.OnUpdate(procedureOwner, elapseSeconds, realElapseSeconds); + + if (GameStart) + { + procedureOwner.SetData("NextSceneId", (int)SceneType.Main); + ChangeState(procedureOwner); + } + } + + protected override void OnLeave(IFsm procedureOwner, bool isShutdown) + { + base.OnLeave(procedureOwner, isShutdown); + } + + #endregion + } +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Procedure/ProcedureMenu.cs.meta b/Assets/GameMain/Scripts/Procedure/ProcedureMenu.cs.meta new file mode 100644 index 0000000..51b4ffa --- /dev/null +++ b/Assets/GameMain/Scripts/Procedure/ProcedureMenu.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ac91f61cef224d7ab324491156d904bb +timeCreated: 1772105440 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Procedure/ProcedurePreload.cs b/Assets/GameMain/Scripts/Procedure/ProcedurePreload.cs index 1800adc..beb6b9e 100644 --- a/Assets/GameMain/Scripts/Procedure/ProcedurePreload.cs +++ b/Assets/GameMain/Scripts/Procedure/ProcedurePreload.cs @@ -25,16 +25,22 @@ namespace GeometryTD.Procedure { public static readonly string[] DataTableNames = new string[] { + "BaseComp", + "BearingComp", + "Enemy", "Entity", + "Event", + "Level", + "LevelPhase", + "LevelSpawnEntry", "Music", + "MuzzleComp", "Scene", + "ShopPrice", "Sound", + "Tag", "UIForm", "UISound", - "MuzzleComp", - "BearingComp", - "BaseComp", - "Tag", }; private Dictionary _loadedFlag = new Dictionary(); @@ -128,37 +134,39 @@ namespace GeometryTD.Procedure private void LoadFont(string fontName) { _loadedFlag.Add(Utility.Text.Format("Font.{0}", fontName), false); - GameEntry.Resource.LoadAsset(AssetUtility.GetFontAsset(fontName), Constant.AssetPriority.FontAsset, new LoadAssetCallbacks( - (assetName, asset, duration, userData) => - { - _loadedFlag[Utility.Text.Format("Font.{0}", fontName)] = true; - UGuiForm.SetMainFont((Font)asset); - Log.Info("Load font '{0}' OK.", fontName); - }, - - (assetName, status, errorMessage, userData) => - { - Log.Error("Can not load font '{0}' from '{1}' with error message '{2}'.", fontName, assetName, errorMessage); - })); + GameEntry.Resource.LoadAsset(AssetUtility.GetFontAsset(fontName), Constant.AssetPriority.FontAsset, + new LoadAssetCallbacks( + (assetName, asset, duration, userData) => + { + _loadedFlag[Utility.Text.Format("Font.{0}", fontName)] = true; + UGuiForm.SetMainFont((Font)asset); + Log.Info("Load font '{0}' OK.", fontName); + }, + (assetName, status, errorMessage, userData) => + { + Log.Error("Can not load font '{0}' from '{1}' with error message '{2}'.", fontName, assetName, + errorMessage); + })); } private void LoadTMPFont(string fontName) { _loadedFlag.Add(Utility.Text.Format("Font.{0}", fontName), false); - GameEntry.Resource.LoadAsset(AssetUtility.GetTMPFontAsset(fontName), Constant.AssetPriority.FontAsset, new LoadAssetCallbacks( - (assetName, asset, duration, userData) => - { - _loadedFlag[Utility.Text.Format("Font.{0}", fontName)] = true; - UGuiForm.SetMainTMPFont((TMP_FontAsset)asset); - Log.Info("Load font '{0}' OK.", fontName); - }, - - (assetName, status, errorMessage, userData) => - { - Log.Error("Can not load font '{0}' from '{1}' with error message '{2}'.", fontName, assetName, errorMessage); - })); + GameEntry.Resource.LoadAsset(AssetUtility.GetTMPFontAsset(fontName), Constant.AssetPriority.FontAsset, + new LoadAssetCallbacks( + (assetName, asset, duration, userData) => + { + _loadedFlag[Utility.Text.Format("Font.{0}", fontName)] = true; + UGuiForm.SetMainTMPFont((TMP_FontAsset)asset); + Log.Info("Load font '{0}' OK.", fontName); + }, + (assetName, status, errorMessage, userData) => + { + Log.Error("Can not load font '{0}' from '{1}' with error message '{2}'.", fontName, assetName, + errorMessage); + })); } - + private void OnLoadConfigSuccess(object sender, GameEventArgs e) { LoadConfigSuccessEventArgs ne = (LoadConfigSuccessEventArgs)e; @@ -179,7 +187,8 @@ namespace GeometryTD.Procedure return; } - Log.Error("Can not load config '{0}' from '{1}' with error message '{2}'.", ne.ConfigAssetName, ne.ConfigAssetName, ne.ErrorMessage); + Log.Error("Can not load config '{0}' from '{1}' with error message '{2}'.", ne.ConfigAssetName, + ne.ConfigAssetName, ne.ErrorMessage); } private void OnLoadDataTableSuccess(object sender, GameEventArgs e) @@ -202,7 +211,8 @@ namespace GeometryTD.Procedure return; } - Log.Error("Can not load data table '{0}' from '{1}' with error message '{2}'.", ne.DataTableAssetName, ne.DataTableAssetName, ne.ErrorMessage); + Log.Error("Can not load data table '{0}' from '{1}' with error message '{2}'.", ne.DataTableAssetName, + ne.DataTableAssetName, ne.ErrorMessage); } private void OnLoadDictionarySuccess(object sender, GameEventArgs e) @@ -225,7 +235,8 @@ namespace GeometryTD.Procedure return; } - Log.Error("Can not load dictionary '{0}' from '{1}' with error message '{2}'.", ne.DictionaryAssetName, ne.DictionaryAssetName, ne.ErrorMessage); + Log.Error("Can not load dictionary '{0}' from '{1}' with error message '{2}'.", ne.DictionaryAssetName, + ne.DictionaryAssetName, ne.ErrorMessage); } } -} +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Procedure/ProcedureTest.cs b/Assets/GameMain/Scripts/Procedure/ProcedureTest.cs new file mode 100644 index 0000000..1328863 --- /dev/null +++ b/Assets/GameMain/Scripts/Procedure/ProcedureTest.cs @@ -0,0 +1,30 @@ +using GameFramework.Fsm; +using GameFramework.Procedure; + +namespace GeometryTD.Procedure +{ + public class ProcedureTest : ProcedureBase + { + public override bool UseNativeDialog => false; + + #region FSM + + protected override void OnEnter(IFsm procedureOwner) + { + base.OnEnter(procedureOwner); + } + + protected override void OnUpdate(IFsm procedureOwner, float elapseSeconds, + float realElapseSeconds) + { + base.OnUpdate(procedureOwner, elapseSeconds, realElapseSeconds); + } + + protected override void OnLeave(IFsm procedureOwner, bool isShutdown) + { + base.OnLeave(procedureOwner, isShutdown); + } + + #endregion + } +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Procedure/ProcedureTest.cs.meta b/Assets/GameMain/Scripts/Procedure/ProcedureTest.cs.meta new file mode 100644 index 0000000..a019c6d --- /dev/null +++ b/Assets/GameMain/Scripts/Procedure/ProcedureTest.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 5a5a3c55b2b34a159cbb1680728d87d3 +timeCreated: 1772105466 \ No newline at end of file diff --git a/Assets/GameMain/Components.meta b/Assets/GameMain/Scripts/UI/GameScene/Context.meta similarity index 77% rename from Assets/GameMain/Components.meta rename to Assets/GameMain/Scripts/UI/GameScene/Context.meta index 4d0ea0c..eb883d5 100644 --- a/Assets/GameMain/Components.meta +++ b/Assets/GameMain/Scripts/UI/GameScene/Context.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3ecda907b9217e5499e31cb81a154ff4 +guid: 34c97e1af6767d049b17b5c4ff75cb5a folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/GameMain/Scripts/UI/GameScene/Context/EventFormContext.cs b/Assets/GameMain/Scripts/UI/GameScene/Context/EventFormContext.cs new file mode 100644 index 0000000..ea39583 --- /dev/null +++ b/Assets/GameMain/Scripts/UI/GameScene/Context/EventFormContext.cs @@ -0,0 +1,12 @@ +using GeometryTD.UI; + +namespace GeometryTD.UI +{ + public class EventFormContext : UIContext + { + public int EventId; + public string Title; + public string Description; + public EventOptionItemContext[] OptionItems; + } +} diff --git a/Assets/GameMain/Scripts/UI/GameScene/Context/EventFormContext.cs.meta b/Assets/GameMain/Scripts/UI/GameScene/Context/EventFormContext.cs.meta new file mode 100644 index 0000000..e74c575 --- /dev/null +++ b/Assets/GameMain/Scripts/UI/GameScene/Context/EventFormContext.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 95f3e80a51954c66b14e41365622d63f +timeCreated: 1772104202 diff --git a/Assets/GameMain/Scripts/UI/GameScene/Context/EventOptionItemContext.cs b/Assets/GameMain/Scripts/UI/GameScene/Context/EventOptionItemContext.cs new file mode 100644 index 0000000..7ee2f98 --- /dev/null +++ b/Assets/GameMain/Scripts/UI/GameScene/Context/EventOptionItemContext.cs @@ -0,0 +1,8 @@ +namespace GeometryTD.UI +{ + public class EventOptionItemContext + { + public int OptionIndex; + public string OptionText; + } +} diff --git a/Assets/GameMain/Scripts/UI/GameScene/Context/EventOptionItemContext.cs.meta b/Assets/GameMain/Scripts/UI/GameScene/Context/EventOptionItemContext.cs.meta new file mode 100644 index 0000000..6453e82 --- /dev/null +++ b/Assets/GameMain/Scripts/UI/GameScene/Context/EventOptionItemContext.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f56befc364564ac8b499f81ca48a165b +timeCreated: 1772104201 diff --git a/Assets/GameMain/Scripts/UI/GameScene/Controller.meta b/Assets/GameMain/Scripts/UI/GameScene/Controller.meta new file mode 100644 index 0000000..e32969a --- /dev/null +++ b/Assets/GameMain/Scripts/UI/GameScene/Controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 043cb0d817552b549aeff457ac685a0b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/UI/GameScene/Controller/EventFormController.cs b/Assets/GameMain/Scripts/UI/GameScene/Controller/EventFormController.cs new file mode 100644 index 0000000..a3ebf36 --- /dev/null +++ b/Assets/GameMain/Scripts/UI/GameScene/Controller/EventFormController.cs @@ -0,0 +1,124 @@ +using GeometryTD.Definition; +using GeometryTD.CustomEvent; +using GameFramework.Event; +using UnityGameFramework.Runtime; + +namespace GeometryTD.UI +{ + public class EventFormController : UIFormControllerCommonBase + { + private EventFormUseCase m_UseCase; + + protected override UIFormType UIFormTypeId => UIFormType.EventForm; + + protected override void RefreshUI(EventForm form, EventFormContext context) + { + form.RefreshUI(context); + } + + protected override void SubscribeCustomEvents() + { + GameEntry.Event.Subscribe(EventOptionItemSelectedEventArgs.EventId, OnEventOptionItemSelected); + } + + protected override void UnsubscribeCustomEvents() + { + GameEntry.Event.Unsubscribe(EventOptionItemSelectedEventArgs.EventId, OnEventOptionItemSelected); + } + + public override int? OpenUI(object userData = null) + { + if (userData is EventFormContext eventFormContext) + { + return OpenUIInternal(eventFormContext); + } + + if (userData is EventFormRawData rawDataFromUserData) + { + return OpenUI(rawDataFromUserData); + } + + if (userData != null) + { + Log.Warning("EventFormController.OpenUI() userData type is invalid."); + return null; + } + + if (m_UseCase == null) + { + Log.Error("EventFormController.OpenUI() useCase is null."); + return null; + } + + EventFormRawData rawData = m_UseCase.CreateInitialModel(); + return OpenUI(rawData); + } + + public int? OpenUI(EventFormRawData rawData) + { + EventFormContext context = BuildContext(rawData); + return OpenUIInternal(context); + } + + public override void BindUseCase(IUIUseCase useCase) + { + if (!(useCase is EventFormUseCase eventFormUseCase)) + { + Log.Error("EventFormController.BindUseCase() useCase is invalid."); + return; + } + + m_UseCase = eventFormUseCase; + } + + private static EventFormContext BuildContext(EventFormRawData rawData) + { + if (rawData?.EventItem == null) + { + return null; + } + + EventOptionItemContext[] options = new EventOptionItemContext[4]; + for (int i = 0; i < options.Length; i++) + { + string optionText = string.Empty; + if (rawData.EventItem.Options != null && i < rawData.EventItem.Options.Length && + rawData.EventItem.Options[i] != null) + { + optionText = rawData.EventItem.Options[i].OptionText; + } + + options[i] = new EventOptionItemContext + { + OptionIndex = i, + OptionText = optionText + }; + } + + return new EventFormContext + { + EventId = rawData.EventItem.Id, + Title = rawData.EventItem.Title, + Description = rawData.EventItem.Description, + OptionItems = options + }; + } + + private void OnEventOptionItemSelected(object sender, GameEventArgs e) + { + if (!(e is EventOptionItemSelectedEventArgs args)) + { + return; + } + + if (m_UseCase == null) + { + Log.Warning("EventFormController.OnOptionSelected() useCase is null."); + return; + } + + m_UseCase.SelectOption(args.SelectedItemId); + CloseUI(); + } + } +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/UI/GameScene/Controller/EventFormController.cs.meta b/Assets/GameMain/Scripts/UI/GameScene/Controller/EventFormController.cs.meta new file mode 100644 index 0000000..910e303 --- /dev/null +++ b/Assets/GameMain/Scripts/UI/GameScene/Controller/EventFormController.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 916da3490ed14b01ae064cbb37880bba +timeCreated: 1772104204 diff --git a/Assets/GameMain/Scripts/UI/GameScene/RawData.meta b/Assets/GameMain/Scripts/UI/GameScene/RawData.meta new file mode 100644 index 0000000..189322b --- /dev/null +++ b/Assets/GameMain/Scripts/UI/GameScene/RawData.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a0e002d6d3ee84d46859c7933b285513 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/UI/GameScene/RawData/EventFormRawData.cs b/Assets/GameMain/Scripts/UI/GameScene/RawData/EventFormRawData.cs new file mode 100644 index 0000000..64a373a --- /dev/null +++ b/Assets/GameMain/Scripts/UI/GameScene/RawData/EventFormRawData.cs @@ -0,0 +1,9 @@ +using GeometryTD.Definition; + +namespace GeometryTD.UI +{ + public class EventFormRawData + { + public EventItem EventItem; + } +} diff --git a/Assets/GameMain/Scripts/UI/GameScene/RawData/EventFormRawData.cs.meta b/Assets/GameMain/Scripts/UI/GameScene/RawData/EventFormRawData.cs.meta new file mode 100644 index 0000000..7af6d16 --- /dev/null +++ b/Assets/GameMain/Scripts/UI/GameScene/RawData/EventFormRawData.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 463e60ff83314069b83158ccf64cddef +timeCreated: 1772104200 diff --git a/Assets/GameMain/Scripts/UI/GameScene/UseCase.meta b/Assets/GameMain/Scripts/UI/GameScene/UseCase.meta new file mode 100644 index 0000000..d4a7824 --- /dev/null +++ b/Assets/GameMain/Scripts/UI/GameScene/UseCase.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 90fb2ec88edcd2942abcf17a4e206f3e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/UI/GameScene/UseCase/EventFormUseCase.cs b/Assets/GameMain/Scripts/UI/GameScene/UseCase/EventFormUseCase.cs new file mode 100644 index 0000000..a789b03 --- /dev/null +++ b/Assets/GameMain/Scripts/UI/GameScene/UseCase/EventFormUseCase.cs @@ -0,0 +1,46 @@ +using GeometryTD.Definition; +using GeometryTD.UI; +using UnityGameFramework.Runtime; + +namespace GeometryTD.UI +{ + public class EventFormUseCase : IUIUseCase + { + private EventItem m_CurrentEvent; + + public void SetCurrentEvent(EventItem eventItem) + { + m_CurrentEvent = eventItem; + } + + public EventFormRawData CreateInitialModel() + { + if (m_CurrentEvent == null) + { + return null; + } + + return new EventFormRawData + { + EventItem = m_CurrentEvent + }; + } + + public EventOption SelectOption(int optionIndex) + { + if (m_CurrentEvent == null || m_CurrentEvent.Options == null) + { + return null; + } + + if (optionIndex < 0 || optionIndex >= m_CurrentEvent.Options.Length) + { + Log.Warning("EventFormUseCase.SelectOption() option index is invalid: {0}", optionIndex); + return null; + } + + // TODO: 执行 Requirements 校验、CostEffects/RewardEffects 结算与后续节点推进。 + return m_CurrentEvent.Options[optionIndex]; + } + } +} diff --git a/Assets/GameMain/Scripts/UI/GameScene/UseCase/EventFormUseCase.cs.meta b/Assets/GameMain/Scripts/UI/GameScene/UseCase/EventFormUseCase.cs.meta new file mode 100644 index 0000000..52a6d85 --- /dev/null +++ b/Assets/GameMain/Scripts/UI/GameScene/UseCase/EventFormUseCase.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 80d6d6100109462ea498781e9e70201d +timeCreated: 1772104203 diff --git a/Assets/GameMain/Scripts/UI/GameScene/View.meta b/Assets/GameMain/Scripts/UI/GameScene/View.meta new file mode 100644 index 0000000..7494f0f --- /dev/null +++ b/Assets/GameMain/Scripts/UI/GameScene/View.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1f5bf29ff4f1c404cb5b42fb54a8e0b4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/UI/GameScene/View/EventForm.cs b/Assets/GameMain/Scripts/UI/GameScene/View/EventForm.cs new file mode 100644 index 0000000..65f167e --- /dev/null +++ b/Assets/GameMain/Scripts/UI/GameScene/View/EventForm.cs @@ -0,0 +1,81 @@ +using TMPro; +using UnityEngine; +using UnityGameFramework.Runtime; + +namespace GeometryTD.UI +{ + public class EventForm : UGuiForm + { + [SerializeField] private TMP_Text m_TitleText; + [SerializeField] private TMP_Text m_DescriptionText; + [SerializeField] private EventOptionItem[] m_OptionItems; + + private EventFormContext m_Context; + public void RefreshUI(EventFormContext context) + { + m_Context = context; + + if (m_TitleText != null) + { + m_TitleText.text = context?.Title ?? string.Empty; + } + + if (m_DescriptionText != null) + { + m_DescriptionText.text = context?.Description ?? string.Empty; + } + + for (int i = 0; i < m_OptionItems.Length; i++) + { + EventOptionItemContext optionContext = null; + if (context?.OptionItems != null && i < context.OptionItems.Length) + { + optionContext = context.OptionItems[i]; + } + + if (m_OptionItems[i] != null) + { + m_OptionItems[i].OnInit(optionContext); + } + } + } + + protected override void OnOpen(object userData) + { + base.OnOpen(userData); + + if (userData is EventFormContext context) + { + RefreshUI(context); + return; + } + + Log.Warning("EventForm requires EventFormContext as userData."); + } + + protected override void OnClose(bool isShutdown, object userData) + { + m_Context = null; + + if (m_TitleText != null) + { + m_TitleText.text = string.Empty; + } + + if (m_DescriptionText != null) + { + m_DescriptionText.text = string.Empty; + } + + for (int i = 0; i < m_OptionItems.Length; i++) + { + if (m_OptionItems[i] != null) + { + m_OptionItems[i].OnReset(); + } + } + + base.OnClose(isShutdown, userData); + } + } +} diff --git a/Assets/GameMain/Scripts/UI/GameScene/View/EventForm.cs.meta b/Assets/GameMain/Scripts/UI/GameScene/View/EventForm.cs.meta new file mode 100644 index 0000000..8c0d152 --- /dev/null +++ b/Assets/GameMain/Scripts/UI/GameScene/View/EventForm.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 81064d72b60548b6b54d07d94d20b519 +timeCreated: 1772104206 diff --git a/Assets/GameMain/Scripts/UI/GameScene/View/EventOptionItem.cs b/Assets/GameMain/Scripts/UI/GameScene/View/EventOptionItem.cs new file mode 100644 index 0000000..03ced53 --- /dev/null +++ b/Assets/GameMain/Scripts/UI/GameScene/View/EventOptionItem.cs @@ -0,0 +1,50 @@ +using GeometryTD.CustomEvent; +using TMPro; +using UnityEngine; + +namespace GeometryTD.UI +{ + public class EventOptionItem : MonoBehaviour + { + [SerializeField] private TMP_Text _optionText; + + private int _optionIndex; + + public void OnInit(EventOptionItemContext context) + { + if (context == null) + { + OnReset(); + gameObject.SetActive(false); + return; + } + + _optionIndex = context.OptionIndex; + if (_optionText != null) + { + _optionText.text = context.OptionText ?? string.Empty; + } + + gameObject.SetActive(!string.IsNullOrEmpty(context.OptionText)); + } + + public void OnReset() + { + _optionIndex = -1; + if (_optionText != null) + { + _optionText.text = string.Empty; + } + } + + public void OnClick() + { + if (_optionIndex < 0) + { + return; + } + + GameEntry.Event.Fire(this, EventOptionItemSelectedEventArgs.Create(_optionIndex)); + } + } +} diff --git a/Assets/GameMain/Scripts/UI/GameScene/View/EventOptionItem.cs.meta b/Assets/GameMain/Scripts/UI/GameScene/View/EventOptionItem.cs.meta new file mode 100644 index 0000000..523b75f --- /dev/null +++ b/Assets/GameMain/Scripts/UI/GameScene/View/EventOptionItem.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 86cf465d14c649a58473c19ae946d220 +timeCreated: 1772104205 diff --git a/Assets/GameMain/Scripts/Utility/AssetUtility.cs b/Assets/GameMain/Scripts/Utility/AssetUtility.cs index 4a2b878..44e6b64 100644 --- a/Assets/GameMain/Scripts/Utility/AssetUtility.cs +++ b/Assets/GameMain/Scripts/Utility/AssetUtility.cs @@ -23,7 +23,8 @@ namespace GeometryTD.CustomUtility public static string GetDictionaryAsset(string assetName, bool fromBytes) { - return Utility.Text.Format("Assets/GameMain/Localization/{0}/Dictionaries/{1}.{2}", GameEntry.Localization.Language, assetName, fromBytes ? "bytes" : "xml"); + return Utility.Text.Format("Assets/GameMain/Localization/{0}/Dictionaries/{1}.{2}", + GameEntry.Localization.Language, assetName, fromBytes ? "bytes" : "xml"); } public static string GetFontAsset(string assetName) @@ -35,7 +36,7 @@ namespace GeometryTD.CustomUtility { return Utility.Text.Format("Assets/GameMain/Fonts/{0}.asset", assetName); } - + public static string GetSceneAsset(string assetName) { return Utility.Text.Format("Assets/GameMain/Scenes/{0}.unity", assetName); @@ -65,5 +66,10 @@ namespace GeometryTD.CustomUtility { return Utility.Text.Format("Assets/GameMain/UI/UISounds/{0}.wav", assetName); } + + public static string GetLevelMapAsset(string assetName) + { + return Utility.Text.Format("Assets/GameMain/LevelMap/Level{0}.prefab", assetName); + } } -} +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Utility/JsonNetUtility.cs b/Assets/GameMain/Scripts/Utility/JsonNetUtility.cs new file mode 100644 index 0000000..abe08ce --- /dev/null +++ b/Assets/GameMain/Scripts/Utility/JsonNetUtility.cs @@ -0,0 +1,26 @@ +using System; +using Newtonsoft.Json; + +namespace GeometryTD.CustomUtility +{ + /// + /// Newtonsoft.Json 函数集辅助器。 + /// + public class JsonNetUtility : GameFramework.Utility.Json.IJsonHelper + { + public string ToJson(object obj) + { + return JsonConvert.SerializeObject(obj); + } + + public T ToObject(string json) + { + return JsonConvert.DeserializeObject(json); + } + + public object ToObject(Type objectType, string json) + { + return JsonConvert.DeserializeObject(json, objectType); + } + } +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Utility/LitJsonHelper.cs.meta b/Assets/GameMain/Scripts/Utility/JsonNetUtility.cs.meta similarity index 69% rename from Assets/GameMain/Scripts/Utility/LitJsonHelper.cs.meta rename to Assets/GameMain/Scripts/Utility/JsonNetUtility.cs.meta index 0d6c3c5..8eda188 100644 --- a/Assets/GameMain/Scripts/Utility/LitJsonHelper.cs.meta +++ b/Assets/GameMain/Scripts/Utility/JsonNetUtility.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: 894291f7d20e5dc4bb7264dec378b1ce -timeCreated: 1528026163 -licenseType: Pro +guid: a64f8e5b71575bd43802e0761393bc50 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Assets/GameMain/Scripts/Utility/LitJsonHelper.cs b/Assets/GameMain/Scripts/Utility/LitJsonHelper.cs deleted file mode 100644 index 3be4112..0000000 --- a/Assets/GameMain/Scripts/Utility/LitJsonHelper.cs +++ /dev/null @@ -1,52 +0,0 @@ -//------------------------------------------------------------ -// Game Framework -// Copyright © 2013-2021 Jiang Yin. All rights reserved. -// Homepage: https://gameframework.cn/ -// Feedback: mailto:ellan@gameframework.cn -//------------------------------------------------------------ - -using GameFramework; -using LitJson; -using System; - -namespace GeometryTD.CustomUtility -{ - /// - /// LitJSON 函数集辅助器。 - /// - internal class LitJsonHelper : Utility.Json.IJsonHelper - { - /// - /// 将对象序列化为 JSON 字符串。 - /// - /// 要序列化的对象。 - /// 序列化后的 JSON 字符串。 - public string ToJson(object obj) - { - return JsonMapper.ToJson(obj); - } - - /// - /// 将 JSON 字符串反序列化为对象。 - /// - /// 对象类型。 - /// 要反序列化的 JSON 字符串。 - /// 反序列化后的对象。 - public T ToObject(string json) - { - return JsonMapper.ToObject(json); - } - - /// - /// 将 JSON 字符串反序列化为对象。 - /// - /// 对象类型。 - /// 要反序列化的 JSON 字符串。 - /// 反序列化后的对象。 - public object ToObject(Type objectType, string json) - { - // TODO: 可反射为 ToObject(string json) - throw new NotSupportedException("ToObject(Type objectType, string json)"); - } - } -} diff --git a/Assets/Launcher.unity b/Assets/Launcher.unity index e67be40..93a6cea 100644 --- a/Assets/Launcher.unity +++ b/Assets/Launcher.unity @@ -250,6 +250,130 @@ MonoBehaviour: m_MipBias: 0 m_VarianceClampScale: 0.9 m_ContrastAdaptiveSharpening: 0 +--- !u!1 &66375238 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 66375239} + - component: {fileID: 66375240} + m_Layer: 5 + m_Name: Option (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &66375239 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 66375238} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 740414970} + - {fileID: 573313354} + m_Father: {fileID: 90960106} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 1200, y: 80} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &66375240 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 66375238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a5079836f95c2a44b96fa331487ebb70, type: 3} + m_Name: + m_EditorClassIdentifier: + _onHover: + m_PersistentCalls: + m_Calls: [] + _onClick: + m_PersistentCalls: + m_Calls: [] + _onHoverEnd: + m_PersistentCalls: + m_Calls: [] + _allowFade: 1 +--- !u!1 &90960105 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 90960106} + - component: {fileID: 90960107} + m_Layer: 5 + m_Name: Options + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &90960106 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 90960105} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 834464070} + - {fileID: 66375239} + m_Father: {fileID: 952642908} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: -381.59857} + m_SizeDelta: {x: 1200, y: 363.1971} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &90960107 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 90960105} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 1 + m_Spacing: 30 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 0 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 --- !u!1 &119167775 GameObject: m_ObjectHideFlags: 0 @@ -282,6 +406,9 @@ Transform: - {fileID: 513208573} - {fileID: 1604812193} - {fileID: 1968988098} + - {fileID: 159392563} + - {fileID: 1549230541} + - {fileID: 2007255511} m_Father: {fileID: 1852670053} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &120093239 @@ -374,6 +501,50 @@ MonoBehaviour: m_PointerBehavior: 0 m_CursorLockBehavior: 0 m_ScrollDeltaPerTick: 6 +--- !u!1 &159392562 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 159392563} + - component: {fileID: 159392564} + m_Layer: 0 + m_Name: EventNode + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &159392563 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 159392562} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 119167776} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &159392564 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 159392562} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0a0c1c547ca24c95819f5f62f0bd3ea3, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1001 &343730742 PrefabInstance: m_ObjectHideFlags: 0 @@ -429,7 +600,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 11405216, guid: adb3eb1c35fcff14f89fba7b05c9d71c, type: 3} propertyPath: m_AvailableProcedureTypeNames.Array.size - value: 10 + value: 12 objectReference: {fileID: 0} - target: {fileID: 11405216, guid: adb3eb1c35fcff14f89fba7b05c9d71c, type: 3} propertyPath: m_AvailableProcedureTypeNames.Array.data[0] @@ -453,31 +624,31 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 11405216, guid: adb3eb1c35fcff14f89fba7b05c9d71c, type: 3} propertyPath: m_AvailableProcedureTypeNames.Array.data[5] - value: GeometryTD.Procedure.ProcedurePreload + value: GeometryTD.Procedure.ProcedureMenu objectReference: {fileID: 0} - target: {fileID: 11405216, guid: adb3eb1c35fcff14f89fba7b05c9d71c, type: 3} propertyPath: m_AvailableProcedureTypeNames.Array.data[6] - value: GeometryTD.Procedure.ProcedureSplash + value: GeometryTD.Procedure.ProcedurePreload objectReference: {fileID: 0} - target: {fileID: 11405216, guid: adb3eb1c35fcff14f89fba7b05c9d71c, type: 3} propertyPath: m_AvailableProcedureTypeNames.Array.data[7] - value: GeometryTD.Procedure.ProcedureUpdateResources + value: GeometryTD.Procedure.ProcedureSplash objectReference: {fileID: 0} - target: {fileID: 11405216, guid: adb3eb1c35fcff14f89fba7b05c9d71c, type: 3} propertyPath: m_AvailableProcedureTypeNames.Array.data[8] - value: GeometryTD.Procedure.ProcedureUpdateVersion + value: GeometryTD.Procedure.ProcedureTest objectReference: {fileID: 0} - target: {fileID: 11405216, guid: adb3eb1c35fcff14f89fba7b05c9d71c, type: 3} propertyPath: m_AvailableProcedureTypeNames.Array.data[9] - value: GeometryTD.Procedure.ProcedureVerifyResources + value: GeometryTD.Procedure.ProcedureUpdateResources objectReference: {fileID: 0} - target: {fileID: 11405216, guid: adb3eb1c35fcff14f89fba7b05c9d71c, type: 3} propertyPath: m_AvailableProcedureTypeNames.Array.data[10] - value: Procedure.ProcedureUpdateResources + value: GeometryTD.Procedure.ProcedureUpdateVersion objectReference: {fileID: 0} - target: {fileID: 11405216, guid: adb3eb1c35fcff14f89fba7b05c9d71c, type: 3} propertyPath: m_AvailableProcedureTypeNames.Array.data[11] - value: Procedure.ProcedureUpdateVersion + value: GeometryTD.Procedure.ProcedureVerifyResources objectReference: {fileID: 0} - target: {fileID: 11405216, guid: adb3eb1c35fcff14f89fba7b05c9d71c, type: 3} propertyPath: m_AvailableProcedureTypeNames.Array.data[12] @@ -770,7 +941,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 11499388, guid: adb3eb1c35fcff14f89fba7b05c9d71c, type: 3} propertyPath: m_JsonHelperTypeName - value: GeometryTD.CustomUtility.LitJsonHelper + value: GeometryTD.CustomUtility.JsonNetUtility objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] @@ -842,6 +1013,351 @@ MonoBehaviour: type: 3} _updateResourceFormTemplate: {fileID: 11487720, guid: a6c731de80e9d824d8f657301a357269, type: 3} +--- !u!1 &573313353 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 573313354} + - component: {fileID: 573313356} + - component: {fileID: 573313355} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &573313354 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 573313353} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 66375239} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -40, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &573313355 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 573313353} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: "\u4E0B\u6CE8 100\uFF08\u91D1\uFF09- \u6FC0\u8FDB\uFF1A30% \u8D62 250" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 99d811b0183246646a2ce8df996f4bca, type: 2} + m_sharedMaterial: {fileID: -1106088975554028259, guid: 99d811b0183246646a2ce8df996f4bca, + type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 36 + m_fontSizeBase: 36 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &573313356 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 573313353} + m_CullTransparentMesh: 1 +--- !u!1 &600052084 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 600052085} + - component: {fileID: 600052087} + - component: {fileID: 600052086} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &600052085 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 600052084} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 834464070} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -40, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &600052086 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 600052084} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: "\u4E0B\u6CE8 100\uFF08\u91D1\uFF09- \u7A33\u5065\uFF1A70% \u8D62 150" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 99d811b0183246646a2ce8df996f4bca, type: 2} + m_sharedMaterial: {fileID: -1106088975554028259, guid: 99d811b0183246646a2ce8df996f4bca, + type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 36 + m_fontSizeBase: 36 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &600052087 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 600052084} + m_CullTransparentMesh: 1 +--- !u!1 &740414969 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 740414970} + - component: {fileID: 740414972} + - component: {fileID: 740414971} + m_Layer: 5 + m_Name: Board + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &740414970 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 740414969} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 66375239} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &740414971 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 740414969} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: a8c07bbe04fdaf04b80e27f651a8edd6, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &740414972 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 740414969} + m_CullTransparentMesh: 1 --- !u!850595691 &819759088 LightingSettings: m_ObjectHideFlags: 0 @@ -906,6 +1422,424 @@ LightingSettings: m_PVRTiledBaking: 0 m_NumRaysToShootPerTexel: -1 m_RespectSceneVisibilityWhenBakingGI: 0 +--- !u!1 &834464069 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 834464070} + - component: {fileID: 834464071} + - component: {fileID: 834464072} + m_Layer: 5 + m_Name: Option + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &834464070 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 834464069} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 923484964} + - {fileID: 600052085} + m_Father: {fileID: 90960106} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 1200, y: 80} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &834464071 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 834464069} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a5079836f95c2a44b96fa331487ebb70, type: 3} + m_Name: + m_EditorClassIdentifier: + _onHover: + m_PersistentCalls: + m_Calls: [] + _onClick: + m_PersistentCalls: + m_Calls: [] + _onHoverEnd: + m_PersistentCalls: + m_Calls: [] + _allowFade: 1 +--- !u!114 &834464072 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 834464069} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 86cf465d14c649a58473c19ae946d220, type: 3} + m_Name: + m_EditorClassIdentifier: + m_OptionText: {fileID: 600052086} +--- !u!1 &923484963 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 923484964} + - component: {fileID: 923484966} + - component: {fileID: 923484965} + m_Layer: 5 + m_Name: Board + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &923484964 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 923484963} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 834464070} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &923484965 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 923484963} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: a8c07bbe04fdaf04b80e27f651a8edd6, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &923484966 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 923484963} + m_CullTransparentMesh: 1 +--- !u!1 &952642907 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 952642908} + - component: {fileID: 952642910} + - component: {fileID: 952642909} + m_Layer: 5 + m_Name: Bg + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &952642908 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 952642907} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2032787498} + - {fileID: 1026522664} + - {fileID: 90960106} + m_Father: {fileID: 961165660} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &952642909 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 952642907} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.2, g: 0.2, b: 0.2, a: 0.5019608} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &952642910 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 952642907} + m_CullTransparentMesh: 1 +--- !u!1 &961165659 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 961165660} + - component: {fileID: 961165661} + m_Layer: 5 + m_Name: EventForm + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &961165660 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 961165659} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 952642908} + m_Father: {fileID: 1576232203} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &961165661 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 961165659} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 81064d72b60548b6b54d07d94d20b519, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TitleText: {fileID: 2032787499} + m_DescriptionText: {fileID: 1026522665} + m_OptionItems: + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} +--- !u!1 &1026522663 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1026522664} + - component: {fileID: 1026522666} + - component: {fileID: 1026522665} + m_Layer: 5 + m_Name: Description + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1026522664 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1026522663} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 952642908} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 125.000015} + m_SizeDelta: {x: 1200, y: 600} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1026522665 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1026522663} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: "\u4E00\u540D\u5546\u4EBA\u9080\u8BF7\u4F60\u4E0B\u6CE8\u3002\u8D62\u4E86\u5C31\u80FD\u8D5A\u4E00\u7B14\u3002" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 99d811b0183246646a2ce8df996f4bca, type: 2} + m_sharedMaterial: {fileID: -1106088975554028259, guid: 99d811b0183246646a2ce8df996f4bca, + type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 50 + m_fontSizeBase: 50 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &1026522666 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1026522663} + m_CullTransparentMesh: 1 --- !u!1 &1454214586 GameObject: m_ObjectHideFlags: 0 @@ -989,6 +1923,50 @@ MonoBehaviour: m_DefaultSpriteDPI: 96 m_DynamicPixelsPerUnit: 1 m_PresetInfoIsWorld: 0 +--- !u!1 &1549230540 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1549230541} + - component: {fileID: 1549230542} + m_Layer: 0 + m_Name: CombatNode + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1549230541 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1549230540} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 119167776} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1549230542 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1549230540} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5e646500b9304d438746f2351c71a0f4, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1576232202 GameObject: m_ObjectHideFlags: 0 @@ -1019,7 +1997,8 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0} m_ConstrainProportionsScale: 0 - m_Children: [] + m_Children: + - {fileID: 961165660} m_Father: {fileID: 432952642} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -1228,6 +2207,185 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 8d840df1b53db744cb522b82426f2cd5, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!1 &2007255510 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2007255511} + - component: {fileID: 2007255512} + m_Layer: 0 + m_Name: UIRouter + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2007255511 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2007255510} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 119167776} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2007255512 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2007255510} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c27ab66e930c72847aef7dd05aff8953, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &2032787497 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2032787498} + - component: {fileID: 2032787500} + - component: {fileID: 2032787499} + m_Layer: 5 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2032787498 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2032787497} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 952642908} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 0, y: -200} + m_SizeDelta: {x: 1200, y: 150} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2032787499 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2032787497} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: "\u4EA4\u6613" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 99d811b0183246646a2ce8df996f4bca, type: 2} + m_sharedMaterial: {fileID: -1106088975554028259, guid: 99d811b0183246646a2ce8df996f4bca, + type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 100 + m_fontSizeBase: 100 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &2032787500 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2032787497} + m_CullTransparentMesh: 1 --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 diff --git a/Packages/manifest.json b/Packages/manifest.json index 0101e13..ac983e7 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -5,6 +5,7 @@ "com.unity.ide.visualstudio": "2.0.22", "com.unity.ide.vscode": "1.2.5", "com.unity.inputsystem": "1.14.2", + "com.unity.nuget.newtonsoft-json": "3.2.2", "com.unity.render-pipelines.universal": "14.0.12", "com.unity.test-framework": "1.1.33", "com.unity.textmeshpro": "3.0.7", @@ -43,4 +44,4 @@ "com.unity.modules.wind": "1.0.0", "com.unity.modules.xr": "1.0.0" } -} +} \ No newline at end of file diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 01f77ac..9f838b9 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -65,6 +65,13 @@ "dependencies": {}, "url": "https://packages.unity.cn" }, + "com.unity.nuget.newtonsoft-json": { + "version": "3.2.2", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.cn" + }, "com.unity.render-pipelines.core": { "version": "14.0.12", "depth": 1,