void OnTriggerEnter(Collider col) { if (col.tag == "Bullet") { BulletCtrl ctrl = col.gameObject.GetComponent <BulletCtrl>(); if (ctrl.userID != m_userdata.userID) { ctrl.SendHit(); } } }
void OnTriggerEnter(Collider col) { if (col.tag == "Bullet") { BulletCtrl ctrl = col.gameObject.GetComponent <BulletCtrl>(); ctrl.SendHit(); } else if (col.tag == "BulletTrigger") { AkiVACO.XLogger.Log("Hit!"); BulletTrigger tr = col.GetComponent <BulletTrigger>(); if (m_unit.AddCharm(tr.userID, tr.charm)) { this.transform.GetChild(0).GetComponent <MeshMaterialCtrl>().SetMaterial(m_unit.topUserId + 1); // -1 -> 0 } OnHitBullet(); } if (col.tag == "AttractField") { SetAttractField(col.gameObject); // TODO } }