public void OnTriggerEnter2D(Collider2D collision) { TileData collidedTile = collision.GetComponent <TileData>(); if (collidedTile != null) { if (collidedTile is Actor collidedActorWithMyHead) { if (!collidedActorWithMyHead.isPushed && !collidedActorWithMyHead.isPhysicsControlled) { if (pU.gameObjectInstanceId != collidedActorWithMyHead.gameObject.GetInstanceID() && pU.ownerId != collidedActorWithMyHead.ownerId) { if (collidedActorWithMyHead is MirrorKnight) { DealProjectileOnMirrorKnight(collidedActorWithMyHead); } else { DealProjectileOnActor(collidedActorWithMyHead); } } } } } ClientEnemyManager clientEnemyManager = collision.GetComponent <ClientEnemyManager>(); if (clientEnemyManager != null) { if (selfDestroyOnTargetTouch) { if (pU.projectileTypeThrown == EnumData.Projectiles.FireBall) { if (clientEnemyManager.enemyType == EnumData.MonsterBreed.MirrorKnight) { if (GridManager.instance.IsPureHeadOn(transform.position, clientEnemyManager)) { Destroy(gameObject); } else if (GridManager.instance.IsPureBackOrSideStab(transform.position, clientEnemyManager)) { GridManager.instance.Disperse( dispersedGO , dispersionRadius , dispersionSpeed , pU.ownerId , GridManager.instance.grid.WorldToCell(transform.position)); Destroy(gameObject); } } else { GridManager.instance.Disperse( dispersedGO , dispersionRadius , dispersionSpeed , pU.ownerId , GridManager.instance.grid.WorldToCell(transform.position)); Destroy(gameObject); } } else if (pU.projectileTypeThrown == EnumData.Projectiles.EyeLaser) { Destroy(gameObject); } else if (pU.projectileTypeThrown == EnumData.Projectiles.StarShower) { Destroy(gameObject); } else if (pU.projectileTypeThrown == EnumData.Projectiles.CentaurBow) { Destroy(gameObject); } } } }