示例#1
0
    protected override void Attack()
    {
        base.Attack();

        AttackSphere pojectale = Instantiate(bullet, Direction.position, transform.rotation);

        pojectale.GetComponent <Rigidbody2D>().AddForce((Direction.position - transform.position).normalized * bulletSpeed);
    }
示例#2
0
    public void LaunchBullet(Vector3 target)
    {
        AttackSphere pojectale = Instantiate(bullet, transform.position, Quaternion.identity);

        Debug.Log("start pos " + pojectale.transform.position);
        Debug.Log("end pos " + target);
        pojectale.GetComponent <Rigidbody2D>().AddForce(target.normalized * bulletSpeed);
    }