diff options
8 files changed, 141 insertions, 373 deletions
diff --git a/SurvivalTest/Assets/Resources/Prefabs/ui/PanelEquipBar.prefab b/SurvivalTest/Assets/Resources/Prefabs/ui/PanelEquipBar.prefab index 09f6283..207830a 100644 --- a/SurvivalTest/Assets/Resources/Prefabs/ui/PanelEquipBar.prefab +++ b/SurvivalTest/Assets/Resources/Prefabs/ui/PanelEquipBar.prefab @@ -1,5 +1,80 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: +--- !u!1 &1433800100 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1433800101} + - component: {fileID: 1433800103} + - component: {fileID: 1433800102} + m_Layer: 5 + m_Name: Image_CD + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1433800101 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1433800100} + 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_Children: [] + m_Father: {fileID: 2762965039604320079} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &1433800103 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1433800100} + m_CullTransparentMesh: 1 +--- !u!114 &1433800102 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1433800100} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 0.13333334} + 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: be5e635b9d3d6f542ad447f7ae74d785, type: 3} + m_Type: 3 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 1 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 1 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 --- !u!1 &1085118836000191244 GameObject: m_ObjectHideFlags: 0 @@ -261,6 +336,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 68874370905088208} + - {fileID: 1433800101} m_Father: {fileID: 4955373364382747661} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -282,6 +358,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: Image_Icon: {fileID: 7293713770503003309} + Image_CD: {fileID: 1433800102} --- !u!1 &7599170346437084209 GameObject: m_ObjectHideFlags: 0 diff --git a/SurvivalTest/Assets/Resources/Scenes/6_PixelCanvas 1.unity b/SurvivalTest/Assets/Resources/Scenes/6_PixelCanvas 1.unity index e8fde5d..8b4c805 100644 --- a/SurvivalTest/Assets/Resources/Scenes/6_PixelCanvas 1.unity +++ b/SurvivalTest/Assets/Resources/Scenes/6_PixelCanvas 1.unity @@ -1115,112 +1115,6 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 1 ---- !u!1001 &719302486 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 1127821130} - m_Modifications: - - target: {fileID: 8436628705391075520, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - propertyPath: m_Name - value: PanelEquipBar - objectReference: {fileID: 0} - - target: {fileID: 8436628705391075520, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - propertyPath: m_IsActive - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8436628705391075521, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - propertyPath: m_Pivot.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 8436628705391075521, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - propertyPath: m_Pivot.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 8436628705391075521, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - propertyPath: m_RootOrder - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 8436628705391075521, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - propertyPath: m_AnchorMax.x - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8436628705391075521, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8436628705391075521, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - propertyPath: m_AnchorMin.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8436628705391075521, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8436628705391075521, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - propertyPath: m_SizeDelta.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8436628705391075521, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - propertyPath: m_SizeDelta.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8436628705391075521, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8436628705391075521, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8436628705391075521, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8436628705391075521, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8436628705391075521, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8436628705391075521, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8436628705391075521, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8436628705391075521, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8436628705391075521, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8436628705391075521, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8436628705391075521, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8436628705391075521, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} ---- !u!224 &719302487 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 8436628705391075521, guid: 6f8f312a90e5b264eb2db0c1bf204471, type: 3} - m_PrefabInstance: {fileID: 719302486} - m_PrefabAsset: {fileID: 0} --- !u!1 &729199530 GameObject: m_ObjectHideFlags: 0 @@ -1417,112 +1311,6 @@ MonoBehaviour: m_Shadow: {fileID: 0} m_Coord: {x: 0, y: 0, z: 0} m_Height: 0 ---- !u!1001 &787820389 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 1127821130} - m_Modifications: - - target: {fileID: 8798891066935212560, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - propertyPath: m_Pivot.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 8798891066935212560, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - propertyPath: m_Pivot.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 8798891066935212560, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - propertyPath: m_RootOrder - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8798891066935212560, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - propertyPath: m_AnchorMax.x - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8798891066935212560, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8798891066935212560, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - propertyPath: m_AnchorMin.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8798891066935212560, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8798891066935212560, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - propertyPath: m_SizeDelta.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8798891066935212560, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - propertyPath: m_SizeDelta.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8798891066935212560, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8798891066935212560, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8798891066935212560, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8798891066935212560, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8798891066935212560, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8798891066935212560, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8798891066935212560, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8798891066935212560, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8798891066935212560, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8798891066935212560, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8798891066935212560, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8798891066935212560, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8798891066935212561, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - propertyPath: m_Name - value: PanelItemBar - objectReference: {fileID: 0} - - target: {fileID: 8798891066935212561, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - propertyPath: m_IsActive - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} ---- !u!224 &787820390 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 8798891066935212560, guid: 302ad0181ac604e46b0a10a9abe687cb, type: 3} - m_PrefabInstance: {fileID: 787820389} - m_PrefabAsset: {fileID: 0} --- !u!1 &794956711 GameObject: m_ObjectHideFlags: 0 @@ -2124,10 +1912,7 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0} - m_Children: - - {fileID: 1523503809} - - {fileID: 787820390} - - {fileID: 719302487} + m_Children: [] m_Father: {fileID: 0} m_RootOrder: 15 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -2758,11 +2543,6 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 1 ---- !u!224 &1523503809 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 5053551695217443173, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} - m_PrefabInstance: {fileID: 5053551694240846756} - m_PrefabAsset: {fileID: 0} --- !u!1 &1555591569 GameObject: m_ObjectHideFlags: 0 @@ -4236,103 +4016,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_LocalPosition: {x: -4.3151608, y: 7.5453644, z: 1.0356388} ---- !u!1001 &5053551694240846756 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 1127821130} - m_Modifications: - - target: {fileID: 5053551695217443172, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} - propertyPath: m_Name - value: PanelLevelBar - objectReference: {fileID: 0} - - target: {fileID: 5053551695217443173, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} - propertyPath: m_Pivot.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 5053551695217443173, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} - propertyPath: m_Pivot.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 5053551695217443173, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} - propertyPath: m_RootOrder - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5053551695217443173, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} - propertyPath: m_AnchorMax.x - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 5053551695217443173, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 5053551695217443173, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} - propertyPath: m_AnchorMin.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5053551695217443173, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5053551695217443173, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} - propertyPath: m_SizeDelta.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5053551695217443173, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} - propertyPath: m_SizeDelta.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5053551695217443173, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5053551695217443173, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5053551695217443173, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5053551695217443173, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 5053551695217443173, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5053551695217443173, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5053551695217443173, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5053551695217443173, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5053551695217443173, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5053551695217443173, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5053551695217443173, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5053551695217443173, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 2a06f9fe942aeaf42a71ca82ae5d13d6, type: 3} --- !u!1001 &8582758514292956423 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/SurvivalTest/Assets/Scripts/Equips/Equip_GrenadeLauncher.cs b/SurvivalTest/Assets/Scripts/Equips/Equip_GrenadeLauncher.cs index 090c3ab..0ec7dc9 100644 --- a/SurvivalTest/Assets/Scripts/Equips/Equip_GrenadeLauncher.cs +++ b/SurvivalTest/Assets/Scripts/Equips/Equip_GrenadeLauncher.cs @@ -32,8 +32,6 @@ public class Equip_GrenadeLauncher : EquipBase public override void OnTrigger(GameObject owner) { - Debug.Log("Grenade !!!"); - CrewScript crew = owner.GetComponent<CrewScript>(); //// grenade diff --git a/SurvivalTest/Assets/Scripts/Equips/Equip_Gun.cs b/SurvivalTest/Assets/Scripts/Equips/Equip_Gun.cs index b370e66..fbc3aac 100644 --- a/SurvivalTest/Assets/Scripts/Equips/Equip_Gun.cs +++ b/SurvivalTest/Assets/Scripts/Equips/Equip_Gun.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using UnityEngine; /// <summary> -/// ǹ +/// 枪 /// </summary> public class Equip_Gun : EquipBase { @@ -16,8 +16,43 @@ public class Equip_Gun : EquipBase public override float interval => 0.1f; + private string prefabPath = "prefabs/bullet/bullet"; + + private int index = 0; + + TestPeaceMakerBullet CreateBullet(CrewScript crew, Vector2 dir, float speed, float lifeTime) + { + + TestPeaceMakerBullet bullet = UnityEngine.Object.Instantiate<TestPeaceMakerBullet>(ResourceManager.Instance.Load< TestPeaceMakerBullet>(prefabPath)); + + bullet.transform.position = crew.arrow.position + new Vector3(crew.aimDirection.x, crew.aimDirection.y, 0) * -0.3f; + + bullet.Set(dir, speed, lifeTime); + bullet.gameObject.SetActive(true); + + return bullet; + } + public override void OnTrigger(GameObject owner) { + CrewScript crew = owner.GetComponent<CrewScript>(); + + index++; + index = index % 3; + + if(index == 0) + { + CreateBullet(crew, TestMathHelper.Rotate(crew.aimDirection, -10 * Mathf.Deg2Rad), 12f, 2f); + } + else if(index == 1) + { + CreateBullet(crew, crew.aimDirection, 12f, 2f); + } + else if(index == 2) + { + CreateBullet(crew, TestMathHelper.Rotate(crew.aimDirection, 10 * Mathf.Deg2Rad), 12f, 2f); + } + } }
\ No newline at end of file diff --git a/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Equips.cs b/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Equips.cs index 67e8ae7..3e21c56 100644 --- a/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Equips.cs +++ b/SurvivalTest/Assets/Scripts/Managers/PlayerManager_Equips.cs @@ -4,13 +4,14 @@ using UnityEngine; public partial class PlayerManager : Singleton<PlayerManager> { - // ³ÖÓеÄ×°±¸ public List<EquipBase> equips { get { return m_Equips; } } private List<EquipBase> m_Equips = new List<EquipBase>(); private Coroutine m_CoFire; + public bool isFire { get; private set; } + void InitEquips() { m_Equips.Add(new Equip_Gun()); @@ -35,6 +36,7 @@ public partial class PlayerManager : Singleton<PlayerManager> { if (Input.GetButtonDown("Fire1") || (Input.GetAxis("GunTrigger") == 1)) { + isFire = true; if (m_CoFire == null) { m_CoFire = GameApp.Instance.StartCoroutine(coFire()); @@ -42,6 +44,7 @@ public partial class PlayerManager : Singleton<PlayerManager> } if (!Input.GetButton("Fire1") && (Input.GetAxis("GunTrigger") == 0)) { + isFire = false; if (m_CoFire != null) { GameApp.Instance.StopCoroutine(m_CoFire); @@ -66,7 +69,7 @@ public partial class PlayerManager : Singleton<PlayerManager> if(equip.autoMode == EquipBase.AutoMode.Interval) { string id = equip.GetHashCode().ToString(); - float countDown = TinyCountDown.Instance.Get(id); + float countDown = TinyCountDown.Instance.Get(id); // µ¹¼ÆÊ±ÍÑÀëfireµ¥¶À¼ÆÊ± if(countDown <= 0) { equip.OnTrigger(m_Crew.gameObject); diff --git a/SurvivalTest/Assets/Scripts/Test/TestPeaceMaker.cs b/SurvivalTest/Assets/Scripts/Test/TestPeaceMaker.cs index 7226ac9..86b781b 100644 --- a/SurvivalTest/Assets/Scripts/Test/TestPeaceMaker.cs +++ b/SurvivalTest/Assets/Scripts/Test/TestPeaceMaker.cs @@ -23,6 +23,13 @@ public class TestPeaceMaker : CrewScript } } + public override Transform arrow + { + get + { + return m_Arrow.transform; + } + } public override Transform launchPoint { @@ -53,7 +60,6 @@ public class TestPeaceMaker : CrewScript private SpriteRenderer m_SpriteRenderer; private TopDownTransform m_Coord; - private Coroutine m_CoFire; private Vector3 m_PreMouse; @@ -92,7 +98,7 @@ public class TestPeaceMaker : CrewScript SetAim(); - bool isFire = Fire(); + bool isFire = PlayerManager.Instance.isFire; CameraFollow(); @@ -204,52 +210,4 @@ public class TestPeaceMaker : CrewScript return target; } - bool Fire() - { - if (Input.GetButtonDown("Fire1") || (Input.GetAxis("GunTrigger") == 1)) - { - if (m_CoFire == null) - { - m_CoFire = StartCoroutine(coFire(0.1f)); - } - } - if (!Input.GetButton("Fire1") && (Input.GetAxis("GunTrigger") == 0)) - { - if(m_CoFire != null) - { - StopCoroutine(m_CoFire); - m_CoFire = null; - } - return false; - } - return true; - } - - IEnumerator coFire(float interval) - { - while (true) - { - CreateBullet(TestMathHelper.Rotate(m_AimDirection, -10 * Mathf.Deg2Rad), 12f, 2f); - yield return new WaitForSeconds(interval / 3f); - - CreateBullet(m_AimDirection, 12f, 2f); - yield return new WaitForSeconds(interval / 3f); - - CreateBullet(TestMathHelper.Rotate(m_AimDirection, 10 * Mathf.Deg2Rad), 12f, 2f); - yield return new WaitForSeconds(interval / 3f); - } - } - - TestPeaceMakerBullet CreateBullet(Vector2 dir, float speed, float lifeTime) - { - TestPeaceMakerBullet bullet = Instantiate<TestPeaceMakerBullet>(m_Bullet); - - bullet.transform.position = m_Arrow.transform.position + new Vector3(m_AimDirection.x, m_AimDirection.y, 0) * -0.3f; - - bullet.Set(dir, speed, lifeTime); - bullet.gameObject.SetActive(true); - - return bullet; - } - } diff --git a/SurvivalTest/Assets/Scripts/UI/Panel/PanelEquipBar/UIEquipWidget.cs b/SurvivalTest/Assets/Scripts/UI/Panel/PanelEquipBar/UIEquipWidget.cs index bccd322..14c8717 100644 --- a/SurvivalTest/Assets/Scripts/UI/Panel/PanelEquipBar/UIEquipWidget.cs +++ b/SurvivalTest/Assets/Scripts/UI/Panel/PanelEquipBar/UIEquipWidget.cs @@ -11,6 +11,7 @@ public struct UIEquipWidgetParam public class UIEquipWidget : UIGridItemBase { public Image Image_Icon; + public Image Image_CD; public EquipBase equip { get { return m_Equip; } } private EquipBase m_Equip; @@ -21,6 +22,16 @@ public class UIEquipWidget : UIGridItemBase m_Equip = info.equip; Image_Icon.sprite = ResourceManager.Instance.Load<Sprite>(info.equip.iconPath); + } + private void Update() + { + if(equip.autoMode == EquipBase.AutoMode.Interval) + { + float countDown = TinyCountDown.Instance.Get(equip.GetHashCode().ToString()); + float t = countDown / equip.interval; + Image_CD.fillAmount = t; + } } + }
\ No newline at end of file diff --git a/SurvivalTest/Assets/Scripts/Unit/Crew/CrewScript.cs b/SurvivalTest/Assets/Scripts/Unit/Crew/CrewScript.cs index 4993cd7..348e793 100644 --- a/SurvivalTest/Assets/Scripts/Unit/Crew/CrewScript.cs +++ b/SurvivalTest/Assets/Scripts/Unit/Crew/CrewScript.cs @@ -11,4 +11,7 @@ public class CrewScript : MonoBehaviour // Áñµ¯·¢Éä¿Ú£¨Èç¹ûÓеϰ£© public virtual Transform launchPoint { get; } + // ×¼ÐÇ£¨Èç¹ûÓеϰ£© + public virtual Transform arrow { get; } + } |