Пример #1
0
Файл: Shot.cs Проект: 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;
 }
Пример #2
0
    public void OnShootEnemyDead(ShootEnemy shootEnemy)
    {
        amountOfShootEnemiesKilled++;

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

        Trace = gameObject.GetComponent <LineRenderer>();
    }
Пример #4
0
Файл: Shot.cs Проект: 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;
 }
Пример #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);
        }
    }
Пример #6
0
 // Use this for initialization
 void Start()
 {
     radius     = gameObject.GetComponent <CircleCollider2D> ().radius;
     shootEnemy = transform.parent.GetComponent <ShootEnemy>();
 }
Пример #7
0
 void Start()
 {
     shootEnemy = FindObjectOfType <ShootEnemy>();
 }