/// <summary> /// Konstruktor kopiuj¹cy. /// </summary> /// <param name="shot">Obiekt wzorcowy.</param> public Shot(Shot shot) { _shotGraphic = shot._shotGraphic.Clone(); _shotType = shot._shotType; _speed = shot._speed; _shootEnemy = shot._shootEnemy; }
public void OnShootEnemyDead(ShootEnemy shootEnemy) { amountOfShootEnemiesKilled++; if (amountOfShootEnemiesKilled >= shootEnemies.Count) { OpenDoor(); } }
// Use this for initialization void Start() { Control = GetComponent <AICharacterControl>(); //ty = Control.AIenemy; firerate = this; ddam = this; Trace = gameObject.GetComponent <LineRenderer>(); }
/// <summary> /// Konstruktor. /// </summary> /// <param name="shotType">Typ strza³u.</param> /// <param name="assetName">Œcie¿ka do zasobu grafiki strza³u.</param> /// <param name="shootEnemy">Funkcja zestrzelenia wroga.</param> public Shot(ShotType shotType, string assetName, ShootEnemy shootEnemy) { _shotType = shotType; _shotGraphic = new AnimatedGraphic(); _speed = 14; _shootSomething = false; LoadContent(Window.Context.Content, assetName); _shootEnemy = shootEnemy; }
private void OnCollide(Collider2D col) { ShootEnemy shootEnemy = col.gameObject.GetComponent <ShootEnemy>(); Dude dude = col.gameObject.GetComponent <Dude>(); if (dude) { dude.OnShot(); } if (shootEnemy) { isActive = false; shootEnemy.OnHit(); OnExplode(); Destroy(this.gameObject); } }
// Use this for initialization void Start() { radius = gameObject.GetComponent <CircleCollider2D> ().radius; shootEnemy = transform.parent.GetComponent <ShootEnemy>(); }
void Start() { shootEnemy = FindObjectOfType <ShootEnemy>(); }