private void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Item") { GameObject go = other.gameObject; DropBase drop = go.GetComponent <DropBase>(); if (drop == null) { return; } else if (drop.itemDrop.PickUpWhenInRange()) { takeItem(drop); } } }
protected override void StartInit() { base.StartInit(); this.SetCollider(true); switch (GameLogic.Hold.BattleData.GetMode()) { case GameMode.eChallenge101: case GameMode.eChallenge102: case GameMode.eChallenge103: case GameMode.eChallenge104: this.mDrop = new DropChallenge101(); break; case GameMode.eGold1: this.mDrop = new DropGold(); break; default: this.mDrop = new DropDefault(); break; } this.mDrop.Init(this.m_SoldierData, base.m_EntityData.MaxHP); }