Example #1
0
File: Shot.cs Project: kubek96/PI
 /// <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;
 }
Example #2
0
    public void OnShootEnemyDead(ShootEnemy shootEnemy)
    {
        amountOfShootEnemiesKilled++;

        if (amountOfShootEnemiesKilled >= shootEnemies.Count)
        {
            OpenDoor();
        }
    }
Example #3
0
    // Use this for initialization
    void Start()
    {
        Control = GetComponent <AICharacterControl>();
        //ty = Control.AIenemy;
        firerate = this;
        ddam     = this;

        Trace = gameObject.GetComponent <LineRenderer>();
    }
Example #4
0
File: Shot.cs Project: kubek96/PI
 /// <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;
 }
Example #5
0
    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);
        }
    }
Example #6
0
 // Use this for initialization
 void Start()
 {
     radius     = gameObject.GetComponent <CircleCollider2D> ().radius;
     shootEnemy = transform.parent.GetComponent <ShootEnemy>();
 }
Example #7
0
 void Start()
 {
     shootEnemy = FindObjectOfType <ShootEnemy>();
 }