mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2025-10-09 08:36:14 +00:00
Added magnet functionality
This commit is contained in:
6
assets/Scripts/Services/Utils/VecUtils.ts
Normal file
6
assets/Scripts/Services/Utils/VecUtils.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { Vec3 } from "cc";
|
||||
|
||||
export function getDirection(targetPosition: Vec3, sourcePosition: Vec3): Vec3 {
|
||||
const direction: Vec3 = new Vec3();
|
||||
return Vec3.subtract(direction, targetPosition, sourcePosition).normalize();
|
||||
}
|
9
assets/Scripts/Services/Utils/VecUtils.ts.meta
Normal file
9
assets/Scripts/Services/Utils/VecUtils.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "067789c3-748f-4643-82af-bd33216eee30",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
Reference in New Issue
Block a user