Created
December 8, 2022 20:48
-
-
Save haramakoto/250b34419af5ea1673ebff9ec54e446a to your computer and use it in GitHub Desktop.
Linqを用いて一番近いオブジェクトを取り出す
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Linq; | |
List<Transform> targetList; | |
Transform nearestTrans = targetList.OrderBy( x => (x.position - this.position).magnitude).First(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment