Skip to content
This repository has been archived by the owner on Nov 4, 2021. It is now read-only.

[Optimization] Optimize GetAllPiecesInRadius #16

Open
AlexMog opened this issue Feb 21, 2021 · 0 comments
Open

[Optimization] Optimize GetAllPiecesInRadius #16

AlexMog opened this issue Feb 21, 2021 · 0 comments

Comments

@AlexMog
Copy link
Owner

AlexMog commented Feb 21, 2021

Class: Piece

public static void GetAllPiecesInRadius(Vector3 p, float radius, List<Piece> pieces)
	{
		foreach (Piece allPiece in m_allPieces)
		{
			if (Vector3.Distance(p, allPiece.transform.position) < radius)
			{
				pieces.Add(allPiece);
			}
		}
	}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant