diff --git a/Assets/Prefabs/Bug.prefab b/Assets/Prefabs/Bug.prefab index 1217291..398b9a0 100644 --- a/Assets/Prefabs/Bug.prefab +++ b/Assets/Prefabs/Bug.prefab @@ -11,6 +11,21 @@ Prefab: m_ParentPrefab: {fileID: 0} m_RootGameObject: {fileID: 1887677565572348} m_IsPrefabParent: 1 +--- !u!1 &1259125736160938 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4528190223728408} + m_Layer: 9 + m_Name: bulletspawn + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1310248020783766 GameObject: m_ObjectHideFlags: 1 @@ -87,6 +102,19 @@ Transform: m_Father: {fileID: 4665188581213052} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4528190223728408 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1259125736160938} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.319, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4665188581213052} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4665188581213052 Transform: m_ObjectHideFlags: 1 @@ -98,6 +126,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 4193287044024648} + - {fileID: 4528190223728408} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -151,6 +180,8 @@ MonoBehaviour: rotationSpeed: 1 victim: {fileID: 0} body: {fileID: 50033980456084712} + bulletSpawn: {fileID: 4528190223728408} + bullet: {fileID: 1379543051791382, guid: c6c321ecc6516374781405a54c1fa6a7, type: 2} --- !u!212 &212750371912380942 SpriteRenderer: m_ObjectHideFlags: 1 diff --git a/Assets/Scenes/CodeDEV.unity b/Assets/Scenes/CodeDEV.unity index 8177247..be416af 100644 --- a/Assets/Scenes/CodeDEV.unity +++ b/Assets/Scenes/CodeDEV.unity @@ -623,11 +623,6 @@ Prefab: propertyPath: m_IsActive value: 0 objectReference: {fileID: 0} - - target: {fileID: 60772848946696534, guid: 3d1911457c1e44f53b6b4044334db52f, - type: 2} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 3d1911457c1e44f53b6b4044334db52f, type: 2} m_IsPrefabParent: 0 diff --git a/Assets/Scripts/Entities/Attack/SingleShot.cs b/Assets/Scripts/Entities/Attack/SingleShot.cs index 08943e9..4fbb4fa 100644 --- a/Assets/Scripts/Entities/Attack/SingleShot.cs +++ b/Assets/Scripts/Entities/Attack/SingleShot.cs @@ -26,8 +26,10 @@ namespace Assets.Scripts.Entities.Attack { } public void Attack() { - if ( bulletPrefab == null ) + if ( bulletPrefab == null ) { + Debug.Log("SingleShot: No Prefab defined for Bullet!"); return; + } GameObject b = GameObject.Instantiate(bulletPrefab); b.transform.rotation = spawn.rotation; b.transform.position = spawn.position; diff --git a/Assets/Scripts/Entities/Bug.cs b/Assets/Scripts/Entities/Bug.cs index 34e2062..35dcc61 100644 --- a/Assets/Scripts/Entities/Bug.cs +++ b/Assets/Scripts/Entities/Bug.cs @@ -6,13 +6,20 @@ using Assets.Scripts.Entities.Attack; namespace Assets.Scripts.Entities { public class Bug : Enemy { + [SerializeField] + private Transform bulletSpawn; + [SerializeField] + private GameObject bullet; public Bug() : base(15) { } private void Start() { - SetAttack(new MeleeAttack(this.gameObject)); + SingleShot s = new SingleShot(this.gameObject); + s.SetPrefab(bullet); + s.SetSpawn(bulletSpawn); + SetAttack(s); } } } diff --git a/Assets/Scripts/Entities/Player.cs b/Assets/Scripts/Entities/Player.cs index 8d0816b..8652b93 100644 --- a/Assets/Scripts/Entities/Player.cs +++ b/Assets/Scripts/Entities/Player.cs @@ -7,8 +7,8 @@ public class Player : Mob { private GameObject bulletPrefab; [SerializeField] Transform bulletSpawn; - [SerializeField] - private int carDamage = 5; + //[SerializeField] + //private int carDamage = 5; private SingleShot singleShot; private GatlingGun ggun; diff --git a/Assets/Scripts/Generation/DungeonGenerator.cs b/Assets/Scripts/Generation/DungeonGenerator.cs index 913859d..4dddcfa 100644 --- a/Assets/Scripts/Generation/DungeonGenerator.cs +++ b/Assets/Scripts/Generation/DungeonGenerator.cs @@ -135,7 +135,7 @@ public class DungeonGenerator { } allDoors.UnionWith(r.AllDoors()); foreach ( Vector2Int v in r.AllDoors() ) { - Debug.Log("Door: " + v); + //Debug.Log("Door: " + v); if ( !r.bounds.Contains(v) ) throw new NotSupportedException("This is a bug where doors land in the wrong room. It should have been fixed."); else diff --git a/Assets/Scripts/Generation/GenerationProcessor.cs b/Assets/Scripts/Generation/GenerationProcessor.cs index 1654080..059fdc4 100644 --- a/Assets/Scripts/Generation/GenerationProcessor.cs +++ b/Assets/Scripts/Generation/GenerationProcessor.cs @@ -194,7 +194,6 @@ public class GenerationProcessor { return 90; toCheck = position + new Vector2Int(1, 0); return 0; - break; case ExtendedTileType.DoorInner: Vector2Int toCheckD = position + new Vector2Int(0, -1); if(tiles.ContainsKey(toCheckD) && tiles[toCheckD].type == Room.TileType.DOOR)