From 57fa0bf771670caf26b31b4f7c790e0574c4f45b Mon Sep 17 00:00:00 2001 From: hhzzff <2070620600@qq.com> Date: Wed, 3 Apr 2024 16:58:05 +0800 Subject: [PATCH] feat: :sparkles: add several icons and finished factory --- .../Assets/Prefabs/afflict_civilship3.prefab | 4 +- .../interface_local/Assets/Prefabs/arc.prefab | 360 ++++++++++++++++++ .../Assets/Prefabs/arc.prefab.meta | 7 + .../Assets/Prefabs/community.prefab | 116 +++++- .../Prefabs/disperse_militaryship3.prefab | 2 +- .../Assets/Prefabs/factory.prefab | 118 +++++- .../Prefabs/foreshadow_flagship3.prefab | 4 +- .../Assets/Prefabs/missile.prefab | 2 +- .../Assets/Prefabs/plasma.prefab | 2 +- .../Assets/Prefabs/shell.prefab | 2 +- .../Assets/Prefabs/tsunami_fort3.prefab | 110 +++++- .../Assets/Resources/UI/Repair.aseprite | Bin 0 -> 732 bytes .../Assets/Resources/UI/Repair.aseprite.meta | 164 ++++++++ .../Assets/Resources/UI/Repair.png | Bin 0 -> 419 bytes .../Assets/Resources/UI/Repair.png.meta | 166 ++++++++ .../interface_local/Assets/Scenes/Game.unity | 23 +- .../Assets/Scripts/Base/BaseControl.cs | 55 ++- .../Assets/Scripts/Bullet/ArcTrailControl.cs | 36 ++ .../Scripts/Bullet/ArcTrailControl.cs.meta | 11 + .../Construction/ConstructionControl.cs | 97 +++++ .../Construction/ConstructionControl.cs.meta | 11 + .../Assets/Scripts/Data/BaseData.meta | 8 + .../Scripts/Data/BaseData/BaseData.asset | 24 ++ .../Scripts/Data/BaseData/BaseData.asset.meta | 8 + .../Assets/Scripts/Data/BaseData/BaseData.cs | 13 + .../Scripts/Data/BaseData/BaseData.cs.meta | 11 + .../Scripts/Data/BulletData/LaserData.asset | 2 +- .../Assets/Scripts/Data/ConstructionData.meta | 8 + .../Data/ConstructionData/CommunityData.asset | 19 + .../ConstructionData/CommunityData.asset.meta | 8 + .../Data/ConstructionData/ConstructionData.cs | 13 + .../ConstructionData/ConstructionData.cs.meta | 11 + .../Data/ConstructionData/FactoryData.asset | 19 + .../ConstructionData/FactoryData.asset.meta | 8 + .../Data/ConstructionData/FortData.asset | 19 + .../Data/ConstructionData/FortData.asset.meta | 8 + .../Assets/Scripts/Data/ConstructorData.meta | 8 + .../ConstructorData/Constructor1Data.asset | 16 + .../Constructor1Data.asset.meta | 8 + .../ConstructorData/Constructor2Data.asset | 16 + .../Constructor2Data.asset.meta | 8 + .../ConstructorData/Constructor3Data.asset | 16 + .../Constructor3Data.asset.meta | 8 + .../Data/ConstructorData/ConstructorData.cs | 10 + .../ConstructorData/ConstructorData.cs.meta | 11 + .../Scripts/InteractBase/InteractBase.cs | 5 + .../Assets/Scripts/Map/MapControl.cs | 20 +- .../Assets/Scripts/Message2Clients.cs | 33 +- .../Assets/Scripts/MessageType.cs | 3 +- .../Assets/Scripts/ObjCreater.cs | 25 +- .../Assets/Scripts/ParaDefine.cs | 11 + .../Assets/Scripts/Place/PlaceManager.cs | 4 +- .../Assets/Scripts/Player/PlayerControl.cs | 4 +- .../Assets/Scripts/RendererControl.cs | 2 +- .../Assets/Scripts/Ship/ShipControl.cs | 59 ++- .../interface_local/Assets/Scripts/Tool.cs | 6 +- 56 files changed, 1675 insertions(+), 67 deletions(-) create mode 100644 interface/interface_local/Assets/Prefabs/arc.prefab create mode 100644 interface/interface_local/Assets/Prefabs/arc.prefab.meta create mode 100644 interface/interface_local/Assets/Resources/UI/Repair.aseprite create mode 100644 interface/interface_local/Assets/Resources/UI/Repair.aseprite.meta create mode 100644 interface/interface_local/Assets/Resources/UI/Repair.png create mode 100644 interface/interface_local/Assets/Resources/UI/Repair.png.meta create mode 100644 interface/interface_local/Assets/Scripts/Bullet/ArcTrailControl.cs create mode 100644 interface/interface_local/Assets/Scripts/Bullet/ArcTrailControl.cs.meta create mode 100644 interface/interface_local/Assets/Scripts/Construction/ConstructionControl.cs create mode 100644 interface/interface_local/Assets/Scripts/Construction/ConstructionControl.cs.meta create mode 100644 interface/interface_local/Assets/Scripts/Data/BaseData.meta create mode 100644 interface/interface_local/Assets/Scripts/Data/BaseData/BaseData.asset create mode 100644 interface/interface_local/Assets/Scripts/Data/BaseData/BaseData.asset.meta create mode 100644 interface/interface_local/Assets/Scripts/Data/BaseData/BaseData.cs create mode 100644 interface/interface_local/Assets/Scripts/Data/BaseData/BaseData.cs.meta create mode 100644 interface/interface_local/Assets/Scripts/Data/ConstructionData.meta create mode 100644 interface/interface_local/Assets/Scripts/Data/ConstructionData/CommunityData.asset create mode 100644 interface/interface_local/Assets/Scripts/Data/ConstructionData/CommunityData.asset.meta create mode 100644 interface/interface_local/Assets/Scripts/Data/ConstructionData/ConstructionData.cs create mode 100644 interface/interface_local/Assets/Scripts/Data/ConstructionData/ConstructionData.cs.meta create mode 100644 interface/interface_local/Assets/Scripts/Data/ConstructionData/FactoryData.asset create mode 100644 interface/interface_local/Assets/Scripts/Data/ConstructionData/FactoryData.asset.meta create mode 100644 interface/interface_local/Assets/Scripts/Data/ConstructionData/FortData.asset create mode 100644 interface/interface_local/Assets/Scripts/Data/ConstructionData/FortData.asset.meta create mode 100644 interface/interface_local/Assets/Scripts/Data/ConstructorData.meta create mode 100644 interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor1Data.asset create mode 100644 interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor1Data.asset.meta create mode 100644 interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor2Data.asset create mode 100644 interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor2Data.asset.meta create mode 100644 interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor3Data.asset create mode 100644 interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor3Data.asset.meta create mode 100644 interface/interface_local/Assets/Scripts/Data/ConstructorData/ConstructorData.cs create mode 100644 interface/interface_local/Assets/Scripts/Data/ConstructorData/ConstructorData.cs.meta diff --git a/interface/interface_local/Assets/Prefabs/afflict_civilship3.prefab b/interface/interface_local/Assets/Prefabs/afflict_civilship3.prefab index f4f469b5..64bbb18c 100644 --- a/interface/interface_local/Assets/Prefabs/afflict_civilship3.prefab +++ b/interface/interface_local/Assets/Prefabs/afflict_civilship3.prefab @@ -199,7 +199,7 @@ Transform: 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_LocalScale: {x: 0.67, y: 0.67, z: 0.67} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 4444664502502823957} @@ -281,7 +281,7 @@ MonoBehaviour: shipType: 0 viewRange: 0 producerType: 1 - constructorType: 0 + constructorType: 1 armorType: 0 shieldType: 0 weaponType: 1 diff --git a/interface/interface_local/Assets/Prefabs/arc.prefab b/interface/interface_local/Assets/Prefabs/arc.prefab new file mode 100644 index 00000000..c94e652a --- /dev/null +++ b/interface/interface_local/Assets/Prefabs/arc.prefab @@ -0,0 +1,360 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &3845175679092181272 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4238342118252321231} + - component: {fileID: 4069338479764846039} + m_Layer: 0 + m_Name: mask1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4238342118252321231 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3845175679092181272} + 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: 116280945263292980} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &4069338479764846039 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3845175679092181272} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4aad3f71b38d9494da69c5a8e6992b3f, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: fe6f37ec6c062124ca4d994d1631b7bc, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 0.16, y: 0.32} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &5671706578558220722 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 116280945263292980} + - component: {fileID: -8199526034595813093} + - component: {fileID: 330809320193030683} + - component: {fileID: 4501115928246254698} + m_Layer: 0 + m_Name: arc + m_TagString: Bullet + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &116280945263292980 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5671706578558220722} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.3, y: 0.3, z: 0.3} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4238342118252321231} + - {fileID: 3931226403777765657} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &-8199526034595813093 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5671706578558220722} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5141ad9590fdebe40801dacf452415bc, type: 3} + m_Name: + m_EditorClassIdentifier: + bulletData: {fileID: 11400000, guid: 4758f2e9f24bebf45a9517cf2f743093, type: 2} + messageOfBullet: + type: 5 + playerTeam: 0 +--- !u!50 &330809320193030683 +Rigidbody2D: + serializedVersion: 4 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5671706578558220722} + m_BodyType: 0 + m_Simulated: 1 + m_UseFullKinematicContacts: 0 + m_UseAutoMass: 0 + m_Mass: 1 + m_LinearDrag: 0 + m_AngularDrag: 0.05 + m_GravityScale: 0 + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_Interpolate: 0 + m_SleepingMode: 1 + m_CollisionDetection: 1 + m_Constraints: 0 +--- !u!58 &4501115928246254698 +CircleCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5671706578558220722} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ForceSendLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ForceReceiveLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ContactCaptureLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_CallbackLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_IsTrigger: 1 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + serializedVersion: 2 + m_Radius: 0.18664187 +--- !u!1 &8144883517969213009 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3931226403777765657} + - component: {fileID: 4116276845949665465} + - component: {fileID: 4825250962210379150} + m_Layer: 0 + m_Name: Trail + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3931226403777765657 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8144883517969213009} + 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: 116280945263292980} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4116276845949665465 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8144883517969213009} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d9f00ebba21f7154aaccdeeba4130bc0, type: 3} + m_Name: + m_EditorClassIdentifier: + NoiseScale: 5 + OffsetScale: 0.05 +--- !u!96 &4825250962210379150 +TrailRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8144883517969213009} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4aad3f71b38d9494da69c5a8e6992b3f, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Time: 0.8 + m_PreviewTimeScale: 1 + m_Parameters: + serializedVersion: 3 + widthMultiplier: 1 + widthCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.12254715 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.8075994 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + colorGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + numCornerVertices: 0 + numCapVertices: 0 + alignment: 0 + textureMode: 0 + textureScale: {x: 1, y: 1} + shadowBias: 0.5 + generateLightingData: 0 + m_MinVertexDistance: 1 + m_MaskInteraction: 0 + m_Autodestruct: 0 + m_Emitting: 1 + m_ApplyActiveColorSpace: 1 diff --git a/interface/interface_local/Assets/Prefabs/arc.prefab.meta b/interface/interface_local/Assets/Prefabs/arc.prefab.meta new file mode 100644 index 00000000..5843f200 --- /dev/null +++ b/interface/interface_local/Assets/Prefabs/arc.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: afe69842439154b428512871bfc3db8a +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Prefabs/community.prefab b/interface/interface_local/Assets/Prefabs/community.prefab index 4806d5b1..b6012f51 100644 --- a/interface/interface_local/Assets/Prefabs/community.prefab +++ b/interface/interface_local/Assets/Prefabs/community.prefab @@ -10,6 +10,7 @@ GameObject: m_Component: - component: {fileID: 940564042307808193} - component: {fileID: 7343186342370500237} + - component: {fileID: 612575302597527367} m_Layer: 0 m_Name: community m_TagString: Untagged @@ -29,7 +30,8 @@ Transform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 - m_Children: [] + m_Children: + - {fileID: 2724905529318237062} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!212 &7343186342370500237 @@ -70,9 +72,9 @@ SpriteRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} - m_SortingLayerID: -1026933429 - m_SortingLayer: -1 - m_SortingOrder: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 1 m_Sprite: {fileID: 21300000, guid: 9b6824ba5f9a5044da5da80bf1cbead2, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 @@ -84,3 +86,109 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!114 &612575302597527367 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6520154078847335470} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0e77f2e277d814d43bfb9b604c6653cc, type: 3} + m_Name: + m_EditorClassIdentifier: + messageOfConstruction: + x: 0 + y: 0 + hp: 0 + constructionType: 2 + playerTeam: 0 + constructed: 0 + constructionData: {fileID: 11400000, guid: 69ca601dd1cfbf8438c108e04c5ba59a, type: 2} + repairIcon: {fileID: 0} + repairIconRotateAngle: 30 +--- !u!1 &8904761873208969172 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2724905529318237062} + - component: {fileID: 1351100680498616770} + m_Layer: 0 + m_Name: RepairIcon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2724905529318237062 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8904761873208969172} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.5891, y: 0.5891, z: 0.5891} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 940564042307808193} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &1351100680498616770 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8904761873208969172} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 1 + m_Sprite: {fileID: 21300000, guid: 907b71767b1995a4f9a64504b433b677, type: 3} + m_Color: {r: 0.7095581, g: 1, b: 0.6933962, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 0.64, y: 0.64} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 diff --git a/interface/interface_local/Assets/Prefabs/disperse_militaryship3.prefab b/interface/interface_local/Assets/Prefabs/disperse_militaryship3.prefab index 9fc8c495..e2c9719c 100644 --- a/interface/interface_local/Assets/Prefabs/disperse_militaryship3.prefab +++ b/interface/interface_local/Assets/Prefabs/disperse_militaryship3.prefab @@ -31,7 +31,7 @@ Transform: 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_LocalScale: {x: 0.6, y: 0.6, z: 0.6} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 7205393884840880041} diff --git a/interface/interface_local/Assets/Prefabs/factory.prefab b/interface/interface_local/Assets/Prefabs/factory.prefab index 14607601..ecceec3b 100644 --- a/interface/interface_local/Assets/Prefabs/factory.prefab +++ b/interface/interface_local/Assets/Prefabs/factory.prefab @@ -1,5 +1,89 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: +--- !u!1 &1670037946623830289 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8740664729240385028} + - component: {fileID: 2427069875621801268} + m_Layer: 0 + m_Name: RepairIcon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8740664729240385028 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1670037946623830289} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.5891, y: 0.5891, z: 0.5891} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2704582977882591132} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &2427069875621801268 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1670037946623830289} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 1 + m_Sprite: {fileID: 21300000, guid: 907b71767b1995a4f9a64504b433b677, type: 3} + m_Color: {r: 0.7095581, g: 1, b: 0.6933962, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 0.64, y: 0.64} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 --- !u!1 &6257076823173944538 GameObject: m_ObjectHideFlags: 0 @@ -10,6 +94,7 @@ GameObject: m_Component: - component: {fileID: 2704582977882591132} - component: {fileID: 8375780746031390831} + - component: {fileID: -9043656545730163154} m_Layer: 0 m_Name: factory m_TagString: Untagged @@ -29,7 +114,8 @@ Transform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 - m_Children: [] + m_Children: + - {fileID: 8740664729240385028} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!212 &8375780746031390831 @@ -70,9 +156,9 @@ SpriteRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} - m_SortingLayerID: -1026933429 - m_SortingLayer: -1 - m_SortingOrder: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 1 m_Sprite: {fileID: 21300000, guid: 4e69b7691cca9c241a1519d297e81311, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 @@ -84,3 +170,27 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!114 &-9043656545730163154 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6257076823173944538} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0e77f2e277d814d43bfb9b604c6653cc, type: 3} + m_Name: + m_EditorClassIdentifier: + messageOfConstruction: + x: 0 + y: 0 + hp: 0 + constructionType: 1 + playerTeam: 0 + constructed: 0 + constructionData: {fileID: 11400000, guid: 54c9136022665164c9024a91f2c26b1b, type: 2} + repairIcon: {fileID: 0} + iconRotateAngle: 30 + iconRotateTime: 0.6 + constructing: 0 diff --git a/interface/interface_local/Assets/Prefabs/foreshadow_flagship3.prefab b/interface/interface_local/Assets/Prefabs/foreshadow_flagship3.prefab index 7a46facf..fc77b841 100644 --- a/interface/interface_local/Assets/Prefabs/foreshadow_flagship3.prefab +++ b/interface/interface_local/Assets/Prefabs/foreshadow_flagship3.prefab @@ -199,7 +199,7 @@ Transform: 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_LocalScale: {x: 0.55, y: 0.55, z: 0.55} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 8795451193146998850} @@ -278,7 +278,7 @@ MonoBehaviour: shield: 800 playerTeam: 0 shipState: 0 - shipType: 3 + shipType: 0 viewRange: 0 producerType: 1 constructorType: 0 diff --git a/interface/interface_local/Assets/Prefabs/missile.prefab b/interface/interface_local/Assets/Prefabs/missile.prefab index 112096ec..fe912932 100644 --- a/interface/interface_local/Assets/Prefabs/missile.prefab +++ b/interface/interface_local/Assets/Prefabs/missile.prefab @@ -29,7 +29,7 @@ Transform: serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.4, y: 0.4, z: 0.4} + m_LocalScale: {x: 0.6, y: 0.6, z: 0.6} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 2044924485689081778} diff --git a/interface/interface_local/Assets/Prefabs/plasma.prefab b/interface/interface_local/Assets/Prefabs/plasma.prefab index 4c2f83a2..a79b04e7 100644 --- a/interface/interface_local/Assets/Prefabs/plasma.prefab +++ b/interface/interface_local/Assets/Prefabs/plasma.prefab @@ -113,7 +113,7 @@ Transform: serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.4, y: 0.4, z: 0.4} + m_LocalScale: {x: 0.6, y: 0.6, z: 0.6} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 4078562955258069677} diff --git a/interface/interface_local/Assets/Prefabs/shell.prefab b/interface/interface_local/Assets/Prefabs/shell.prefab index 928e97fe..ba7dc275 100644 --- a/interface/interface_local/Assets/Prefabs/shell.prefab +++ b/interface/interface_local/Assets/Prefabs/shell.prefab @@ -113,7 +113,7 @@ Transform: serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.4, y: 0.4, z: 0.4} + m_LocalScale: {x: 0.55, y: 0.55, z: 0.55} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 4238342118252321231} diff --git a/interface/interface_local/Assets/Prefabs/tsunami_fort3.prefab b/interface/interface_local/Assets/Prefabs/tsunami_fort3.prefab index efe3c0d3..d3af4094 100644 --- a/interface/interface_local/Assets/Prefabs/tsunami_fort3.prefab +++ b/interface/interface_local/Assets/Prefabs/tsunami_fort3.prefab @@ -84,6 +84,90 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!1 &6381745134922277866 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3089387358181031060} + - component: {fileID: 4981385064428574191} + m_Layer: 0 + m_Name: RepairIcon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3089387358181031060 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6381745134922277866} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.5891, y: 0.5891, z: 0.5891} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8542547938941702394} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &4981385064428574191 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6381745134922277866} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 1 + m_Sprite: {fileID: 21300000, guid: 907b71767b1995a4f9a64504b433b677, type: 3} + m_Color: {r: 0.7095581, g: 1, b: 0.6933962, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 0.64, y: 0.64} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 --- !u!1 &7936748616974166139 GameObject: m_ObjectHideFlags: 0 @@ -178,6 +262,7 @@ GameObject: m_Component: - component: {fileID: 8542547938941702394} - component: {fileID: 2735182614490058971} + - component: {fileID: 1105561311855982232} m_Layer: 0 m_Name: tsunami_fort3 m_TagString: Untagged @@ -200,6 +285,7 @@ Transform: m_Children: - {fileID: 2658749105616281707} - {fileID: 5355989086010217210} + - {fileID: 3089387358181031060} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!212 &2735182614490058971 @@ -242,7 +328,7 @@ SpriteRenderer: m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingLayer: 0 - m_SortingOrder: 0 + m_SortingOrder: 1 m_Sprite: {fileID: 21300000, guid: f9223e599baf60042895eac536504745, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 @@ -254,3 +340,25 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!114 &1105561311855982232 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8302654837601584078} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0e77f2e277d814d43bfb9b604c6653cc, type: 3} + m_Name: + m_EditorClassIdentifier: + messageOfConstruction: + x: 0 + y: 0 + hp: 0 + constructionType: 3 + playerTeam: 0 + constructed: 0 + constructionData: {fileID: 11400000, guid: c2ad340d1afc39741b0599c59d436b15, type: 2} + repairIcon: {fileID: 0} + repairIconRotateAngle: 30 diff --git a/interface/interface_local/Assets/Resources/UI/Repair.aseprite b/interface/interface_local/Assets/Resources/UI/Repair.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..db4e43076ca70e8831c4109da5dd4314433f186e GIT binary patch literal 732 zcmcJM-%C?b9Kg@2%^oh{Q=|}HB*TZI>llelm?`~0E6WE(j9SetHkeUFSdoi<82GXt zVlij6mxy%w6cfTqh+Yh}%|x7{1zJPqFc}QoZnw`?k^ey7!~JmX*~8~^cIUSU@#VQr z)Uafs6GF7}{2R`4hoX@6KjsYnjUW2FRgYjNPl23QZqmir7s>LUlafup-+uD1%TeAEFOoCjc2!yag?u7VcJRj63+ zz_yOB&=%0(x$!0VaV`rrMu@=RFud3G06JYR*xK9#uhsUzkkJTdTWoOV=4hBmsm>4q>(`CNTZ7=ipa^eXc`qH;75)bElz~kP?h9N z@>ckFNDu|$`1$MhD{{pYFM3&s?JSLt@_Q7ah|a#%=%F3A<-)qtNsm)9Uy!7F^X|T( zvh2lj`$){a{&H!hec_gGTw3wPRd*ya_tUzT44fGBET8?5w!K-54t>%-Tiq?DPXu-!B=*}5*v*--aTR& z8%-SDRhsfn^rzb<28u)9{i}`Xcj}9NHSu)%$-*;3cAq-d9aq(p%KUKDqnoLH_3am& CDf2!6 literal 0 HcmV?d00001 diff --git a/interface/interface_local/Assets/Resources/UI/Repair.aseprite.meta b/interface/interface_local/Assets/Resources/UI/Repair.aseprite.meta new file mode 100644 index 00000000..6edf172c --- /dev/null +++ b/interface/interface_local/Assets/Resources/UI/Repair.aseprite.meta @@ -0,0 +1,164 @@ +fileFormatVersion: 2 +guid: 7e63984d712c1454197ff22ab4439c4c +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 62a9f0aa5b59740cfbadc7e5f9823bb0, type: 3} + textureImporterSettings: + alphaSource: 1 + mipMapMode: 0 + enableMipMap: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + convertToNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + swizzle: 50462976 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + nPOTScale: 1 + sRGBTexture: 1 + spriteMode: 2 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 0 + flipbookColumns: 0 + ignorePngGamma: 0 + cookieMode: 0 + filterMode: 0 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + normalMap: 0 + textureFormat: 0 + maxTextureSize: 0 + lightmap: 0 + compressionQuality: 0 + linearTexture: 0 + grayScaleToAlpha: 0 + rGBM: 0 + cubemapConvolutionSteps: 0 + cubemapConvolutionExponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + previousAsepriteImporterSettings: + fileImportMode: 1 + importHiddenLayers: 0 + layerImportMode: 1 + defaultPivotSpace: 0 + defaultPivotAlignment: 7 + customPivotPosition: {x: 0.5, y: 0.5} + spritePadding: 0 + generateModelPrefab: 1 + generateAnimationClips: 1 + addSortingGroup: 1 + addShadowCasters: 0 + asepriteImporterSettings: + fileImportMode: 1 + importHiddenLayers: 0 + layerImportMode: 1 + defaultPivotSpace: 0 + defaultPivotAlignment: 7 + customPivotPosition: {x: 0.5, y: 0.5} + spritePadding: 0 + generateModelPrefab: 1 + generateAnimationClips: 1 + addSortingGroup: 1 + addShadowCasters: 0 + importFileNodeState: 1 + platformSettingsDirtyTick: 0 + textureAssetName: + singleSpriteImportData: + - name: + originalName: + pivot: {x: 0, y: 0} + alignment: 0 + border: {x: 0, y: 0, z: 0, w: 0} + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + spriteID: + spriteBone: [] + spriteOutline: [] + vertices: [] + spritePhysicsOutline: [] + indices: + edges: [] + tessellationDetail: 0 + uvTransform: {x: 0, y: 0} + animatedSpriteImportData: + - name: Repair + originalName: + pivot: {x: 0.5, y: -0.16666667} + alignment: 9 + border: {x: 0, y: 0, z: 0, w: 0} + rect: + serializedVersion: 2 + x: 4 + y: 4 + width: 48 + height: 48 + spriteID: 2f1abb60d54c6af4dbeeeb800e4ff191 + spriteBone: [] + spriteOutline: [] + vertices: [] + spritePhysicsOutline: [] + indices: + edges: [] + tessellationDetail: 0 + uvTransform: {x: 4, y: 4} + spriteSheetImportData: [] + asepriteLayers: + - layerIndex: 0 + guid: 42772649 + name: Repair + layerFlags: 0 + layerType: 0 + blendMode: 0 + cells: + - name: Repair + frameIndex: 0 + cellRect: + x: 8 + y: 8 + width: 48 + height: 48 + spriteId: 2f1abb60d54c6af4dbeeeb800e4ff191 + linkedCells: [] + parentIndex: -1 + platformSettings: [] + secondarySpriteTextures: [] + spritePackingTag: + canvasSize: {x: 64, y: 64} diff --git a/interface/interface_local/Assets/Resources/UI/Repair.png b/interface/interface_local/Assets/Resources/UI/Repair.png new file mode 100644 index 0000000000000000000000000000000000000000..1722bd65f3dfdc25406fdae08d6b29435bed5abb GIT binary patch literal 419 zcmV;U0bKrxP)Px$T}ebiRCt{2n!yr+FbqV4!mR+|Ua^6C!}|&Uy)5xTh4@WQCRhTW}t<2aGOg zJD$P3*D>MFfRTub!JAE#KrhfM!Lx}P3g~TY=OEYuy2^d_ht&gr0yzbkTWtEV6<}x0Y={-1G69st)$!L4MG9b?aOz#h14?`>x;EO=-3Gl~ZbSA(B znCTxOGs8)s5irZPGyD6}0?vVt-eA3hO2Cyn*}HZo6Q~4u`4s5Yl7ROCuVjCAS26=4 zDJLMhbEGQ)v)r%E%4NWls7xp;APUM7IJ5dxpcl}i`X~BA2qA>v-~rG~q((3_;5h&Q N002ovPDHLkV1icKu+9Jg literal 0 HcmV?d00001 diff --git a/interface/interface_local/Assets/Resources/UI/Repair.png.meta b/interface/interface_local/Assets/Resources/UI/Repair.png.meta new file mode 100644 index 00000000..dc324541 --- /dev/null +++ b/interface/interface_local/Assets/Resources/UI/Repair.png.meta @@ -0,0 +1,166 @@ +fileFormatVersion: 2 +guid: 907b71767b1995a4f9a64504b433b677 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scenes/Game.unity b/interface/interface_local/Assets/Scenes/Game.unity index d7dd9ae1..368e873a 100644 --- a/interface/interface_local/Assets/Scenes/Game.unity +++ b/interface/interface_local/Assets/Scenes/Game.unity @@ -1125,7 +1125,11 @@ MonoBehaviour: - {fileID: 7049118564761611801, guid: e0c55c5797964e045ad780dd1868169b, type: 3} - {fileID: 5671706578558220722, guid: 9347cf63de3b0c242bac7ee29562d5dd, type: 3} - {fileID: 6742644745694519620, guid: a2185ad8f0eb43249b555bda1913c662, type: 3} - - {fileID: 0} + - {fileID: 5671706578558220722, guid: afe69842439154b428512871bfc3db8a, type: 3} + constructionList: + - {fileID: 6257076823173944538, guid: f0f5b7271131c0f4b97b109570925eb9, type: 3} + - {fileID: 6520154078847335470, guid: 3ca3df56b82e8484ca02de1e96d8cef9, type: 3} + - {fileID: 8302654837601584078, guid: ab06c719504fda3449d4df06ab5693cc, type: 3} mapfa: {fileID: 0} --- !u!4 &921343770 Transform: @@ -1182,9 +1186,16 @@ MonoBehaviour: producer1Data: {fileID: 11400000, guid: 2a0b9ed3d44383c4dbb629c824bbef69, type: 2} producer2Data: {fileID: 11400000, guid: d0ab6cc0b56e16d4f9e73093109cde7a, type: 2} producer3Data: {fileID: 11400000, guid: f13b23f24946f3648bae0bba52db7c15, type: 2} + constructor1Data: {fileID: 11400000, guid: cf6e3784845a5534ebd54d001c9b2d36, type: 2} + constructor2Data: {fileID: 11400000, guid: 2d9503656a8857641a24764cbf85594f, type: 2} + constructor3Data: {fileID: 11400000, guid: d5e72419adeeb7e4586aa9cccedd8839, type: 2} civilShipData: {fileID: 11400000, guid: 9fe1f9c27065b8f469ce5ee64ae7ef2c, type: 2} militaryShipData: {fileID: 11400000, guid: eff4f0dc7669fd1469463e3bff5104a8, type: 2} flagShipData: {fileID: 11400000, guid: 9a89d808d3c0a8a489972c9bc6edb515, type: 2} + factoryData: {fileID: 11400000, guid: 54c9136022665164c9024a91f2c26b1b, type: 2} + communitytData: {fileID: 11400000, guid: 69ca601dd1cfbf8438c108e04c5ba59a, type: 2} + fortData: {fileID: 11400000, guid: c2ad340d1afc39741b0599c59d436b15, type: 2} + baseData: {fileID: 11400000, guid: 53955729635aa9847955fcce1133fe93, type: 2} Team0Color: - color: {r: 1, g: 0.027672624, b: 0, a: 0} idensity: 1.94 @@ -1203,7 +1214,11 @@ MonoBehaviour: LaserColor: - color: {r: 1, g: 0.40633562, b: 0, a: 0} idensity: 1.47 + - color: {r: 0.39488173, g: 0, b: 1, a: 0} + idensity: 1.47 PlasmaColor: + - color: {r: 0.77393425, g: 1, b: 0, a: 0} + idensity: 1.28 - color: {r: 0, g: 0.7693863, b: 1, a: 0} idensity: 1.28 --- !u!1 &1084531560 @@ -1830,7 +1845,7 @@ Transform: m_GameObject: {fileID: 1601661171} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 6.8075633, y: 8.127505, z: -0.09265785} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -1866,6 +1881,10 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: resource: [] + emptyConstruction: [] + community: [] + factory: [] + fort: [] --- !u!1 &1602801899 GameObject: m_ObjectHideFlags: 0 diff --git a/interface/interface_local/Assets/Scripts/Base/BaseControl.cs b/interface/interface_local/Assets/Scripts/Base/BaseControl.cs index 8bbfc1d9..e9aacf3a 100644 --- a/interface/interface_local/Assets/Scripts/Base/BaseControl.cs +++ b/interface/interface_local/Assets/Scripts/Base/BaseControl.cs @@ -1,5 +1,6 @@ using System.Collections; using System.Collections.Generic; +using UnityEditor.Build.Content; using UnityEngine; public class BaseControl : MonoBehaviour @@ -15,9 +16,40 @@ void Start() interactBase = GetComponent(); generatePos[0] = transform.Find("GeneratePosition1").position; generatePos[1] = transform.Find("GeneratePosition2").position; - messageOfBase.economy = 400; + messageOfBase.economy = ParaDefine.GetInstance().baseData.initialEco; + messageOfBase.shipNum.civilShipNum = ParaDefine.GetInstance().baseData.initialShipNum.civilShipNum; + messageOfBase.shipNum.militaryShipNum = ParaDefine.GetInstance().baseData.initialShipNum.militaryShipNum; + messageOfBase.shipNum.flagShipNum = ParaDefine.GetInstance().baseData.initialShipNum.flagShipNum; + messageOfBase.shipTotalNum = messageOfBase.shipNum.civilShipNum + messageOfBase.shipNum.militaryShipNum + messageOfBase.shipNum.flagShipNum; + for (int i = 1; i <= messageOfBase.shipNum.civilShipNum; i++) + BuildCivil(); + for (int i = 1; i <= messageOfBase.shipNum.militaryShipNum; i++) + BuildMilitary(); + for (int i = 1; i <= messageOfBase.shipNum.flagShipNum; i++) + BuildFlag(); StartCoroutine(economyUpdate()); } + void BuildCivil() + { + obj = ObjCreater.GetInstance().CreateObj(ShipType.CIVILIAN_SHIP, generatePos[Tool.GetInstance().GetRandom(0, 2)]); + obj.GetComponent().messageOfShip.playerTeam = messageOfBase.playerTeam; + messageOfBase.shipNum.civilShipNum++; + messageOfBase.shipTotalNum++; + } + void BuildMilitary() + { + obj = ObjCreater.GetInstance().CreateObj(ShipType.MILITARY_SHIP, generatePos[Tool.GetInstance().GetRandom(0, 2)]); + obj.GetComponent().messageOfShip.playerTeam = messageOfBase.playerTeam; + messageOfBase.shipNum.militaryShipNum++; + messageOfBase.shipTotalNum++; + } + void BuildFlag() + { + obj = ObjCreater.GetInstance().CreateObj(ShipType.FLAG_SHIP, generatePos[Tool.GetInstance().GetRandom(0, 2)]); + obj.GetComponent().messageOfShip.playerTeam = messageOfBase.playerTeam; + messageOfBase.shipNum.flagShipNum++; + messageOfBase.shipTotalNum++; + } // Update is called once per frame void Update() @@ -25,24 +57,27 @@ void Update() switch (interactBase.interactOption) { case InteractControl.InteractOption.BuildCivil: - if (CostEconomy(ParaDefine.GetInstance().civilShipData.cost)) + if (messageOfBase.shipNum.civilShipNum < ParaDefine.GetInstance().baseData.maxShipNum.civilShipNum && + messageOfBase.shipTotalNum < ParaDefine.GetInstance().baseData.maxTotalShipNum && + CostEconomy(ParaDefine.GetInstance().civilShipData.cost)) { - obj = ObjCreater.GetInstance().CreateObj(ShipType.CIVILIAN_SHIP, generatePos[Tool.GetInstance().GetRandom(0, 2)]); - obj.GetComponent().messageOfShip.playerTeam = messageOfBase.playerTeam; + BuildCivil(); } break; case InteractControl.InteractOption.BuildMilitary: - if (CostEconomy(ParaDefine.GetInstance().militaryShipData.cost)) + if (messageOfBase.shipNum.militaryShipNum < ParaDefine.GetInstance().baseData.maxShipNum.militaryShipNum && + messageOfBase.shipTotalNum < ParaDefine.GetInstance().baseData.maxTotalShipNum && + CostEconomy(ParaDefine.GetInstance().militaryShipData.cost)) { - obj = ObjCreater.GetInstance().CreateObj(ShipType.MILITARY_SHIP, generatePos[Tool.GetInstance().GetRandom(0, 2)]); - obj.GetComponent().messageOfShip.playerTeam = messageOfBase.playerTeam; + BuildMilitary(); } break; case InteractControl.InteractOption.BuildFlag: - if (CostEconomy(ParaDefine.GetInstance().flagShipData.cost)) + if (messageOfBase.shipNum.flagShipNum < ParaDefine.GetInstance().baseData.maxShipNum.flagShipNum && + messageOfBase.shipTotalNum < ParaDefine.GetInstance().baseData.maxTotalShipNum && + CostEconomy(ParaDefine.GetInstance().flagShipData.cost)) { - obj = ObjCreater.GetInstance().CreateObj(ShipType.FLAG_SHIP, generatePos[Tool.GetInstance().GetRandom(0, 2)]); - obj.GetComponent().messageOfShip.playerTeam = messageOfBase.playerTeam; + BuildFlag(); } break; default: break; diff --git a/interface/interface_local/Assets/Scripts/Bullet/ArcTrailControl.cs b/interface/interface_local/Assets/Scripts/Bullet/ArcTrailControl.cs new file mode 100644 index 00000000..4278ad64 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Bullet/ArcTrailControl.cs @@ -0,0 +1,36 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class ArcTrailControl : MonoBehaviour +{ + TrailRenderer trailRenderer; + public float NoiseScale, OffsetScale; + // Start is called before the first frame update + void Start() + { + trailRenderer = GetComponent(); + } + + // Update is called once per frame + void Update() + { + for (int i = 0; i <= trailRenderer.positionCount - 1; i++) + { + var pointPosition = trailRenderer.GetPosition(i); + + var sTime = Time.timeSinceLevelLoad * 0.2f;//防止重复播放时noise重复 + + float xCoord = pointPosition.x * NoiseScale + sTime; + float yCoord = pointPosition.y * NoiseScale + sTime; + float zCoord = pointPosition.z * NoiseScale + sTime; + + //越接近尾端的point的位移会越大* (_lineRenderer.positionCount - 1 - i),来近似烟雾飘散的感觉 + pointPosition.x += (Mathf.PerlinNoise(yCoord, zCoord) - 0.5f) * OffsetScale;// * (trailRenderer.positionCount - 1 - i); + pointPosition.y += (Mathf.PerlinNoise(xCoord, zCoord) - 0.5f) * OffsetScale;// * (trailRenderer.positionCount - 1 - i); + pointPosition.z += (Mathf.PerlinNoise(xCoord, yCoord) - 0.5f) * OffsetScale;// * (trailRenderer.positionCount - 1 - i); + + trailRenderer.SetPosition(i, pointPosition); + } + } +} diff --git a/interface/interface_local/Assets/Scripts/Bullet/ArcTrailControl.cs.meta b/interface/interface_local/Assets/Scripts/Bullet/ArcTrailControl.cs.meta new file mode 100644 index 00000000..c03bd930 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Bullet/ArcTrailControl.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d9f00ebba21f7154aaccdeeba4130bc0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Construction/ConstructionControl.cs b/interface/interface_local/Assets/Scripts/Construction/ConstructionControl.cs new file mode 100644 index 00000000..55d8fd34 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Construction/ConstructionControl.cs @@ -0,0 +1,97 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEditor.ShaderGraph.Internal; +using UnityEngine; + +public class ConstructionControl : MonoBehaviour +{ + public MessageOfConstruction messageOfConstruction; + public ConstructionData constructionData; + public GameObject repairIcon; + public float iconRotateAngle, iconRotateTime; + public int constructing; + float constructCD; + // Start is called before the first frame update + void Start() + { + repairIcon = transform.Find("RepairIcon").gameObject; + } + + // Update is called once per frame + void Update() + { + constructCD -= Time.deltaTime; + if (constructCD < 0) + constructCD = 0; + if (messageOfConstruction.hp == constructionData.hpMax && !messageOfConstruction.constructed) + { + messageOfConstruction.constructed = true; + StartCoroutine(ProduceIE(constructionData.economyProduceSpeed)); + } + if (messageOfConstruction.hp < constructionData.hpMax / 2 && messageOfConstruction.constructed) + { + messageOfConstruction.constructed = false; + } + } + IEnumerator ProduceIE(int economy) + { + while (messageOfConstruction.constructed) + { + MapControl.GetInstance().bases[(int)messageOfConstruction.playerTeam].AddEconomy(economy); + yield return new WaitForSeconds(1); + } + } + public void Construct(int constructAmount) + { + if (constructCD != 0) + return; + constructCD = 1f; + messageOfConstruction.hp += constructAmount; + if (messageOfConstruction.hp > constructionData.hpMax) + { + messageOfConstruction.hp = constructionData.hpMax; + } + else + { + if (!repairIcon.activeInHierarchy) + repairIcon.SetActive(true); + constructing++; + StartCoroutine(RotateRepairIcon()); + } + } + IEnumerator RotateRepairIcon() + { + float timer = 0; + while (timer < iconRotateTime / 4) + { + timer += Time.deltaTime; + repairIcon.transform.localRotation = Quaternion.Euler(0, 0, iconRotateAngle * timer * 4 / iconRotateTime); + yield return null; + } + while (timer < 3 * iconRotateTime / 4) + { + timer += Time.deltaTime; + repairIcon.transform.localRotation = Quaternion.Euler(0, 0, 2 * iconRotateAngle - iconRotateAngle * timer * 4 / iconRotateTime); + yield return null; + } + while (timer < iconRotateTime) + { + timer += Time.deltaTime; + repairIcon.transform.localRotation = Quaternion.Euler(0, 0, -4 * iconRotateAngle + iconRotateAngle * timer * 4 / iconRotateTime); + yield return null; + } + yield return new WaitForSeconds(1f); + constructing--; + if (constructing == 0) + repairIcon.SetActive(false); + } + public void Damage(int damageAmount) + { + messageOfConstruction.hp -= damageAmount; + if (messageOfConstruction.hp < 0) + messageOfConstruction.hp = 0; + PlaceManager.GetInstance().emptyConstruction.Add(new Vector2(messageOfConstruction.x, messageOfConstruction.y)); + PlaceManager.GetInstance().factory.Remove(this); + Destroy(gameObject); + } +} diff --git a/interface/interface_local/Assets/Scripts/Construction/ConstructionControl.cs.meta b/interface/interface_local/Assets/Scripts/Construction/ConstructionControl.cs.meta new file mode 100644 index 00000000..da25ec01 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Construction/ConstructionControl.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0e77f2e277d814d43bfb9b604c6653cc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Data/BaseData.meta b/interface/interface_local/Assets/Scripts/Data/BaseData.meta new file mode 100644 index 00000000..5370917d --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/BaseData.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c71aa10434e303d4fa7ca50168f6923d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Data/BaseData/BaseData.asset b/interface/interface_local/Assets/Scripts/Data/BaseData/BaseData.asset new file mode 100644 index 00000000..94223317 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/BaseData/BaseData.asset @@ -0,0 +1,24 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c3fccf85858e7d04cb05b8405220282d, type: 3} + m_Name: BaseData + m_EditorClassIdentifier: + maxShipNum: + civilShipNum: 2 + militaryShipNum: 2 + flagShipNum: 1 + initialShipNum: + civilShipNum: 0 + militaryShipNum: 0 + flagShipNum: 0 + maxTotalShipNum: 4 + initialEco: 400 diff --git a/interface/interface_local/Assets/Scripts/Data/BaseData/BaseData.asset.meta b/interface/interface_local/Assets/Scripts/Data/BaseData/BaseData.asset.meta new file mode 100644 index 00000000..b3110fd4 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/BaseData/BaseData.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 53955729635aa9847955fcce1133fe93 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Data/BaseData/BaseData.cs b/interface/interface_local/Assets/Scripts/Data/BaseData/BaseData.cs new file mode 100644 index 00000000..23eae86b --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/BaseData/BaseData.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +[CreateAssetMenu(fileName = "BaseData", menuName = "GameData/BaseData", order = 0)] +public class BaseData : ScriptableObject +{ + public ShipDic maxShipNum; + public ShipDic initialShipNum; + public int maxTotalShipNum; + public int initialEco; +} diff --git a/interface/interface_local/Assets/Scripts/Data/BaseData/BaseData.cs.meta b/interface/interface_local/Assets/Scripts/Data/BaseData/BaseData.cs.meta new file mode 100644 index 00000000..5d2bdadf --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/BaseData/BaseData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c3fccf85858e7d04cb05b8405220282d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Data/BulletData/LaserData.asset b/interface/interface_local/Assets/Scripts/Data/BulletData/LaserData.asset index f95fe15b..7d289ed3 100644 --- a/interface/interface_local/Assets/Scripts/Data/BulletData/LaserData.asset +++ b/interface/interface_local/Assets/Scripts/Data/BulletData/LaserData.asset @@ -13,7 +13,7 @@ MonoBehaviour: m_Name: LaserData m_EditorClassIdentifier: cost: 1000 - attackDistance: 8 + attackDistance: 4 explosionRange: 0 attackDamage: b0040000 armorDamageMultiplier: 1.5 diff --git a/interface/interface_local/Assets/Scripts/Data/ConstructionData.meta b/interface/interface_local/Assets/Scripts/Data/ConstructionData.meta new file mode 100644 index 00000000..cda41714 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ConstructionData.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 76f0756bae2c0674e8a251b5e33add10 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Data/ConstructionData/CommunityData.asset b/interface/interface_local/Assets/Scripts/Data/ConstructionData/CommunityData.asset new file mode 100644 index 00000000..2963f381 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ConstructionData/CommunityData.asset @@ -0,0 +1,19 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3ae4f7c5f3ac6464d8f1a4b20ba16535, type: 3} + m_Name: CommunityData + m_EditorClassIdentifier: + hpMax: 6000 + economyProduceSpeed: 0 + recoverPointNum: 1 + attackRange: 0 + attackDamage: 0 diff --git a/interface/interface_local/Assets/Scripts/Data/ConstructionData/CommunityData.asset.meta b/interface/interface_local/Assets/Scripts/Data/ConstructionData/CommunityData.asset.meta new file mode 100644 index 00000000..2ae7a004 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ConstructionData/CommunityData.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 69ca601dd1cfbf8438c108e04c5ba59a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Data/ConstructionData/ConstructionData.cs b/interface/interface_local/Assets/Scripts/Data/ConstructionData/ConstructionData.cs new file mode 100644 index 00000000..915aaee2 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ConstructionData/ConstructionData.cs @@ -0,0 +1,13 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +[CreateAssetMenu(fileName = "ConstructionData", menuName = "GameData/ConstructionData", order = 0)] +public class ConstructionData : ScriptableObject +{ + public int hpMax; + public int economyProduceSpeed; + public int recoverPointNum; + public float attackRange; + public int attackDamage; +} diff --git a/interface/interface_local/Assets/Scripts/Data/ConstructionData/ConstructionData.cs.meta b/interface/interface_local/Assets/Scripts/Data/ConstructionData/ConstructionData.cs.meta new file mode 100644 index 00000000..a315ad99 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ConstructionData/ConstructionData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3ae4f7c5f3ac6464d8f1a4b20ba16535 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Data/ConstructionData/FactoryData.asset b/interface/interface_local/Assets/Scripts/Data/ConstructionData/FactoryData.asset new file mode 100644 index 00000000..df359bb9 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ConstructionData/FactoryData.asset @@ -0,0 +1,19 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3ae4f7c5f3ac6464d8f1a4b20ba16535, type: 3} + m_Name: FactoryData + m_EditorClassIdentifier: + hpMax: 8000 + economyProduceSpeed: 50 + recoverPointNum: 0 + attackRange: 0 + attackDamage: 0 diff --git a/interface/interface_local/Assets/Scripts/Data/ConstructionData/FactoryData.asset.meta b/interface/interface_local/Assets/Scripts/Data/ConstructionData/FactoryData.asset.meta new file mode 100644 index 00000000..19c74b40 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ConstructionData/FactoryData.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 54c9136022665164c9024a91f2c26b1b +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Data/ConstructionData/FortData.asset b/interface/interface_local/Assets/Scripts/Data/ConstructionData/FortData.asset new file mode 100644 index 00000000..82f7f0dc --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ConstructionData/FortData.asset @@ -0,0 +1,19 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3ae4f7c5f3ac6464d8f1a4b20ba16535, type: 3} + m_Name: FortData + m_EditorClassIdentifier: + hpMax: 12000 + economyProduceSpeed: 0 + recoverPointNum: 0 + attackRange: 8 + attackDamage: 1200 diff --git a/interface/interface_local/Assets/Scripts/Data/ConstructionData/FortData.asset.meta b/interface/interface_local/Assets/Scripts/Data/ConstructionData/FortData.asset.meta new file mode 100644 index 00000000..e594500d --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ConstructionData/FortData.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c2ad340d1afc39741b0599c59d436b15 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Data/ConstructorData.meta b/interface/interface_local/Assets/Scripts/Data/ConstructorData.meta new file mode 100644 index 00000000..47710ce8 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ConstructorData.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: aa189bf87ff1845428f333f51abed9d2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor1Data.asset b/interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor1Data.asset new file mode 100644 index 00000000..1e7c4437 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor1Data.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e34c0ff69dda57044bf88a9998dbcc6f, type: 3} + m_Name: Constructor1Data + m_EditorClassIdentifier: + cost: 0 + constructSpeed: 300 diff --git a/interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor1Data.asset.meta b/interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor1Data.asset.meta new file mode 100644 index 00000000..8e63b4e3 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor1Data.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cf6e3784845a5534ebd54d001c9b2d36 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor2Data.asset b/interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor2Data.asset new file mode 100644 index 00000000..793c1380 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor2Data.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e34c0ff69dda57044bf88a9998dbcc6f, type: 3} + m_Name: Constructor2Data + m_EditorClassIdentifier: + cost: 400 + constructSpeed: 400 diff --git a/interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor2Data.asset.meta b/interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor2Data.asset.meta new file mode 100644 index 00000000..7239a378 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor2Data.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2d9503656a8857641a24764cbf85594f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor3Data.asset b/interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor3Data.asset new file mode 100644 index 00000000..ea8f308b --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor3Data.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e34c0ff69dda57044bf88a9998dbcc6f, type: 3} + m_Name: Constructor3Data + m_EditorClassIdentifier: + cost: 800 + constructSpeed: 500 diff --git a/interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor3Data.asset.meta b/interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor3Data.asset.meta new file mode 100644 index 00000000..26afa79f --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ConstructorData/Constructor3Data.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d5e72419adeeb7e4586aa9cccedd8839 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Data/ConstructorData/ConstructorData.cs b/interface/interface_local/Assets/Scripts/Data/ConstructorData/ConstructorData.cs new file mode 100644 index 00000000..210c96b0 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ConstructorData/ConstructorData.cs @@ -0,0 +1,10 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +[CreateAssetMenu(fileName = "ConstructorData", menuName = "GameData/ConstructorData", order = 0)] +public class ConstructorData : ScriptableObject +{ + public int cost; + public int constructSpeed; +} diff --git a/interface/interface_local/Assets/Scripts/Data/ConstructorData/ConstructorData.cs.meta b/interface/interface_local/Assets/Scripts/Data/ConstructorData/ConstructorData.cs.meta new file mode 100644 index 00000000..890c2eb0 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ConstructorData/ConstructorData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e34c0ff69dda57044bf88a9998dbcc6f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/InteractBase/InteractBase.cs b/interface/interface_local/Assets/Scripts/InteractBase/InteractBase.cs index 128ded0a..915235b0 100644 --- a/interface/interface_local/Assets/Scripts/InteractBase/InteractBase.cs +++ b/interface/interface_local/Assets/Scripts/InteractBase/InteractBase.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; +using Unity.VisualScripting; using UnityEngine; public class InteractBase : MonoBehaviour @@ -33,5 +34,9 @@ void Update() if (seObj) Destroy(seObj); } + if (tobeseObj) + tobeseObj.transform.rotation = Quaternion.Euler(0, 0, 0); + if (seObj) + seObj.transform.rotation = Quaternion.Euler(0, 0, 0); } } \ No newline at end of file diff --git a/interface/interface_local/Assets/Scripts/Map/MapControl.cs b/interface/interface_local/Assets/Scripts/Map/MapControl.cs index e1ddbcba..13977009 100644 --- a/interface/interface_local/Assets/Scripts/Map/MapControl.cs +++ b/interface/interface_local/Assets/Scripts/Map/MapControl.cs @@ -24,15 +24,17 @@ void DrawMap(uint[,] map) switch ((PlaceType)map[i, j]) { case PlaceType.HOME: - if (!bases[0]) + if (!bases[1]) { - bases[0] = ObjCreater.GetInstance().CreateObj(PlaceType.HOME, new Vector2(j, 50 - i)).GetComponent(); - bases[0].name = "Base1"; + bases[1] = ObjCreater.GetInstance().CreateObj(PlaceType.HOME, new Vector2(j, 50 - i)).GetComponent(); + bases[1].name = "Base2"; + bases[1].transform.SetParent(null); } else { - bases[1] = ObjCreater.GetInstance().CreateObj(PlaceType.HOME, new Vector2(j, 50 - i)).GetComponent(); - bases[1].name = "Base2"; + bases[0] = ObjCreater.GetInstance().CreateObj(PlaceType.HOME, new Vector2(j, 50 - i)).GetComponent(); + bases[0].name = "Base1"; + bases[0].transform.SetParent(null); } break; case PlaceType.RESOURCE: @@ -44,14 +46,18 @@ void DrawMap(uint[,] map) wormholeFlip ? Quaternion.Euler(0, 0, 180) : Quaternion.identity); wormholeFlip = !wormholeFlip; break; + case PlaceType.CONSTRUCTION: + obj = ObjCreater.GetInstance().CreateObj(PlaceType.CONSTRUCTION, new Vector2(j, 50 - i)); + PlaceManager.GetInstance().emptyConstruction.Add(new Vector2(j, 50 - i)); + break; default: ObjCreater.GetInstance().CreateObj((PlaceType)map[i, j], new Vector2(j, 50 - i)); break; } } } - bases[0].messageOfBase.playerTeam = PlayerTeam.BLUE; - bases[1].messageOfBase.playerTeam = PlayerTeam.RED; + bases[0].messageOfBase.playerTeam = PlayerTeam.RED; + bases[1].messageOfBase.playerTeam = PlayerTeam.BLUE; } // Update is called once per frame void Update() diff --git a/interface/interface_local/Assets/Scripts/Message2Clients.cs b/interface/interface_local/Assets/Scripts/Message2Clients.cs index cce85500..16815330 100644 --- a/interface/interface_local/Assets/Scripts/Message2Clients.cs +++ b/interface/interface_local/Assets/Scripts/Message2Clients.cs @@ -1,3 +1,4 @@ +using System; using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -37,29 +38,15 @@ public struct MessageOfBullet // public double bombRange; // public int speed; } - -public struct MessageOfFactory -{ - int x; - int y; - int hp; // 剩余的血量 - int team_id; -} - -public struct MessageOfCommunity -{ - int x; - int y; - int hp; // 剩余的血量 - int team_id; -} - -public struct MessageOfFort +[Serializable] +public struct MessageOfConstruction { - int x; - int y; - int hp; // 剩余的血量 - int team_id; + public int x; + public int y; + public int hp; // 剩余的血量 + public ConstructionType constructionType; + public PlayerTeam playerTeam; + public bool constructed; } public struct MessageOfWormhole @@ -83,6 +70,8 @@ public struct MessageOfBase public int hp; public int economy; public PlayerTeam playerTeam; + public ShipDic shipNum; + public int shipTotalNum; } public struct MessageOfMap diff --git a/interface/interface_local/Assets/Scripts/MessageType.cs b/interface/interface_local/Assets/Scripts/MessageType.cs index 73b442c5..cd92bf3a 100644 --- a/interface/interface_local/Assets/Scripts/MessageType.cs +++ b/interface/interface_local/Assets/Scripts/MessageType.cs @@ -1,3 +1,4 @@ +using System; using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -36,7 +37,7 @@ public enum PlayerType SHIP, TEAM, } - +[Serializable] public enum ShipType { NULL_SHIP_TYPE, diff --git a/interface/interface_local/Assets/Scripts/ObjCreater.cs b/interface/interface_local/Assets/Scripts/ObjCreater.cs index bc12f55b..f0a4e43d 100644 --- a/interface/interface_local/Assets/Scripts/ObjCreater.cs +++ b/interface/interface_local/Assets/Scripts/ObjCreater.cs @@ -6,7 +6,7 @@ public class ObjCreater : SingletonMono { - public GameObject[] placeList, shiplist, bulletList; + public GameObject[] placeList, shiplist, bulletList, constructionList; public Transform mapfa; public GameObject CreateObj(PlaceType placeType, Vector2 Pos, Quaternion? quaternion = null) { @@ -95,6 +95,29 @@ public GameObject CreateObj(BulletType bulletType, Vector2 Pos, Quaternion quate return null; } } + public GameObject CreateObj(ConstructionType constructionType, Vector2 Pos) + { + { + switch (constructionType) + { + case ConstructionType.FACTORY: + if (bulletList[0]) + return Instantiate(constructionList[0], Pos, Quaternion.identity); + break; + case ConstructionType.COMMUNITY: + if (bulletList[1]) + return Instantiate(constructionList[1], Pos, Quaternion.identity); + break; + case ConstructionType.FORT: + if (bulletList[2]) + return Instantiate(constructionList[2], Pos, Quaternion.identity); + break; + default: + break; + } + return null; + } + } void Start() { mapfa = GameObject.Find("Map").transform; diff --git a/interface/interface_local/Assets/Scripts/ParaDefine.cs b/interface/interface_local/Assets/Scripts/ParaDefine.cs index a8e601a3..c3779c89 100644 --- a/interface/interface_local/Assets/Scripts/ParaDefine.cs +++ b/interface/interface_local/Assets/Scripts/ParaDefine.cs @@ -7,7 +7,10 @@ public class ParaDefine : SingletonMono { public BulletData laserData, plasmaData, shellData, missileData, arcData; public ProducerData producer1Data, producer2Data, producer3Data; + public ConstructorData constructor1Data, constructor2Data, constructor3Data; public ShipData civilShipData, militaryShipData, flagShipData; + public ConstructionData factoryData, communitytData, fortData; + public BaseData baseData; [Serializable] public class litColorSetting { @@ -23,3 +26,11 @@ public litColorSetting(Color _color, float _idensity) public litColorSetting[] ResourceColor; public litColorSetting[] LaserColor, PlasmaColor; } + +[Serializable] +public struct ShipDic +{ + public int civilShipNum; + public int militaryShipNum; + public int flagShipNum; +} \ No newline at end of file diff --git a/interface/interface_local/Assets/Scripts/Place/PlaceManager.cs b/interface/interface_local/Assets/Scripts/Place/PlaceManager.cs index a2879acc..b4e64d59 100644 --- a/interface/interface_local/Assets/Scripts/Place/PlaceManager.cs +++ b/interface/interface_local/Assets/Scripts/Place/PlaceManager.cs @@ -1,3 +1,4 @@ +using System; using System.Collections; using System.Collections.Generic; using UnityEditor.iOS; @@ -5,5 +6,6 @@ public class PlaceManager : SingletonMono { - public List resource; + public List resource, emptyConstruction; + public List community, factory, fort; } diff --git a/interface/interface_local/Assets/Scripts/Player/PlayerControl.cs b/interface/interface_local/Assets/Scripts/Player/PlayerControl.cs index 326045a3..427f157e 100644 --- a/interface/interface_local/Assets/Scripts/Player/PlayerControl.cs +++ b/interface/interface_local/Assets/Scripts/Player/PlayerControl.cs @@ -37,6 +37,8 @@ void testInput() { if (Input.GetKeyDown(KeyCode.P)) selectedOption = InteractControl.InteractOption.Produce; + if (Input.GetKeyDown(KeyCode.C)) + selectedOption = InteractControl.InteractOption.ConstructFactory; } void CheckInteract() { @@ -85,7 +87,7 @@ void CheckInteract() i.tobeSelected = false; } tobeSelectedInt.Clear(); - // Debug.Log("clear"); + // Debug.Log("clear" + tobeSelectedInt.Count); if (Input.GetMouseButtonDown(0) && !EventSystem.current.IsPointerOverGameObject()) { diff --git a/interface/interface_local/Assets/Scripts/RendererControl.cs b/interface/interface_local/Assets/Scripts/RendererControl.cs index db19764b..2b7fa3dd 100644 --- a/interface/interface_local/Assets/Scripts/RendererControl.cs +++ b/interface/interface_local/Assets/Scripts/RendererControl.cs @@ -106,7 +106,7 @@ public void SetColToChild(BulletType bulletType, PlayerTeam playerTeam, Transfor { case BulletType.LASER: CurrentRenderer = targetTransform.Find("mask1").GetComponent(); - Debug.Log("render bullet"); + // Debug.Log("render bullet"); if (CurrentRenderer) { CurrentRenderer.GetPropertyBlock(CurrentPropertyBlock); diff --git a/interface/interface_local/Assets/Scripts/Ship/ShipControl.cs b/interface/interface_local/Assets/Scripts/Ship/ShipControl.cs index 2d7da8ff..5bebc12d 100644 --- a/interface/interface_local/Assets/Scripts/Ship/ShipControl.cs +++ b/interface/interface_local/Assets/Scripts/Ship/ShipControl.cs @@ -13,6 +13,7 @@ public class ShipControl : MonoBehaviour float speed; private float targetQ; public MessageOfShip messageOfShip; + GameObject obj; void SetVQTo(Vector2 targetV) { if ((rb.velocity.normalized - targetV.normalized).magnitude < 1.5f || rb.velocity.magnitude < 0.1f) @@ -72,6 +73,32 @@ void Update() if (MapControl.GetInstance().bases[(int)messageOfShip.playerTeam].CostEconomy(ParaDefine.GetInstance().arcData.cost)) messageOfShip.weaponType = WeaponType.ARCGUN; break; + case InteractControl.InteractOption.ConstructFactory: + Debug.Log("choose to construct factory"); + for (int i = 0; i < PlaceManager.GetInstance().emptyConstruction.Count; i++) + { + if (Tool.GetInstance().CheckBeside(transform.position, PlaceManager.GetInstance().emptyConstruction[i])) + { + obj = ObjCreater.GetInstance().CreateObj(ConstructionType.FACTORY, + PlaceManager.GetInstance().emptyConstruction[i]); + obj.GetComponent().messageOfConstruction.playerTeam = messageOfShip.playerTeam; + obj.GetComponent().messageOfConstruction.x = (int)PlaceManager.GetInstance().emptyConstruction[i].x; + obj.GetComponent().messageOfConstruction.y = (int)PlaceManager.GetInstance().emptyConstruction[i].y; + PlaceManager.GetInstance().emptyConstruction.Remove(PlaceManager.GetInstance().emptyConstruction[i]); + PlaceManager.GetInstance().factory.Add(obj.GetComponent()); + } + } + foreach (ConstructionControl factory in PlaceManager.GetInstance().factory) + { + if (factory.messageOfConstruction.playerTeam == messageOfShip.playerTeam && + factory.messageOfConstruction.hp < ParaDefine.GetInstance().factoryData.hpMax && + Tool.GetInstance().CheckBeside(transform.position, new Vector2(factory.messageOfConstruction.x, factory.messageOfConstruction.y))) + { + if (messageOfShip.shipState != ShipState.CONSTRUCTING) + Construct(factory); + } + } + break; default: break; } @@ -96,9 +123,28 @@ void Produce() break; } } + void Construct(ConstructionControl construction) + { + { + switch (messageOfShip.constructorType) + { + case ConstructorType.CONSTRUCTOR1: + StartCoroutine(ConstructIE(construction, ParaDefine.GetInstance().constructor1Data.constructSpeed)); + break; + case ConstructorType.CONSTRUCTOR2: + StartCoroutine(ConstructIE(construction, ParaDefine.GetInstance().constructor2Data.constructSpeed)); + break; + case ConstructorType.CONSTRUCTOR3: + StartCoroutine(ConstructIE(construction, ParaDefine.GetInstance().constructor3Data.constructSpeed)); + break; + default: + break; + } + } + } IEnumerator ProduceIE(int economy) { - Debug.Log("try produce"); + // Debug.Log("try produce"); messageOfShip.shipState = ShipState.PRODUCING; while (messageOfShip.shipState == ShipState.PRODUCING) { @@ -106,6 +152,16 @@ IEnumerator ProduceIE(int economy) yield return new WaitForSeconds(1); } + } + IEnumerator ConstructIE(ConstructionControl construction, int constructSpeed) + { + messageOfShip.shipState = ShipState.CONSTRUCTING; + while (messageOfShip.shipState == ShipState.CONSTRUCTING) + { + construction.Construct(constructSpeed); + yield return new WaitForSeconds(1); + } + } void MoveTowards(Vector2 pos) { @@ -133,7 +189,6 @@ void AttackTowards(Vector2 pos) { messageOfShip.shipState = ShipState.ATTACKING; - GameObject obj; switch (messageOfShip.weaponType) { case WeaponType.LASERGUN: diff --git a/interface/interface_local/Assets/Scripts/Tool.cs b/interface/interface_local/Assets/Scripts/Tool.cs index 07d07986..70f6d7f4 100644 --- a/interface/interface_local/Assets/Scripts/Tool.cs +++ b/interface/interface_local/Assets/Scripts/Tool.cs @@ -13,9 +13,13 @@ public Vector2 GridToCell(Vector2 grid) { return new Vector2(50.5f - grid.y, 0.5f + grid.x); } + // public Vector2 CellToGrid(Vector2 cell) + // { + // return new Vector2(-0.5f + cell.y, 51.5f - cell.x); + // } public bool CheckBeside(Vector2 grid, Vector2 cell) { - if (Mathf.Abs(GridToCell(grid).x - cell.x) + Mathf.Abs(GridToCell(grid).y - cell.y) <= 2) + if (Mathf.Abs(grid.x - cell.x) + Mathf.Abs(grid.y - cell.y) <= 2) return true; return false; }