diff --git a/interface/interface_local/Assets/Prefabs/afflict_civilship3.prefab b/interface/interface_local/Assets/Prefabs/afflict_civilship3.prefab index 084d22fc..f4f469b5 100644 --- a/interface/interface_local/Assets/Prefabs/afflict_civilship3.prefab +++ b/interface/interface_local/Assets/Prefabs/afflict_civilship3.prefab @@ -184,7 +184,7 @@ GameObject: - component: {fileID: 5830000981015486441} m_Layer: 6 m_Name: afflict_civilship3 - m_TagString: Untagged + m_TagString: Ship m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -277,9 +277,10 @@ MonoBehaviour: armor: 0 shield: 0 playerTeam: 0 - shipType: 1 + shipState: 0 + shipType: 0 viewRange: 0 - producerType: 0 + producerType: 1 constructorType: 0 armorType: 0 shieldType: 0 @@ -306,6 +307,7 @@ MonoBehaviour: seObj: {fileID: 0} moveOption: {x: 0, y: 0} attackOption: {x: 0, y: 0} + enableMove: 0 --- !u!50 &-4359886877623418897 Rigidbody2D: serializedVersion: 4 diff --git a/interface/interface_local/Assets/Prefabs/disperse_militaryship3.prefab b/interface/interface_local/Assets/Prefabs/disperse_militaryship3.prefab index ab55ad0f..9fc8c495 100644 --- a/interface/interface_local/Assets/Prefabs/disperse_militaryship3.prefab +++ b/interface/interface_local/Assets/Prefabs/disperse_militaryship3.prefab @@ -16,7 +16,7 @@ GameObject: - component: {fileID: 5170778442484362911} m_Layer: 6 m_Name: disperse_militaryship3 - m_TagString: Untagged + m_TagString: Ship m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -109,7 +109,8 @@ MonoBehaviour: armor: 400 shield: 400 playerTeam: 0 - shipType: 2 + shipState: 0 + shipType: 0 viewRange: 0 producerType: 0 constructorType: 0 @@ -138,6 +139,7 @@ MonoBehaviour: seObj: {fileID: 0} moveOption: {x: 0, y: 0} attackOption: {x: 0, y: 0} + enableMove: 0 --- !u!50 &1666208417870257314 Rigidbody2D: serializedVersion: 4 diff --git a/interface/interface_local/Assets/Prefabs/foreshadow_flagship3.prefab b/interface/interface_local/Assets/Prefabs/foreshadow_flagship3.prefab index 27537911..7a46facf 100644 --- a/interface/interface_local/Assets/Prefabs/foreshadow_flagship3.prefab +++ b/interface/interface_local/Assets/Prefabs/foreshadow_flagship3.prefab @@ -184,7 +184,7 @@ GameObject: - component: {fileID: 7800904211505029374} m_Layer: 6 m_Name: foreshadow_flagship3 - m_TagString: Untagged + m_TagString: Ship m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -277,9 +277,10 @@ MonoBehaviour: armor: 800 shield: 800 playerTeam: 0 + shipState: 0 shipType: 3 viewRange: 0 - producerType: 0 + producerType: 1 constructorType: 0 armorType: 0 shieldType: 0 @@ -306,6 +307,7 @@ MonoBehaviour: seObj: {fileID: 0} moveOption: {x: 0, y: 0} attackOption: {x: 0, y: 0} + enableMove: 0 --- !u!50 &3397589707071195213 Rigidbody2D: serializedVersion: 4 diff --git a/interface/interface_local/Assets/Prefabs/laser.prefab b/interface/interface_local/Assets/Prefabs/laser.prefab index f7f3627b..77bdc4d0 100644 --- a/interface/interface_local/Assets/Prefabs/laser.prefab +++ b/interface/interface_local/Assets/Prefabs/laser.prefab @@ -95,9 +95,10 @@ GameObject: - component: {fileID: 1201941676677779376} - component: {fileID: 7532294776290804330} - component: {fileID: 4187446393248317159} + - component: {fileID: 1737824880196549920} m_Layer: 0 m_Name: laser - m_TagString: Untagged + m_TagString: Bullet m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -161,3 +162,48 @@ Rigidbody2D: m_SleepingMode: 1 m_CollisionDetection: 1 m_Constraints: 0 +--- !u!61 &1737824880196549920 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5236724725662676995} + 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.0000949204, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0, y: 0} + oldSize: {x: 0, y: 0} + newSize: {x: 0, y: 0} + adaptiveTilingThreshold: 0 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 0.18993536, y: 1} + m_EdgeRadius: 0 diff --git a/interface/interface_local/Assets/Prefabs/missile.prefab b/interface/interface_local/Assets/Prefabs/missile.prefab index 136695a7..f16563e0 100644 --- a/interface/interface_local/Assets/Prefabs/missile.prefab +++ b/interface/interface_local/Assets/Prefabs/missile.prefab @@ -11,9 +11,10 @@ GameObject: - component: {fileID: 4201782037208779027} - component: {fileID: -8537481700179265297} - component: {fileID: 787263036322237022} + - component: {fileID: 3497806888274562941} m_Layer: 0 m_Name: missile - m_TagString: Untagged + m_TagString: Bullet m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -77,6 +78,51 @@ Rigidbody2D: m_SleepingMode: 1 m_CollisionDetection: 1 m_Constraints: 0 +--- !u!61 &3497806888274562941 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6742644745694519620} + 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.00051154196, y: 0.062394217} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0, y: 0} + oldSize: {x: 0, y: 0} + newSize: {x: 0, y: 0} + adaptiveTilingThreshold: 0 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 0.31279585, y: 0.7504232} + m_EdgeRadius: 0 --- !u!1 &9211391338782469537 GameObject: m_ObjectHideFlags: 0 @@ -103,7 +149,7 @@ Transform: m_GameObject: {fileID: 9211391338782469537} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 1.2787311, y: -0.42751598, z: 0.1775014} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] diff --git a/interface/interface_local/Assets/Prefabs/plasma.prefab b/interface/interface_local/Assets/Prefabs/plasma.prefab index b7f97a8d..49fdce29 100644 --- a/interface/interface_local/Assets/Prefabs/plasma.prefab +++ b/interface/interface_local/Assets/Prefabs/plasma.prefab @@ -26,7 +26,7 @@ Transform: m_GameObject: {fileID: 6117473897745876090} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -0.04258275, y: -0.41616893, z: 0.1775014} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -95,9 +95,10 @@ GameObject: - component: {fileID: 3329987006929507500} - component: {fileID: 8590620219904582428} - component: {fileID: 1888889249344211522} + - component: {fileID: 4752681040706189447} m_Layer: 0 m_Name: plasma - m_TagString: Untagged + m_TagString: Bullet m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -161,3 +162,38 @@ Rigidbody2D: m_SleepingMode: 1 m_CollisionDetection: 1 m_Constraints: 0 +--- !u!70 &4752681040706189447 +CapsuleCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7049118564761611801} + 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.001422558, y: 0.01707118} + m_Size: {x: 0.24677815, y: 0.84636} + m_Direction: 0 diff --git a/interface/interface_local/Assets/Prefabs/shell.prefab b/interface/interface_local/Assets/Prefabs/shell.prefab index ac121ecb..989492c9 100644 --- a/interface/interface_local/Assets/Prefabs/shell.prefab +++ b/interface/interface_local/Assets/Prefabs/shell.prefab @@ -26,7 +26,7 @@ Transform: m_GameObject: {fileID: 3845175679092181272} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.43515015, y: -0.4198817, z: 0.1775014} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -95,9 +95,10 @@ GameObject: - component: {fileID: 116280945263292980} - component: {fileID: -8199526034595813093} - component: {fileID: 330809320193030683} + - component: {fileID: 4501115928246254698} m_Layer: 0 m_Name: shell - m_TagString: Untagged + m_TagString: Bullet m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -161,3 +162,38 @@ Rigidbody2D: 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.0011312403, y: 0} + serializedVersion: 2 + m_Radius: 0.18664187 diff --git a/interface/interface_local/Assets/Scenes/Game.unity b/interface/interface_local/Assets/Scenes/Game.unity index 8645362a..39636fb2 100644 --- a/interface/interface_local/Assets/Scenes/Game.unity +++ b/interface/interface_local/Assets/Scenes/Game.unity @@ -213,6 +213,81 @@ MonoBehaviour: m_OnValueChanged: m_PersistentCalls: m_Calls: [] +--- !u!1 &305738947 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 305738948} + - component: {fileID: 305738950} + - component: {fileID: 305738949} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &305738948 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 305738947} + 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: 1761859708} + 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: -16} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &305738949 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 305738947} + 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: b91089e8b9d77a14f9195e232cc2c94a, type: 3} + 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 &305738950 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 305738947} + m_CullTransparentMesh: 1 --- !u!1 &355944799 GameObject: m_ObjectHideFlags: 0 @@ -249,6 +324,81 @@ RectTransform: m_AnchoredPosition: {x: -0.03929901, y: -0.052000046} m_SizeDelta: {x: -5.7111, y: -20.8503} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &395670209 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 395670210} + - component: {fileID: 395670212} + - component: {fileID: 395670211} + m_Layer: 5 + m_Name: Fill + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &395670210 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 395670209} + 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: 1703667293} + 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: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &395670211 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 395670209} + 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: 564dfd8f106b7e245a56bc5ab6bc9375, type: 3} + 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 &395670212 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 395670209} + m_CullTransparentMesh: 1 --- !u!1 &396793515 GameObject: m_ObjectHideFlags: 0 @@ -561,6 +711,274 @@ MonoBehaviour: currentScale: 0.5 cameraSpeedMax: 1.5 cameraSpeed: 0 +--- !u!1 &574304080 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 574304083} + - component: {fileID: 574304082} + - component: {fileID: 574304081} + m_Layer: 5 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &574304081 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 574304080} + 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: New Text + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, 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: 7 + m_fontSizeBase: 7 + 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 &574304082 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 574304080} + m_CullTransparentMesh: 1 +--- !u!224 &574304083 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 574304080} + 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: 1761859708} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 75, y: 1.0008} + m_SizeDelta: {x: 142.61, y: 6.5635} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &844669861 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 844669864} + - component: {fileID: 844669863} + - component: {fileID: 844669862} + m_Layer: 5 + m_Name: Text (TMP) (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &844669862 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 844669861} + 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: 'Eco: 0' + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, 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: 13.42 + m_fontSizeBase: 13.42 + 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 &844669863 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 844669861} + m_CullTransparentMesh: 1 +--- !u!224 &844669864 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 844669861} + 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: 1698811764} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 378.12, y: -85.67} + m_SizeDelta: {x: 95.04, y: 20.14} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &921343768 GameObject: m_ObjectHideFlags: 0 @@ -664,6 +1082,12 @@ MonoBehaviour: shellData: {fileID: 11400000, guid: 23ccf6674696d814d953e27d4af902d0, type: 2} missileData: {fileID: 11400000, guid: bd428ee77f865f147835a80acdfd9fd2, type: 2} arcData: {fileID: 11400000, guid: 4758f2e9f24bebf45a9517cf2f743093, type: 2} + producer1Data: {fileID: 11400000, guid: 2a0b9ed3d44383c4dbb629c824bbef69, type: 2} + producer2Data: {fileID: 11400000, guid: d0ab6cc0b56e16d4f9e73093109cde7a, type: 2} + producer3Data: {fileID: 11400000, guid: f13b23f24946f3648bae0bba52db7c15, type: 2} + civilShipData: {fileID: 11400000, guid: 9fe1f9c27065b8f469ce5ee64ae7ef2c, type: 2} + militaryShipData: {fileID: 11400000, guid: eff4f0dc7669fd1469463e3bff5104a8, type: 2} + flagShipData: {fileID: 11400000, guid: 9a89d808d3c0a8a489972c9bc6edb515, type: 2} --- !u!1 &1084531560 GameObject: m_ObjectHideFlags: 0 @@ -1271,6 +1695,7 @@ GameObject: m_Component: - component: {fileID: 1601661172} - component: {fileID: 1601661173} + - component: {fileID: 1601661174} m_Layer: 0 m_Name: Map m_TagString: Untagged @@ -1309,6 +1734,19 @@ MonoBehaviour: bases: - {fileID: 0} - {fileID: 0} +--- !u!114 &1601661174 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1601661171} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6b49baa294e35794cbabcbc76e3fb73c, type: 3} + m_Name: + m_EditorClassIdentifier: + resource: [] --- !u!1 &1602801899 GameObject: m_ObjectHideFlags: 0 @@ -1740,7 +2178,9 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 285166698} + - {fileID: 1761859708} - {fileID: 1644358102} + - {fileID: 844669864} - {fileID: 1123546793} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -1761,9 +2201,48 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d71a5a3fcb548cc4f8bd3fda08aae5a5, type: 3} m_Name: m_EditorClassIdentifier: - healthSlider: {fileID: 285166699} - healthText: {fileID: 1751175915} - ecoText: {fileID: 1644358103} + healthSlider1: {fileID: 285166699} + healthSlider2: {fileID: 1761859709} + healthText1: {fileID: 1751175915} + healthText2: {fileID: 574304081} + ecoText1: {fileID: 1644358103} + ecoText2: {fileID: 844669862} +--- !u!1 &1703667292 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1703667293} + m_Layer: 5 + m_Name: Fill Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1703667293 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1703667292} + 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: 395670210} + m_Father: {fileID: 1761859708} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -0.03929901, y: -0.052000046} + m_SizeDelta: {x: -5.7111, y: -20.8503} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1751175913 GameObject: m_ObjectHideFlags: 0 @@ -1898,6 +2377,96 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1751175913} m_CullTransparentMesh: 1 +--- !u!1 &1761859707 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1761859708} + - component: {fileID: 1761859709} + m_Layer: 5 + m_Name: Slider (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1761859708 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1761859707} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1.8937306, y: 1.8937306, z: 1.8937306} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 305738948} + - {fileID: 1703667293} + - {fileID: 574304083} + m_Father: {fileID: 1698811764} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 468, y: -52.5} + m_SizeDelta: {x: 147.34991, y: 32.75128} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1761859709 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1761859707} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 67db9e8f0e2ae9c40bc1e2b64352a6b4, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 0} + m_FillRect: {fileID: 395670210} + m_HandleRect: {fileID: 0} + m_Direction: 0 + m_MinValue: 0 + m_MaxValue: 1 + m_WholeNumbers: 0 + m_Value: 0.243 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] --- !u!1 &1788440550 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 f32ae4a2..8bbfc1d9 100644 --- a/interface/interface_local/Assets/Scripts/Base/BaseControl.cs +++ b/interface/interface_local/Assets/Scripts/Base/BaseControl.cs @@ -15,6 +15,7 @@ void Start() interactBase = GetComponent(); generatePos[0] = transform.Find("GeneratePosition1").position; generatePos[1] = transform.Find("GeneratePosition2").position; + messageOfBase.economy = 400; StartCoroutine(economyUpdate()); } @@ -24,24 +25,58 @@ void Update() switch (interactBase.interactOption) { case InteractControl.InteractOption.BuildCivil: - obj = ObjCreater.GetInstance().CreateObj(ShipType.CIVILIAN_SHIP, generatePos[Tool.GetInstance().GetRandom(0, 2)]); - obj.GetComponent().messageOfShip.playerTeam = messageOfBase.playerTeam; + if (CostEconomy(ParaDefine.GetInstance().civilShipData.cost)) + { + obj = ObjCreater.GetInstance().CreateObj(ShipType.CIVILIAN_SHIP, generatePos[Tool.GetInstance().GetRandom(0, 2)]); + obj.GetComponent().messageOfShip.playerTeam = messageOfBase.playerTeam; + } break; case InteractControl.InteractOption.BuildMilitary: - obj = ObjCreater.GetInstance().CreateObj(ShipType.MILITARY_SHIP, generatePos[Tool.GetInstance().GetRandom(0, 2)]); - obj.GetComponent().messageOfShip.playerTeam = messageOfBase.playerTeam; + if (CostEconomy(ParaDefine.GetInstance().militaryShipData.cost)) + { + obj = ObjCreater.GetInstance().CreateObj(ShipType.MILITARY_SHIP, generatePos[Tool.GetInstance().GetRandom(0, 2)]); + obj.GetComponent().messageOfShip.playerTeam = messageOfBase.playerTeam; + } break; case InteractControl.InteractOption.BuildFlag: - obj = ObjCreater.GetInstance().CreateObj(ShipType.FLAG_SHIP, generatePos[Tool.GetInstance().GetRandom(0, 2)]); - obj.GetComponent().messageOfShip.playerTeam = messageOfBase.playerTeam; + if (CostEconomy(ParaDefine.GetInstance().flagShipData.cost)) + { + obj = ObjCreater.GetInstance().CreateObj(ShipType.FLAG_SHIP, generatePos[Tool.GetInstance().GetRandom(0, 2)]); + obj.GetComponent().messageOfShip.playerTeam = messageOfBase.playerTeam; + } break; default: break; } } IEnumerator economyUpdate() { - messageOfBase.economy++; - yield return new WaitForSeconds(1); + AddEconomy(1); + yield return new WaitForSeconds(0.05f); StartCoroutine(economyUpdate()); } + public void AddEconomy(int economy) + { + messageOfBase.economy += economy; + } + public void TakeDamage(int damage) + { + messageOfBase.hp -= damage; + if (messageOfBase.hp < 0) + messageOfBase.hp = 0; + if (messageOfBase.hp == 0) + { + DestroyBase(); + } + } + public bool CostEconomy(int cost) + { + if (messageOfBase.economy < cost) + return false; + messageOfBase.economy -= cost; + return true; + } + void DestroyBase() + { + Destroy(gameObject); + } } diff --git a/interface/interface_local/Assets/Scripts/Bullet/BulletControl.cs b/interface/interface_local/Assets/Scripts/Bullet/BulletControl.cs index 4e519de6..b21976f1 100644 --- a/interface/interface_local/Assets/Scripts/Bullet/BulletControl.cs +++ b/interface/interface_local/Assets/Scripts/Bullet/BulletControl.cs @@ -15,17 +15,33 @@ void Start() void Update() { lifeTime += Time.deltaTime; - Debug.Log(rb.velocity); + // Debug.Log(rb.velocity); if (lifeTime > bulletData.attackDistance / bulletData.speed) Destroy(gameObject); } - private void OntriggetEnter2D(Collider2D collider2D) + private void OnTriggerEnter2D(Collider2D collider2D) { if (collider2D.CompareTag("Ship")) { if (collider2D.GetComponent().messageOfShip.playerTeam != messageOfBullet.playerTeam) { - Debug.Log("hit!"); + Debug.Log("hitship!"); + if (bulletData.attackDamage.Length == 1) + collider2D.GetComponent().TakeDamage(bulletData.attackDamage[0]); + else + collider2D.GetComponent().TakeDamage(Tool.GetInstance().GetRandom(bulletData.attackDamage[0], bulletData.attackDamage[1])); + Destroy(gameObject); + } + } + if (collider2D.CompareTag("Base")) + { + if (collider2D.GetComponent().messageOfBase.playerTeam != messageOfBullet.playerTeam) + { + Debug.Log("hitbase!"); + if (bulletData.attackDamage.Length == 1) + collider2D.GetComponent().TakeDamage(bulletData.attackDamage[0]); + else + collider2D.GetComponent().TakeDamage(Tool.GetInstance().GetRandom(bulletData.attackDamage[0], bulletData.attackDamage[1])); Destroy(gameObject); } } diff --git a/interface/interface_local/Assets/Scripts/Data/BulletData.meta b/interface/interface_local/Assets/Scripts/Data/BulletData.meta new file mode 100644 index 00000000..87a8ed8a --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/BulletData.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 25c5c809279af4a46a569fd725a944a3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Data/ArcData.asset b/interface/interface_local/Assets/Scripts/Data/BulletData/ArcData.asset similarity index 91% rename from interface/interface_local/Assets/Scripts/Data/ArcData.asset rename to interface/interface_local/Assets/Scripts/Data/BulletData/ArcData.asset index edc0e0ce..de3eac60 100644 --- a/interface/interface_local/Assets/Scripts/Data/ArcData.asset +++ b/interface/interface_local/Assets/Scripts/Data/BulletData/ArcData.asset @@ -12,11 +12,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: f5a82f5376adfa14893e400fba4af4f5, type: 3} m_Name: ArcData m_EditorClassIdentifier: + cost: 2400 attackDistance: 8 explosionRange: 0 - attackDamage: - - 100 - - 3200 + attackDamage: 64000000800c0000 armorDamageMultiplier: 2 shieldDamageMultiplier: 2 speed: 8 diff --git a/interface/interface_local/Assets/Scripts/Data/ArcData.asset.meta b/interface/interface_local/Assets/Scripts/Data/BulletData/ArcData.asset.meta similarity index 100% rename from interface/interface_local/Assets/Scripts/Data/ArcData.asset.meta rename to interface/interface_local/Assets/Scripts/Data/BulletData/ArcData.asset.meta diff --git a/interface/interface_local/Assets/Scripts/Data/BulletData.cs b/interface/interface_local/Assets/Scripts/Data/BulletData/BulletData.cs similarity index 88% rename from interface/interface_local/Assets/Scripts/Data/BulletData.cs rename to interface/interface_local/Assets/Scripts/Data/BulletData/BulletData.cs index d074392d..aad07eb8 100644 --- a/interface/interface_local/Assets/Scripts/Data/BulletData.cs +++ b/interface/interface_local/Assets/Scripts/Data/BulletData/BulletData.cs @@ -5,9 +5,10 @@ [CreateAssetMenu(fileName = "BulletData", menuName = "GameData/BulletData", order = 0)] public class BulletData : ScriptableObject { + public int cost; public float attackDistance; public float explosionRange; - public float[] attackDamage; + public int[] attackDamage; public float armorDamageMultiplier; public float shieldDamageMultiplier; public float speed; diff --git a/interface/interface_local/Assets/Scripts/Data/BulletData.cs.meta b/interface/interface_local/Assets/Scripts/Data/BulletData/BulletData.cs.meta similarity index 100% rename from interface/interface_local/Assets/Scripts/Data/BulletData.cs.meta rename to interface/interface_local/Assets/Scripts/Data/BulletData/BulletData.cs.meta diff --git a/interface/interface_local/Assets/Scripts/Data/LaserData.asset b/interface/interface_local/Assets/Scripts/Data/BulletData/LaserData.asset similarity index 93% rename from interface/interface_local/Assets/Scripts/Data/LaserData.asset rename to interface/interface_local/Assets/Scripts/Data/BulletData/LaserData.asset index 4522e769..7d289ed3 100644 --- a/interface/interface_local/Assets/Scripts/Data/LaserData.asset +++ b/interface/interface_local/Assets/Scripts/Data/BulletData/LaserData.asset @@ -12,10 +12,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: f5a82f5376adfa14893e400fba4af4f5, type: 3} m_Name: LaserData m_EditorClassIdentifier: + cost: 1000 attackDistance: 4 explosionRange: 0 - attackDamage: - - 1200 + attackDamage: b0040000 armorDamageMultiplier: 1.5 shieldDamageMultiplier: 0.6 speed: 20 diff --git a/interface/interface_local/Assets/Scripts/Data/LaserData.asset.meta b/interface/interface_local/Assets/Scripts/Data/BulletData/LaserData.asset.meta similarity index 100% rename from interface/interface_local/Assets/Scripts/Data/LaserData.asset.meta rename to interface/interface_local/Assets/Scripts/Data/BulletData/LaserData.asset.meta diff --git a/interface/interface_local/Assets/Scripts/Data/MissileData.asset b/interface/interface_local/Assets/Scripts/Data/BulletData/MissileData.asset similarity index 93% rename from interface/interface_local/Assets/Scripts/Data/MissileData.asset rename to interface/interface_local/Assets/Scripts/Data/BulletData/MissileData.asset index 67613e48..88561ea3 100644 --- a/interface/interface_local/Assets/Scripts/Data/MissileData.asset +++ b/interface/interface_local/Assets/Scripts/Data/BulletData/MissileData.asset @@ -12,10 +12,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: f5a82f5376adfa14893e400fba4af4f5, type: 3} m_Name: MissileData m_EditorClassIdentifier: + cost: 1800 attackDistance: 8 explosionRange: 1.6 - attackDamage: - - 1600 + attackDamage: 40060000 armorDamageMultiplier: 1 shieldDamageMultiplier: -1 speed: 6 diff --git a/interface/interface_local/Assets/Scripts/Data/MissileData.asset.meta b/interface/interface_local/Assets/Scripts/Data/BulletData/MissileData.asset.meta similarity index 100% rename from interface/interface_local/Assets/Scripts/Data/MissileData.asset.meta rename to interface/interface_local/Assets/Scripts/Data/BulletData/MissileData.asset.meta diff --git a/interface/interface_local/Assets/Scripts/Data/PlasmaData.asset b/interface/interface_local/Assets/Scripts/Data/BulletData/PlasmaData.asset similarity index 93% rename from interface/interface_local/Assets/Scripts/Data/PlasmaData.asset rename to interface/interface_local/Assets/Scripts/Data/BulletData/PlasmaData.asset index 57b0a9c8..f14c6a8b 100644 --- a/interface/interface_local/Assets/Scripts/Data/PlasmaData.asset +++ b/interface/interface_local/Assets/Scripts/Data/BulletData/PlasmaData.asset @@ -12,10 +12,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: f5a82f5376adfa14893e400fba4af4f5, type: 3} m_Name: PlasmaData m_EditorClassIdentifier: + cost: 1200 attackDistance: 4 explosionRange: 0 - attackDamage: - - 1300 + attackDamage: 14050000 armorDamageMultiplier: 2 shieldDamageMultiplier: 0.4 speed: 10 diff --git a/interface/interface_local/Assets/Scripts/Data/PlasmaData.asset.meta b/interface/interface_local/Assets/Scripts/Data/BulletData/PlasmaData.asset.meta similarity index 100% rename from interface/interface_local/Assets/Scripts/Data/PlasmaData.asset.meta rename to interface/interface_local/Assets/Scripts/Data/BulletData/PlasmaData.asset.meta diff --git a/interface/interface_local/Assets/Scripts/Data/ShellData.asset b/interface/interface_local/Assets/Scripts/Data/BulletData/ShellData.asset similarity index 93% rename from interface/interface_local/Assets/Scripts/Data/ShellData.asset rename to interface/interface_local/Assets/Scripts/Data/BulletData/ShellData.asset index e7c5bbc3..f4bee335 100644 --- a/interface/interface_local/Assets/Scripts/Data/ShellData.asset +++ b/interface/interface_local/Assets/Scripts/Data/BulletData/ShellData.asset @@ -12,10 +12,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: f5a82f5376adfa14893e400fba4af4f5, type: 3} m_Name: ShellData m_EditorClassIdentifier: + cost: 1300 attackDistance: 4 explosionRange: 0 - attackDamage: - - 1800 + attackDamage: 08070000 armorDamageMultiplier: 0.4 shieldDamageMultiplier: 1.5 speed: 8 diff --git a/interface/interface_local/Assets/Scripts/Data/ShellData.asset.meta b/interface/interface_local/Assets/Scripts/Data/BulletData/ShellData.asset.meta similarity index 100% rename from interface/interface_local/Assets/Scripts/Data/ShellData.asset.meta rename to interface/interface_local/Assets/Scripts/Data/BulletData/ShellData.asset.meta diff --git a/interface/interface_local/Assets/Scripts/Data/ProducerData.meta b/interface/interface_local/Assets/Scripts/Data/ProducerData.meta new file mode 100644 index 00000000..ce211855 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ProducerData.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f707c29c56c612a43b9a662ce02986d9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Data/ProducerData/Producer1Data.asset b/interface/interface_local/Assets/Scripts/Data/ProducerData/Producer1Data.asset new file mode 100644 index 00000000..84d6a587 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ProducerData/Producer1Data.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: 54e831eeb4931d14da985b488040e198, type: 3} + m_Name: Producer1Data + m_EditorClassIdentifier: + cost: 0 + miningSpeed: 20 diff --git a/interface/interface_local/Assets/Scripts/Data/ProducerData/Producer1Data.asset.meta b/interface/interface_local/Assets/Scripts/Data/ProducerData/Producer1Data.asset.meta new file mode 100644 index 00000000..f9a2a444 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ProducerData/Producer1Data.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2a0b9ed3d44383c4dbb629c824bbef69 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Data/ProducerData/Producer2Data.asset b/interface/interface_local/Assets/Scripts/Data/ProducerData/Producer2Data.asset new file mode 100644 index 00000000..863ac0fd --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ProducerData/Producer2Data.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: 54e831eeb4931d14da985b488040e198, type: 3} + m_Name: Producer2Data + m_EditorClassIdentifier: + cost: 400 + miningSpeed: 30 diff --git a/interface/interface_local/Assets/Scripts/Data/ProducerData/Producer2Data.asset.meta b/interface/interface_local/Assets/Scripts/Data/ProducerData/Producer2Data.asset.meta new file mode 100644 index 00000000..88ceb7ad --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ProducerData/Producer2Data.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d0ab6cc0b56e16d4f9e73093109cde7a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Data/ProducerData/Producer3Data.asset b/interface/interface_local/Assets/Scripts/Data/ProducerData/Producer3Data.asset new file mode 100644 index 00000000..796a6f70 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ProducerData/Producer3Data.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: 54e831eeb4931d14da985b488040e198, type: 3} + m_Name: Producer3Data + m_EditorClassIdentifier: + cost: 800 + miningSpeed: 40 diff --git a/interface/interface_local/Assets/Scripts/Data/ProducerData/Producer3Data.asset.meta b/interface/interface_local/Assets/Scripts/Data/ProducerData/Producer3Data.asset.meta new file mode 100644 index 00000000..a3494f75 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ProducerData/Producer3Data.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f13b23f24946f3648bae0bba52db7c15 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Data/ProducerData/ProducerData.cs b/interface/interface_local/Assets/Scripts/Data/ProducerData/ProducerData.cs new file mode 100644 index 00000000..c2d0bd9b --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ProducerData/ProducerData.cs @@ -0,0 +1,10 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +[CreateAssetMenu(fileName = "ProducerData", menuName = "GameData/ProducerData", order = 0)] +public class ProducerData : ScriptableObject +{ + public int cost; + public int miningSpeed; +} diff --git a/interface/interface_local/Assets/Scripts/Data/ProducerData/ProducerData.cs.meta b/interface/interface_local/Assets/Scripts/Data/ProducerData/ProducerData.cs.meta new file mode 100644 index 00000000..d4ec08c5 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ProducerData/ProducerData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 54e831eeb4931d14da985b488040e198 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Data/ShipData.meta b/interface/interface_local/Assets/Scripts/Data/ShipData.meta new file mode 100644 index 00000000..6c9718da --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ShipData.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4d1050adbd960174fa7941fccfa4f1d1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Data/ShipData/CivilShipData.asset b/interface/interface_local/Assets/Scripts/Data/ShipData/CivilShipData.asset new file mode 100644 index 00000000..d4c2be67 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ShipData/CivilShipData.asset @@ -0,0 +1,15 @@ +%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: ce1ec383cada7554392f235710c9ea52, type: 3} + m_Name: CivilShipData + m_EditorClassIdentifier: + cost: 400 diff --git a/interface/interface_local/Assets/Scripts/Data/ShipData/CivilShipData.asset.meta b/interface/interface_local/Assets/Scripts/Data/ShipData/CivilShipData.asset.meta new file mode 100644 index 00000000..4532111f --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ShipData/CivilShipData.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9fe1f9c27065b8f469ce5ee64ae7ef2c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Data/ShipData/FlagShipData.asset b/interface/interface_local/Assets/Scripts/Data/ShipData/FlagShipData.asset new file mode 100644 index 00000000..f0603240 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ShipData/FlagShipData.asset @@ -0,0 +1,15 @@ +%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: ce1ec383cada7554392f235710c9ea52, type: 3} + m_Name: FlagShipData + m_EditorClassIdentifier: + cost: 5000 diff --git a/interface/interface_local/Assets/Scripts/Data/ShipData/FlagShipData.asset.meta b/interface/interface_local/Assets/Scripts/Data/ShipData/FlagShipData.asset.meta new file mode 100644 index 00000000..078c08d7 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ShipData/FlagShipData.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9a89d808d3c0a8a489972c9bc6edb515 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Data/ShipData/MilitaryShipData.asset b/interface/interface_local/Assets/Scripts/Data/ShipData/MilitaryShipData.asset new file mode 100644 index 00000000..d7e60a91 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ShipData/MilitaryShipData.asset @@ -0,0 +1,15 @@ +%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: ce1ec383cada7554392f235710c9ea52, type: 3} + m_Name: MilitaryShipData + m_EditorClassIdentifier: + cost: 1200 diff --git a/interface/interface_local/Assets/Scripts/Data/ShipData/MilitaryShipData.asset.meta b/interface/interface_local/Assets/Scripts/Data/ShipData/MilitaryShipData.asset.meta new file mode 100644 index 00000000..6788dc4b --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ShipData/MilitaryShipData.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: eff4f0dc7669fd1469463e3bff5104a8 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Data/ShipData/ShipData.cs b/interface/interface_local/Assets/Scripts/Data/ShipData/ShipData.cs new file mode 100644 index 00000000..e77b16bb --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ShipData/ShipData.cs @@ -0,0 +1,9 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +[CreateAssetMenu(fileName = "ShipData", menuName = "GameData/ShipData", order = 0)] +public class ShipData : ScriptableObject +{ + public int cost; +} diff --git a/interface/interface_local/Assets/Scripts/Data/ShipData/ShipData.cs.meta b/interface/interface_local/Assets/Scripts/Data/ShipData/ShipData.cs.meta new file mode 100644 index 00000000..47b9f206 --- /dev/null +++ b/interface/interface_local/Assets/Scripts/Data/ShipData/ShipData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ce1ec383cada7554392f235710c9ea52 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/interface/interface_local/Assets/Scripts/Map/MapControl.cs b/interface/interface_local/Assets/Scripts/Map/MapControl.cs index a209a2aa..558e5af9 100644 --- a/interface/interface_local/Assets/Scripts/Map/MapControl.cs +++ b/interface/interface_local/Assets/Scripts/Map/MapControl.cs @@ -24,12 +24,19 @@ void DrawMap(uint[,] map) { case PlaceType.HOME: if (!bases[0]) + { bases[0] = ObjCreater.GetInstance().CreateObj(PlaceType.HOME, new Vector2(j, 50 - i)).GetComponent(); + bases[0].name = "Base1"; + } else + { bases[1] = ObjCreater.GetInstance().CreateObj(PlaceType.HOME, new Vector2(j, 50 - i)).GetComponent(); + bases[1].name = "Base2"; + } break; case PlaceType.RESOURCE: - ObjCreater.GetInstance().CreateObj(PlaceType.HOME, new Vector2(j, 50 - i)); + ObjCreater.GetInstance().CreateObj(PlaceType.RESOURCE, new Vector2(j, 50 - i)); + // Debug.Log(PlaceManager.GetInstance().resource); PlaceManager.GetInstance().resource.Add(new Vector2(j, 50 - i)); break; default: @@ -37,13 +44,13 @@ void DrawMap(uint[,] map) break; } } - bases[0].messageOfBase.playerTeam = PlayerTeam.BLUE; - bases[1].messageOfBase.playerTeam = PlayerTeam.RED; } - // Update is called once per frame - void Update() - { + bases[0].messageOfBase.playerTeam = PlayerTeam.BLUE; + bases[1].messageOfBase.playerTeam = PlayerTeam.RED; + } + // Update is called once per frame + void Update() + { - } } } \ No newline at end of file diff --git a/interface/interface_local/Assets/Scripts/Message2Clients.cs b/interface/interface_local/Assets/Scripts/Message2Clients.cs index a1ae75a5..cce85500 100644 --- a/interface/interface_local/Assets/Scripts/Message2Clients.cs +++ b/interface/interface_local/Assets/Scripts/Message2Clients.cs @@ -12,7 +12,7 @@ public struct MessageOfShip public int shield; public PlayerTeam playerTeam; // public int playerId; - // public ShipState shipState; + public ShipState shipState; public ShipType shipType; public int viewRange; public ProducerType producerType; diff --git a/interface/interface_local/Assets/Scripts/MessageType.cs b/interface/interface_local/Assets/Scripts/MessageType.cs index 2b1aeabb..73b442c5 100644 --- a/interface/interface_local/Assets/Scripts/MessageType.cs +++ b/interface/interface_local/Assets/Scripts/MessageType.cs @@ -150,7 +150,7 @@ public enum NewsType public enum PlayerTeam { - NULL_TEAM, RED, BLUE, + NULL_TEAM, } \ No newline at end of file diff --git a/interface/interface_local/Assets/Scripts/ObjCreater.cs b/interface/interface_local/Assets/Scripts/ObjCreater.cs index cdb9b555..9f9a66b4 100644 --- a/interface/interface_local/Assets/Scripts/ObjCreater.cs +++ b/interface/interface_local/Assets/Scripts/ObjCreater.cs @@ -93,9 +93,9 @@ public GameObject CreateObj(BulletType bulletType, Vector2 Pos, Quaternion quate } return null; } - void Start() - { - mapfa = GameObject.Find("Map").transform; - } + } + void Start() + { + mapfa = GameObject.Find("Map").transform; } } \ No newline at end of file diff --git a/interface/interface_local/Assets/Scripts/ParaDefine.cs b/interface/interface_local/Assets/Scripts/ParaDefine.cs index 96c250fa..aa454a19 100644 --- a/interface/interface_local/Assets/Scripts/ParaDefine.cs +++ b/interface/interface_local/Assets/Scripts/ParaDefine.cs @@ -5,4 +5,6 @@ public class ParaDefine : SingletonMono { public BulletData laserData, plasmaData, shellData, missileData, arcData; + public ProducerData producer1Data, producer2Data, producer3Data; + public ShipData civilShipData, militaryShipData, flagShipData; } diff --git a/interface/interface_local/Assets/Scripts/Place/PlaceManager.cs b/interface/interface_local/Assets/Scripts/Place/PlaceManager.cs index 6e3482dd..6ddc898c 100644 --- a/interface/interface_local/Assets/Scripts/Place/PlaceManager.cs +++ b/interface/interface_local/Assets/Scripts/Place/PlaceManager.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using UnityEngine; -public class PlaceManager : Singleton +public class PlaceManager : SingletonMono { public List resource; diff --git a/interface/interface_local/Assets/Scripts/Player/PlayerControl.cs b/interface/interface_local/Assets/Scripts/Player/PlayerControl.cs index 150041b6..f2d6f195 100644 --- a/interface/interface_local/Assets/Scripts/Player/PlayerControl.cs +++ b/interface/interface_local/Assets/Scripts/Player/PlayerControl.cs @@ -31,11 +31,12 @@ void Update() CheckInteract(); UpdateInteractList(); Interact(); - ShipMpve(); // ShipAttack(); } void testInput() { + if (Input.GetKeyDown(KeyCode.P)) + selectedOption = InteractControl.InteractOption.Produce; } void CheckInteract() { @@ -69,6 +70,10 @@ void CheckInteract() selectedInt.Add(raycaster.GetComponent()); } } + if (Input.GetMouseButtonDown(1)) + { + ShipMove(raycaster.transform.position); + } } } else @@ -90,6 +95,10 @@ void CheckInteract() // selectedInt.Clear(); ShipAttack(); } + if (Input.GetMouseButtonDown(1)) + { + ShipMove(Camera.main.ScreenToWorldPoint(Input.mousePosition)); + } } } } @@ -107,7 +116,6 @@ void UpdateInteractList() enabledInteract.Remove(enabledInteract[i]); } } - } else { @@ -123,15 +131,12 @@ void Interact() } selectedOption = InteractControl.InteractOption.None; } - void ShipMpve() + void ShipMove(Vector2 movePos) { - if (Input.GetMouseButtonDown(1)) + foreach (InteractBase interactBase in selectedInt) { - foreach (InteractBase interactBase in selectedInt) - { - interactBase.enableMove = true; - interactBase.moveOption = Camera.main.ScreenToWorldPoint(Input.mousePosition); - } + interactBase.enableMove = true; + interactBase.moveOption = movePos; } } void ShipAttack() diff --git a/interface/interface_local/Assets/Scripts/Ship/ShipControl.cs b/interface/interface_local/Assets/Scripts/Ship/ShipControl.cs index 4d188685..a15a3237 100644 --- a/interface/interface_local/Assets/Scripts/Ship/ShipControl.cs +++ b/interface/interface_local/Assets/Scripts/Ship/ShipControl.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; +using Unity.VisualScripting; using UnityEditor; using UnityEditor.iOS; using UnityEngine; @@ -46,19 +47,70 @@ void Update() { if (Tool.GetInstance().CheckBeside(transform.position, resourcePos)) { - + if (messageOfShip.shipState != ShipState.PRODUCING) + Produce(); } } break; - default: break; + case InteractControl.InteractOption.InstallModuleLaserGun: + if (MapControl.GetInstance().bases[(int)messageOfShip.playerTeam].CostEconomy(ParaDefine.GetInstance().laserData.cost)) + messageOfShip.weaponType = WeaponType.LASERGUN; + break; + case InteractControl.InteractOption.InstallModulePlasmaGun: + if (MapControl.GetInstance().bases[(int)messageOfShip.playerTeam].CostEconomy(ParaDefine.GetInstance().plasmaData.cost)) + messageOfShip.weaponType = WeaponType.PLASMAGUN; + break; + case InteractControl.InteractOption.InstallModuleShellGun: + if (MapControl.GetInstance().bases[(int)messageOfShip.playerTeam].CostEconomy(ParaDefine.GetInstance().shellData.cost)) + messageOfShip.weaponType = WeaponType.SHELLGUN; + break; + case InteractControl.InteractOption.InstallModuleMissileGun: + if (MapControl.GetInstance().bases[(int)messageOfShip.playerTeam].CostEconomy(ParaDefine.GetInstance().missileData.cost)) + messageOfShip.weaponType = WeaponType.MISSILEGUN; + break; + case InteractControl.InteractOption.InstallModuleArcGun: + if (MapControl.GetInstance().bases[(int)messageOfShip.playerTeam].CostEconomy(ParaDefine.GetInstance().arcData.cost)) + messageOfShip.weaponType = WeaponType.ARCGUN; + break; + default: + break; } MoveTowards(interactBase.moveOption); AttackTowards(interactBase.attackOption); interactBase.attackOption = Vector2.zero; } + void Produce() + { + switch (messageOfShip.producerType) + { + case ProducerType.PRODUCER1: + StartCoroutine(ProduceIE(ParaDefine.GetInstance().producer1Data.miningSpeed)); + break; + case ProducerType.PRODUCER2: + StartCoroutine(ProduceIE(ParaDefine.GetInstance().producer2Data.miningSpeed)); + break; + case ProducerType.PRODUCER3: + StartCoroutine(ProduceIE(ParaDefine.GetInstance().producer3Data.miningSpeed)); + break; + default: + break; + } + } + IEnumerator ProduceIE(int economy) + { + Debug.Log("try produce"); + messageOfShip.shipState = ShipState.PRODUCING; + while (messageOfShip.shipState == ShipState.PRODUCING) + { + MapControl.GetInstance().bases[(int)messageOfShip.playerTeam].AddEconomy(economy); + yield return new WaitForSeconds(1); + } + + } void MoveTowards(Vector2 pos) { if (interactBase.enableMove) + { if ((pos - (Vector2)transform.position).magnitude > 0.1f) { targetQ = DealQ(Mathf.Atan2(pos.y - transform.position.y, pos.x - transform.position.x) * Mathf.Rad2Deg - 90); @@ -69,11 +121,18 @@ void MoveTowards(Vector2 pos) SetVQTo(Vector2.zero); interactBase.enableMove = false; } + + messageOfShip.shipState = ShipState.MOVING; + } + else + SetVQTo(Vector2.zero); } void AttackTowards(Vector2 pos) { if (pos != Vector2.zero) { + + messageOfShip.shipState = ShipState.ATTACKING; GameObject obj; switch (messageOfShip.weaponType) { @@ -110,4 +169,18 @@ void AttackTowards(Vector2 pos) } } } + public void TakeDamage(int damage) + { + messageOfShip.hp -= damage; + if (messageOfShip.hp < 0) + messageOfShip.hp = 0; + if (messageOfShip.hp == 0) + { + DestroyShip(); + } + } + void DestroyShip() + { + Destroy(gameObject); + } } diff --git a/interface/interface_local/Assets/Scripts/UI/UIControl.cs b/interface/interface_local/Assets/Scripts/UI/UIControl.cs index b53703d1..900bf3d6 100644 --- a/interface/interface_local/Assets/Scripts/UI/UIControl.cs +++ b/interface/interface_local/Assets/Scripts/UI/UIControl.cs @@ -6,9 +6,9 @@ public class UIControl : MonoBehaviour { - public Slider healthSlider; - public TextMeshProUGUI healthText, ecoText; - BaseControl Base; + public Slider healthSlider1, healthSlider2; + public TextMeshProUGUI healthText1, healthText2, ecoText1, ecoText2; + BaseControl base1, base2; // Start is called before the first frame update void Start() { @@ -17,11 +17,16 @@ void Start() // Update is called once per frame void Update() { - if (!Base) - Base = GameObject.FindGameObjectWithTag("Base").GetComponent(); - healthText.text = "Health: " + Base.messageOfBase.hp.ToString(); - healthSlider.value = Base.messageOfBase.hp / 24000f; - ecoText.text = "Eco: " + Base.messageOfBase.economy.ToString(); + if (!base1) + base1 = GameObject.Find("Base1").GetComponent(); + if (!base2) + base2 = GameObject.Find("Base2").GetComponent(); + healthText1.text = "Health: " + base1.messageOfBase.hp.ToString(); + healthSlider1.value = base1.messageOfBase.hp / 24000f; + ecoText1.text = "Eco: " + base1.messageOfBase.economy.ToString(); + healthText2.text = "Health: " + base2.messageOfBase.hp.ToString(); + healthSlider2.value = base2.messageOfBase.hp / 24000f; + ecoText2.text = "Eco: " + base2.messageOfBase.economy.ToString(); } public void BuildCivilship() { diff --git a/interface/interface_local/ProjectSettings/TagManager.asset b/interface/interface_local/ProjectSettings/TagManager.asset index 3f8231cc..f3371f20 100644 --- a/interface/interface_local/ProjectSettings/TagManager.asset +++ b/interface/interface_local/ProjectSettings/TagManager.asset @@ -5,6 +5,8 @@ TagManager: serializedVersion: 2 tags: - Base + - Ship + - Bullet layers: - Default - TransparentFX