Commit fa1e1c3c authored by 15박보승's avatar 15박보승

BulletFactory 변경

parent 1c531be9
...@@ -11,16 +11,13 @@ public enum BulletCode ...@@ -11,16 +11,13 @@ public enum BulletCode
public class BulletFactory public class BulletFactory
{ {
public bool isInit = false; private GameObject truthBulletPrefab = null, fakeBulletPrefab = null, mirrorBulletPrefab = null;
public static GameObject truthBulletPrefab = null, fakeBulletPrefab = null, mirrorBulletPrefab = null;
public BulletFactory() public BulletFactory(GameObject truthBullet, GameObject fakeBullet, GameObject mirrorBullet)
{ {
if (isInit) truthBulletPrefab = truthBullet;
return; fakeBulletPrefab = fakeBullet;
truthBulletPrefab = Resources.Load<GameObject>("Prefabs/Bullets/TruthBullet"); mirrorBulletPrefab = mirrorBullet;
fakeBulletPrefab = Resources.Load<GameObject>("Prefabs/Bullets/FakeBullet");
mirrorBulletPrefab = Resources.Load<GameObject>("Prefabs/Bullets/MirrorBullet");
} }
/// <summary> /// <summary>
...@@ -28,7 +25,7 @@ public class BulletFactory ...@@ -28,7 +25,7 @@ public class BulletFactory
/// </summary> /// </summary>
/// <param name="bulletCode">Type of bullet that wants to make</param> /// <param name="bulletCode">Type of bullet that wants to make</param>
/// <returns></returns> /// <returns></returns>
public static Bullet MakeBullet(BulletCode bulletCode) public Bullet MakeBullet(BulletCode bulletCode)
{ {
switch (bulletCode) switch (bulletCode)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment