public void CreateArrow(Bow.BowPkg bowPkg) { arrowCount++; Arrow go = GameObject.Instantiate(Bow.arrowGo).GetComponent <Arrow>(); arrowList.Add(go); go.Init(bowPkg); }
public void Init(Bow.BowPkg bowPkg) { arrowStats = bowPkg; if (arrowStats.layerToHit == 0) { Debug.Log(""); } isTravelling = true; rb = GetComponent <Rigidbody2D>(); rb.velocity = arrowStats.dir * arrowStats.arrowSpeed * arrowStats.speedModifier; transform.position = arrowStats.owner.transform.position; transform.eulerAngles = new Vector3(0, 0, arrowStats.dir.ToAngle()); //Debug.Log("Ang: " + arrowStats.dir.ToAngle()); }