Skip to content

Commit 342b9d2

Browse files
committed
feat: new ability
working on the turret ability
1 parent a4987e7 commit 342b9d2

File tree

13 files changed

+295
-7
lines changed

13 files changed

+295
-7
lines changed

Assets/Prefabs/Player Adition.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!1 &2727780360183139143
4+
GameObject:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
serializedVersion: 6
10+
m_Component:
11+
- component: {fileID: 4416922372572164703}
12+
- component: {fileID: 300357918546832606}
13+
- component: {fileID: -3864110262965596585}
14+
- component: {fileID: -3916051911042084546}
15+
m_Layer: 0
16+
m_Name: turret
17+
m_TagString: Untagged
18+
m_Icon: {fileID: 0}
19+
m_NavMeshLayer: 0
20+
m_StaticEditorFlags: 0
21+
m_IsActive: 1
22+
--- !u!4 &4416922372572164703
23+
Transform:
24+
m_ObjectHideFlags: 0
25+
m_CorrespondingSourceObject: {fileID: 0}
26+
m_PrefabInstance: {fileID: 0}
27+
m_PrefabAsset: {fileID: 0}
28+
m_GameObject: {fileID: 2727780360183139143}
29+
serializedVersion: 2
30+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
31+
m_LocalPosition: {x: -3.71, y: -4.04, z: 0}
32+
m_LocalScale: {x: 0.5, y: 0.5, z: 1}
33+
m_ConstrainProportionsScale: 0
34+
m_Children: []
35+
m_Father: {fileID: 0}
36+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
37+
--- !u!212 &300357918546832606
38+
SpriteRenderer:
39+
m_ObjectHideFlags: 0
40+
m_CorrespondingSourceObject: {fileID: 0}
41+
m_PrefabInstance: {fileID: 0}
42+
m_PrefabAsset: {fileID: 0}
43+
m_GameObject: {fileID: 2727780360183139143}
44+
m_Enabled: 1
45+
m_CastShadows: 0
46+
m_ReceiveShadows: 0
47+
m_DynamicOccludee: 1
48+
m_StaticShadowCaster: 0
49+
m_MotionVectors: 1
50+
m_LightProbeUsage: 1
51+
m_ReflectionProbeUsage: 1
52+
m_RayTracingMode: 0
53+
m_RayTraceProcedural: 0
54+
m_RenderingLayerMask: 1
55+
m_RendererPriority: 0
56+
m_Materials:
57+
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
58+
m_StaticBatchInfo:
59+
firstSubMesh: 0
60+
subMeshCount: 0
61+
m_StaticBatchRoot: {fileID: 0}
62+
m_ProbeAnchor: {fileID: 0}
63+
m_LightProbeVolumeOverride: {fileID: 0}
64+
m_ScaleInLightmap: 1
65+
m_ReceiveGI: 1
66+
m_PreserveUVs: 0
67+
m_IgnoreNormalsForChartDetection: 0
68+
m_ImportantGI: 0
69+
m_StitchLightmapSeams: 1
70+
m_SelectedEditorRenderState: 0
71+
m_MinimumChartSize: 4
72+
m_AutoUVMaxDistance: 0.5
73+
m_AutoUVMaxAngle: 89
74+
m_LightmapParameters: {fileID: 0}
75+
m_SortingLayerID: 0
76+
m_SortingLayer: 0
77+
m_SortingOrder: 0
78+
m_Sprite: {fileID: -2413806693520163455, guid: a86470a33a6bf42c4b3595704624658b, type: 3}
79+
m_Color: {r: 1, g: 1, b: 1, a: 1}
80+
m_FlipX: 0
81+
m_FlipY: 0
82+
m_DrawMode: 0
83+
m_Size: {x: 1, y: 1}
84+
m_AdaptiveModeThreshold: 0.5
85+
m_SpriteTileMode: 0
86+
m_WasSpriteAssigned: 1
87+
m_MaskInteraction: 0
88+
m_SpriteSortPoint: 0
89+
--- !u!58 &-3864110262965596585
90+
CircleCollider2D:
91+
m_ObjectHideFlags: 0
92+
m_CorrespondingSourceObject: {fileID: 0}
93+
m_PrefabInstance: {fileID: 0}
94+
m_PrefabAsset: {fileID: 0}
95+
m_GameObject: {fileID: 2727780360183139143}
96+
m_Enabled: 1
97+
m_Density: 1
98+
m_Material: {fileID: 0}
99+
m_IncludeLayers:
100+
serializedVersion: 2
101+
m_Bits: 0
102+
m_ExcludeLayers:
103+
serializedVersion: 2
104+
m_Bits: 0
105+
m_LayerOverridePriority: 0
106+
m_ForceSendLayers:
107+
serializedVersion: 2
108+
m_Bits: 4294967295
109+
m_ForceReceiveLayers:
110+
serializedVersion: 2
111+
m_Bits: 4294967295
112+
m_ContactCaptureLayers:
113+
serializedVersion: 2
114+
m_Bits: 4294967295
115+
m_CallbackLayers:
116+
serializedVersion: 2
117+
m_Bits: 4294967295
118+
m_IsTrigger: 1
119+
m_UsedByEffector: 0
120+
m_UsedByComposite: 0
121+
m_Offset: {x: 0, y: 0}
122+
serializedVersion: 2
123+
m_Radius: 0.5
124+
--- !u!114 &-3916051911042084546
125+
MonoBehaviour:
126+
m_ObjectHideFlags: 0
127+
m_CorrespondingSourceObject: {fileID: 0}
128+
m_PrefabInstance: {fileID: 0}
129+
m_PrefabAsset: {fileID: 0}
130+
m_GameObject: {fileID: 2727780360183139143}
131+
m_Enabled: 1
132+
m_EditorHideFlags: 0
133+
m_Script: {fileID: 11500000, guid: 3c0e6b82feaef824f83351ea96bf47d7, type: 3}
134+
m_Name:
135+
m_EditorClassIdentifier:
136+
player_default_projectile: {fileID: 6289194308112020401, guid: 184e53708a9fbf44db2da85a2173e207, type: 3}
137+
max_life_time: 4
138+
min_life_time: 5
139+
tag_to_detect: Asteroid
140+
detect_radius: 15

