void OnCollisionEnter2D(Collision2D other) { Wand buf_wand = other.gameObject.GetComponent <Wand>( ); if (buf_wand != null) { _have_wand = buf_wand._wand_kind; Destroy(other.gameObject); } if (_have_key == false) { if (other.gameObject.tag == "key") { _have_key = true; Destroy(other.gameObject); } } }
public bool isWand(HavingWand wand) { return(wand == _have_wand); }
private void deleteWand( ) { _have_wand = HavingWand.none; }