/// <summary> /// Instantiates a new bullet /// </summary> /// <param name="pos">Position, where to instantiate the Bullet</param> /// <param name="dir">Direction in which the bullet should move</param> /// <param name="speed">speed of the Bullet</param> /// <param name="dmg">Damage the bullet should deal</param> /// <param name="bulletType">Determines if the bullet is friendly or hostile</param> public static Bullet InstantiateBullet(Vector3 pos, Vector3 dir, BulletStat bs, BulletType bulletType) { GameObject bulletPrefab = Resources.Load <GameObject>("BulletPrefab"); Bullet bullet = GameObject.Instantiate(bulletPrefab, pos, Quaternion.identity).GetComponent <Bullet>(); bullet.bullet = bs; bullet._dir = dir; bullet._BulletType = bulletType; return(bullet); }
public BulletBehavior() { bulletStat = new BulletStat(0, 0); //프로퍼티는 무조건 생성자, start에서 하면 오류 걸림 }
public BulletBehavior() //꼭 생성자안에서 bulletStat을 초기화해줘야함 { bulletStat = new BulletStat(0, 0); }
public BulletBehavior() { bulletStat = new BulletStat(0, 0); }
private void Awake() { m_stat = GetComponent <BulletStat>(); }
public BulletBehavior() { bulletStat = new BulletStat(0, 0);//생성자에서 꼭 초기화 해야함! }
public bulletBehavior() { bulletStat = new BulletStat(0, 0); // Start 함수전에 초기화하도록 하자 }