Пример #1
0
    void Shoot()
    {
        GameObject        myBullet        = Instantiate(bullet, _firePoint.position, Quaternion.identity);
        BulletController2 bulletComponent = myBullet.GetComponent <BulletController2>();

        bulletComponent.direction = new Vector2(-2, -1);
    }
    protected void AddOwner(GameObject spawnedObject)
    {
        BulletController2 bullet = spawnedObject.GetComponent <BulletController2>();

        if (bullet)
        {
            bullet.owner = GetComponent <SkillController2>().owner;
        }
    }
 private void Awake()
 {
     bulletController = GetComponent <BulletController2>();
 }