Assets/Prefabs/Player Adition/turret.prefab.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Resources/Scriptableobjects/Abilities/boss_dash_ability.asset

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ MonoBehaviour:
1414
m_EditorClassIdentifier:
1515
name: BOSS DASH
1616
DEFAULT_COOLDOWN: 1
17-
COOLDOWN: 0
17+
COOLDOWN: 1
1818
DURATION: 0.1
1919
dash_particles: {fileID: 1680149101079458943, guid: 4fc65d1314c914f4398fdd4b0338d383, type: 3}
2020
DASH_SPEED: 50
2121
DASH_DISTANCE: 3
22+
player_default_projectile: {fileID: 6289194308112020401, guid: 184e53708a9fbf44db2da85a2173e207, type: 3}

Assets/Resources/Scriptableobjects/Abilities/dash_ability.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ MonoBehaviour:
1414
m_EditorClassIdentifier:
1515
name: DASH
1616
DEFAULT_COOLDOWN: 1
17-
COOLDOWN: 1
17+
COOLDOWN: 0
1818
DURATION: 0.1
1919
dash_particles: {fileID: 1680149101079458943, guid: 4fc65d1314c914f4398fdd4b0338d383, type: 3}
2020
DASH_SPEED: 50
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!114 &11400000
4+
MonoBehaviour:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
m_GameObject: {fileID: 0}
10+
m_Enabled: 1
11+
m_EditorHideFlags: 0
12+
m_Script: {fileID: 11500000, guid: d866ef94dc9c8e6459bce552fa60644c, type: 3}
13+
m_Name: turret_ability
14+
m_EditorClassIdentifier:
15+
name: TURRET
16+
DEFAULT_COOLDOWN: 1
17+
COOLDOWN: 1
18+
DURATION: 0.1
19+
particles: {fileID: 1680149101079458943, guid: 4fc65d1314c914f4398fdd4b0338d383, type: 3}
20+
turret: {fileID: 2727780360183139143, guid: f6b6d48d35da2ac4f971760c2eb37725, type: 3}

Assets/Resources/Scriptableobjects/Abilities/turret_ability.asset.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Player/Ability/AbilityHolder.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
using Unity.VisualScripting;
21
using UnityEngine;
32

43
public class AbilityHolder : MonoBehaviour
54
{
6-
[HideInInspector] public Ability ability;
5+
[SerializeField] public Ability ability;
76
[SerializeField] AbilityCooldownLogic ability_cooldown_logic;
87
float cooldown;
98
float duration;
@@ -63,14 +62,14 @@ void Update()
6362

6463
private void Load()
6564
{
66-
GameData game_data = SaveSystem.Load();
65+
/*GameData game_data = SaveSystem.Load();
6766
string path = game_data.ability_scriptableobject_path;
6867
ability = Resources.Load(path) as Ability;
6968
7069
if (ability == null)
7170
{
7271
Debug.LogError("Failed to load weapon prefab from path: " + path);
73-
}
72+
}*/
7473

7574
ability.COOLDOWN = ability.DEFAULT_COOLDOWN;
7675
Debug.Log(ability.name);
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using UnityEngine;
2+
3+
[CreateAssetMenu(fileName = "_ability", menuName = "Ability/Turret")]
4+
public class Turret : Ability
5+
{
6+
[SerializeField] ParticleSystem particles;
7+
[SerializeField] GameObject turret;
8+
9+
public override void Activate(GameObject parent)
10+
{
11+
Rigidbody2D rigidbody = parent.GetComponent<Rigidbody2D>();
12+
13+
SpawnParticles(particles, rigidbody.position);
14+
Instantiate(turret, rigidbody.position, Quaternion.identity);
15+
}
16+
}

Assets/Scripts/Player/Ability/Turret.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)