void OnTriggerEnter2D(Collider2D other) { TileMapObject objUnit = other.GetComponent <TileMapObject>(); if (objUnit) { IDamageAble damageAbleObj = objUnit.GetComponentInParent <IDamageAble>(); if (damageAbleObj != null) { IAttackAble attackAble = actor as IAttackAble; if (damageAbleObj != null && attackAble != null) { damageAbleObj.OnDamage(attackAble.AttackPower, attackAble); } StopMove(); } if (!this.warpping) { Portal portal = objUnit.GetComponentInParent <Portal>(); if (portal) { EnterPortal(portal); } } if (!this.warpping) { EnterToOtherMap[] enterToOtherMapList = objUnit.GetComponentsInParent <EnterToOtherMap>(); if (enterToOtherMapList != null && enterToOtherMapList.Length > 0) { EnterToOtherMap enterToOtherMap = enterToOtherMapList[0]; enterToOtherMap.EnterBy(this.actor); } } } }