Skip to content

Commit 61e59e9

Browse files
committed
feat: new weapon
round shot weapon can purchased in the shop
1 parent 990eb1d commit 61e59e9

File tree

15 files changed

+636
-6
lines changed

15 files changed

+636
-6
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!1 &227399658643498932
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: 5488743611133324747}
12+
- component: {fileID: 7549832020881850003}
13+
m_Layer: 0
14+
m_Name: player_projectile_round_shot
15+
m_TagString: Untagged
16+
m_Icon: {fileID: 0}
17+
m_NavMeshLayer: 0
18+
m_StaticEditorFlags: 0
19+
m_IsActive: 1
20+
--- !u!4 &5488743611133324747
21+
Transform:
22+
m_ObjectHideFlags: 0
23+
m_CorrespondingSourceObject: {fileID: 0}
24+
m_PrefabInstance: {fileID: 0}
25+
m_PrefabAsset: {fileID: 0}
26+
m_GameObject: {fileID: 227399658643498932}
27+
serializedVersion: 2
28+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
29+
m_LocalPosition: {x: 126.49457, y: 589.6237, z: -2.5083663}
30+
m_LocalScale: {x: 1, y: 1, z: 1}
31+
m_ConstrainProportionsScale: 0
32+
m_Children: []
33+
m_Father: {fileID: 0}
34+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
35+
--- !u!114 &7549832020881850003
36+
MonoBehaviour:
37+
m_ObjectHideFlags: 0
38+
m_CorrespondingSourceObject: {fileID: 0}
39+
m_PrefabInstance: {fileID: 0}
40+
m_PrefabAsset: {fileID: 0}
41+
m_GameObject: {fileID: 227399658643498932}
42+
m_Enabled: 1
43+
m_EditorHideFlags: 0
44+
m_Script: {fileID: 11500000, guid: 8b8128b909ad1b948a7af997009d8669, type: 3}
45+
m_Name:
46+
m_EditorClassIdentifier:
47+
default_projectile: {fileID: 6289194308112020401, guid: 184e53708a9fbf44db2da85a2173e207, type: 3}

Assets/Resources/Prefabs/Player Projectiles/player_projectile_round_shot.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.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using UnityEngine;
2+
3+
public class ProjectileRoundShot : MonoBehaviour
4+
{
5+
[SerializeField] GameObject default_projectile;
6+
7+
void Start()
8+
{
9+
RoundShot();
10+
}
11+
12+
private void RoundShot()
13+
{
14+
InstanceProjectile(default_projectile, new Vector2(1, 1));
15+
InstanceProjectile(default_projectile, new Vector2(1, -1));
16+
InstanceProjectile(default_projectile, new Vector2(-1, 1));
17+
InstanceProjectile(default_projectile, new Vector2(-1, -1));
18+
InstanceProjectile(default_projectile, Vector2.right);
19+
InstanceProjectile(default_projectile, Vector2.left);
20+
InstanceProjectile(default_projectile, Vector2.down);
21+
InstanceProjectile(default_projectile, Vector2.up);
22+
}
23+
24+
private void InstanceProjectile(GameObject projectile, Vector2 move_direction)
25+
{
26+
ProjctileDefaultLogic projectile_script = projectile.GetComponent<ProjctileDefaultLogic>();
27+
28+
if (projectile_script != null)
29+
{
30+
projectile_script.SetMoveDirection(move_direction);
31+
Instantiate(projectile, transform.position, Quaternion.identity);
32+
}
33+
}
34+
}

Assets/Scripts/Asteroids/Projectiles/ProjectileRoundShot.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.

Assets/Scripts/Save System/GameData.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public class GameData
1515
public bool dual_shot_unlocked;
1616
public bool trippl_shot_unlocked;
1717
public bool sniper_unlocked;
18+
public bool round_shot_unlocked;
1819

1920
//* ability stats
2021
public string ability_scriptableobject_path;
@@ -45,6 +46,7 @@ public GameData(
4546
bool dual_shot_unlocked,
4647
bool trippl_shot_unlocked,
4748
bool sniper_unlocked,
49+
bool round_shot_unlocked,
4850

4951
string ability_scriptableobject_path,
5052
bool boss_dash_unlocked,
@@ -71,6 +73,7 @@ public GameData(
7173
this.dual_shot_unlocked = dual_shot_unlocked;
7274
this.trippl_shot_unlocked = trippl_shot_unlocked;
7375
this.sniper_unlocked = sniper_unlocked;
76+
this.round_shot_unlocked = round_shot_unlocked;
7477

7578
this.ability_scriptableobject_path = ability_scriptableobject_path;
7679
this.boss_dash_unlocked = boss_dash_unlocked;
@@ -100,6 +103,7 @@ public GameData(GameData game_data)
100103
dual_shot_unlocked = game_data.dual_shot_unlocked;
101104
trippl_shot_unlocked = game_data.trippl_shot_unlocked;
102105
sniper_unlocked = game_data.sniper_unlocked;
106+
round_shot_unlocked = game_data.round_shot_unlocked;
103107

104108
ability_scriptableobject_path = game_data.ability_scriptableobject_path;
105109
boss_dash_unlocked = game_data.boss_dash_unlocked;

Assets/Scripts/Save System/SaveSystem.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public static class SaveSystem
1616
static bool DUAL_SHOT_UNLOCKED;
1717
static bool TRIPPLE_SHOT_UNLOCKED;
1818
static bool SNIPER_UNLOCKED;
19+
static bool ROUND_SHOT_UNLOCKED;
1920

2021
//* ability stats
2122
static string ABILITY_PREFAB_PATH = "Scriptableobjects/Abilities/dash_ability";
@@ -80,6 +81,7 @@ public static GameData Load()
8081
DUAL_SHOT_UNLOCKED,
8182
TRIPPLE_SHOT_UNLOCKED,
8283
SNIPER_UNLOCKED,
84+
ROUND_SHOT_UNLOCKED,
8385

8486
ABILITY_PREFAB_PATH,
8587
BOSS_DASH_UNLOCKED,
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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: 8243da5405db3e84b9d83a1e6b8a39d0, type: 3}
13+
m_Name: 04_round_shot_weapon
14+
m_EditorClassIdentifier:
15+
card_name: ROUND SHOT
16+
upgrade_type: 6
17+
cost_multiplier: 0
18+
upgrade_value: 0
19+
max_upgrade_stat: 0
20+
current_stat: 0
21+
upgrade_cost: 0
22+
weapon_prefab_path: Prefabs/Player Projectiles/player_projectile_round_shot
23+
weapon_cost: 10000
24+
is_unlocked_weapon: 1
25+
ability_scriptableobject_path:
26+
ability_cost: 0
27+
is_unlocked_ability: 0

Assets/Scripts/Shop/Cards/Weapons/04_round_shot_weapon.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/Shop/Cards/Weapons/04_dual_weapon.asset renamed to Assets/Scripts/Shop/Cards/Weapons/05_dual_weapon.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ MonoBehaviour:
1010
m_Enabled: 1
1111
m_EditorHideFlags: 0
1212
m_Script: {fileID: 11500000, guid: 08dd5a6ddfdd25a4f95d18e9f7d48570, type: 3}
13-
m_Name: 04_dual_weapon
13+
m_Name: 05_dual_weapon
1414
m_EditorClassIdentifier:
1515
card_name: DUAL SHOT
1616
upgrade_type: 6

Assets/Scripts/Shop/Cards/Weapons/04_dual_weapon.asset.meta renamed to Assets/Scripts/Shop/Cards/Weapons/05_dual_weapon.asset.meta

File renamed without changes.

0 commit comments

Comments
 (0)