Exemplo n.º 1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Enemy")
     {
         Debug.Log("Here x Plane: OnTriggerEnter2D");
         mPlanesTouched       = mPlanesTouched + 1;
         mEnemyCountText.text = "Planes touched: " + mPlanesTouched;
         Destroy(collision.gameObject);
         mGlobalBehavior.EnemyDestroyed();
     }
 }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        //transform.position += (mSpeed * Time.smoothDeltaTime) * transform.up;
        //GlobalBehavior globalBehavior = GameObject.Find("GameManager").GetComponent<GlobalBehavior>();

        Move();

        if (health == 0)
        {
            Destroy(gameObject);
            mGlobalBehavior.EnemyDestroyed();
        }
    }