Esempio n. 1
0
    public void CreateArrow(Bow.BowPkg bowPkg)
    {
        arrowCount++;
        Arrow go = GameObject.Instantiate(Bow.arrowGo).GetComponent <Arrow>();

        arrowList.Add(go);
        go.Init(bowPkg);
    }
Esempio n. 2
0
    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());
    }