moveTo parameter working if layer is found
This commit is contained in:
parent
cb0c5beecf
commit
e87c0a07a4
4 changed files with 57 additions and 8 deletions
|
@ -31,4 +31,8 @@ export class MathUtils {
|
|||
const distance = Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2);
|
||||
return squared ? Math.sqrt(distance) : distance;
|
||||
}
|
||||
|
||||
public static randomFromArray<T>(array: T[]): T {
|
||||
return array[Math.floor(Math.random() * array.length)];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue