Example #1
0
    /// <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);
    }
Example #2
0
 public BulletBehavior()
 {
     bulletStat = new BulletStat(0, 0); //프로퍼티는 무조건 생성자, start에서 하면 오류 걸림
 }
 public BulletBehavior() //꼭 생성자안에서 bulletStat을 초기화해줘야함
 {
     bulletStat = new BulletStat(0, 0);
 }
Example #4
0
 public BulletBehavior()
 {
     bulletStat = new BulletStat(0, 0);
 }
Example #5
0
 private void Awake()
 {
     m_stat = GetComponent <BulletStat>();
 }
Example #6
0
 public BulletBehavior()
 {
     bulletStat = new BulletStat(0, 0);//생성자에서 꼭 초기화 해야함!
 }
Example #7
0
 public bulletBehavior()
 {
     bulletStat = new BulletStat(0, 0); // Start 함수전에 초기화하도록 하자
 }