Skip to content

Commit ef7ce3c

Browse files
committed
chore: make the unity package
1 parent 8cfa57f commit ef7ce3c

37 files changed

+2912
-397
lines changed
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ public class Gun : MonoBehaviour
99
ObjectPooler pool;
1010
InputSystem_Actions input;
1111

12-
public List<gunObject> gunTypes;
13-
public gunObject activeGun;
12+
public List<GunIScriptableObject> gunTypes;
13+
GunIScriptableObject activeGun;
1414

15-
public bool isReloading = false;
16-
public int currAmmo = 0;
15+
bool isReloading = false;
16+
int currAmmo = 0;
1717

1818
float canFire, fireInput = 0;
1919

2020
[SerializeField] Vector3 reloadRotation;
21-
public Transform gunParent;
21+
[SerializeField] Transform gunParent;
2222
AudioSource audioSource;
2323

2424
[Header("Objects")]
@@ -33,14 +33,14 @@ private void Start()
3333
input = new InputSystem_Actions();
3434
audioSource = GetComponent<AudioSource>();
3535

36-
//gunTypes[Random.Range(0, gunTypes.Count)].active = true;
36+
//gunTypes[Random.Range(0, gunTypes.Count)].active = true; //To get a random gun type
3737

38-
foreach (gunObject item in gunTypes)
38+
foreach (GunIScriptableObject item in gunTypes)
3939
{
4040
if (item.active)
4141
{
4242
activeGun = item;
43-
//item.active = false;
43+
//item.active = false; //To save the last active gun
4444
break;
4545
}
4646
}
@@ -129,7 +129,6 @@ IEnumerator reloading()
129129

130130
yield return new WaitForSeconds(activeGun.reloadTime);
131131
isReloading = false;
132-
//yield return new WaitForSeconds(.25f);
133132

134133
currAmmo = activeGun.ammo;
135134
}
File renamed without changes.

Assets/Basic Weapons/gunObject.cs renamed to Assets/Basic Projectile Gun System/GunIScriptableObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using UnityEngine;
66

77
[CreateAssetMenu(menuName = "Gun Object", order = 0)]
8-
public class gunObject : Stats
8+
public class GunIScriptableObject : Stats
99
{
1010
public GameObject gun;
1111

Assets/Basic Weapons/gunObject.cs.meta renamed to Assets/Basic Projectile Gun System/GunIScriptableObject.cs.meta

File renamed without changes.
File renamed without changes.
File renamed without changes.

Assets/Defaults/Scenes/SampleScene.unity

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,89 @@ Transform:
308308
m_Children: []
309309
m_Father: {fileID: 0}
310310
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
311+
--- !u!1 &1642966618
312+
GameObject:
313+
m_ObjectHideFlags: 0
314+
m_CorrespondingSourceObject: {fileID: 0}
315+
m_PrefabInstance: {fileID: 0}
316+
m_PrefabAsset: {fileID: 0}
317+
serializedVersion: 6
318+
m_Component:
319+
- component: {fileID: 1642966621}
320+
- component: {fileID: 1642966620}
321+
- component: {fileID: 1642966619}
322+
m_Layer: 0
323+
m_Name: EventSystem
324+
m_TagString: Untagged
325+
m_Icon: {fileID: 0}
326+
m_NavMeshLayer: 0
327+
m_StaticEditorFlags: 0
328+
m_IsActive: 1
329+
--- !u!114 &1642966619
330+
MonoBehaviour:
331+
m_ObjectHideFlags: 0
332+
m_CorrespondingSourceObject: {fileID: 0}
333+
m_PrefabInstance: {fileID: 0}
334+
m_PrefabAsset: {fileID: 0}
335+
m_GameObject: {fileID: 1642966618}
336+
m_Enabled: 1
337+
m_EditorHideFlags: 0
338+
m_Script: {fileID: 11500000, guid: 01614664b831546d2ae94a42149d80ac, type: 3}
339+
m_Name:
340+
m_EditorClassIdentifier:
341+
m_SendPointerHoverToParent: 1
342+
m_MoveRepeatDelay: 0.5
343+
m_MoveRepeatRate: 0.1
344+
m_XRTrackingOrigin: {fileID: 0}
345+
m_ActionsAsset: {fileID: -944628639613478452, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
346+
m_PointAction: {fileID: -1654692200621890270, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
347+
m_MoveAction: {fileID: -8784545083839296357, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
348+
m_SubmitAction: {fileID: 392368643174621059, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
349+
m_CancelAction: {fileID: 7727032971491509709, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
350+
m_LeftClickAction: {fileID: 3001919216989983466, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
351+
m_MiddleClickAction: {fileID: -2185481485913320682, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
352+
m_RightClickAction: {fileID: -4090225696740746782, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
353+
m_ScrollWheelAction: {fileID: 6240969308177333660, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
354+
m_TrackedDevicePositionAction: {fileID: 6564999863303420839, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
355+
m_TrackedDeviceOrientationAction: {fileID: 7970375526676320489, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
356+
m_DeselectOnBackgroundClick: 1
357+
m_PointerBehavior: 0
358+
m_CursorLockBehavior: 0
359+
m_ScrollDeltaPerTick: 6
360+
--- !u!114 &1642966620
361+
MonoBehaviour:
362+
m_ObjectHideFlags: 0
363+
m_CorrespondingSourceObject: {fileID: 0}
364+
m_PrefabInstance: {fileID: 0}
365+
m_PrefabAsset: {fileID: 0}
366+
m_GameObject: {fileID: 1642966618}
367+
m_Enabled: 1
368+
m_EditorHideFlags: 0
369+
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
370+
m_Name:
371+
m_EditorClassIdentifier:
372+
m_FirstSelected: {fileID: 0}
373+
m_sendNavigationEvents: 1
374+
m_DragThreshold: 10
375+
--- !u!4 &1642966621
376+
Transform:
377+
m_ObjectHideFlags: 0
378+
m_CorrespondingSourceObject: {fileID: 0}
379+
m_PrefabInstance: {fileID: 0}
380+
m_PrefabAsset: {fileID: 0}
381+
m_GameObject: {fileID: 1642966618}
382+
serializedVersion: 2
383+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
384+
m_LocalPosition: {x: 0, y: 0, z: 0}
385+
m_LocalScale: {x: 1, y: 1, z: 1}
386+
m_ConstrainProportionsScale: 0
387+
m_Children: []
388+
m_Father: {fileID: 0}
389+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
311390
--- !u!1660057539 &9223372036854775807
312391
SceneRoots:
313392
m_ObjectHideFlags: 0
314393
m_Roots:
315394
- {fileID: 963194228}
316395
- {fileID: 705507995}
396+
- {fileID: 1642966621}

Assets/Inventory.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.

0 commit comments

Comments
 (0)