private void OnTriggerEnter(Collider other) { if (other.CompareTag("PlayerBullet") || other.CompareTag("EnemyBullet")) { BulletPulling.Enqueue(other.transform); } }
private void FixedUpdate() { // Debug.Log("BulletScript Updating"); if (liveTime > 0) { // Debug.Log("BulletScript if pass"); transform.Translate(Vector3.forward * Time.deltaTime * speed, Space.Self); liveTime -= Time.deltaTime; } else { BulletPulling.Enqueue(transform); } }
private void OnTriggerEnter(Collider other) { switch (other.gameObject.tag) { case "EnemyBullet": BulletPulling.Enqueue(other.transform); Damage(); break; case "Enemy": Damage(); break; case "Food": LevelUp(); other.gameObject.SetActive(false); break; default: break; } }
protected void Attacked(float power, GameObject obj) { BulletPulling.Enqueue(obj.transform); hp -= power; }