コード例 #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Egg" && gameObject.activeSelf)
     {
         shooterObj.SetState(STATE.IDLE);
         shooterObj.randomEgg = true;
         playfieldObj.AttachEggOnGrid(collision.gameObject, this.gameObject);
         transform.position = new Vector3(2.5f, -7.48f, 0.0f); // reset position
         gameObject.SetActive(false);
     }
     else if (collision.tag == "HazardFire" && gameObject.activeSelf)
     {
         shooterObj.SetState(STATE.IDLE);
         shooterObj.randomEgg = true;
         mEggAnimation.GetComponent <EggAnimationHandler>().AddBrokenEggFireHazard(this, gameObject.transform.position);
         transform.position = new Vector3(2.5f, -7.48f, 0.0f); // reset position
         gameObject.SetActive(false);
     }
 }