Example #1
0
    void Shot()
    {
        GameObject InstCannon = Instantiate(cannonBallPref, ShootPart.transform.position, Quaternion.identity) as GameObject;

        CannonBall cannonScrpt = InstCannon.GetComponent <CannonBall>();

        if (cannonScrpt != null)
        {
            cannonScrpt.SearchEnemy(target);
        }
    }