Exemplo n.º 1
0
    void Launch()
    {
        GameObject bulletObject = Instantiate(bulletPrefab, rigidbody.position, Quaternion.identity);

        GonzalezBullet bulletCopy = bulletObject.GetComponent <GonzalezBullet>();

        bulletCopy.Launch(lookDir, 300f);

        animator.SetTrigger("Launch");
    }
Exemplo n.º 2
0
    void shoot(Vector2 shooter, Vector2 target)
    {
        Vector2    direction    = target - shooter;
        GameObject bulletObject = Instantiate(bulletPrefab, shooter, Quaternion.identity);

        GonzalezBullet bulletCopy = bulletObject.GetComponent <GonzalezBullet>();

        bulletCopy.Launch(direction, 300f);

        //animator.SetTrigger("Launch");
    }