mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2026-02-14 12:22:42 +00:00
added temp enemy mover
This commit is contained in:
20
assets/Scripts/Game/Input/MultiInput.ts
Normal file
20
assets/Scripts/Game/Input/MultiInput.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Vec2 } from "cc";
|
||||
import { IInput } from "./IInput";
|
||||
|
||||
export class MultiInput implements IInput {
|
||||
private inputs: IInput[];
|
||||
|
||||
public constructor(inputs: IInput[]) {
|
||||
this.inputs = inputs;
|
||||
}
|
||||
|
||||
public getAxis(): Vec2 {
|
||||
for (let i = 0; i < this.inputs.length; i++) {
|
||||
if (!this.inputs[i].getAxis().equals(Vec2.ZERO)) {
|
||||
return this.inputs[i].getAxis();
|
||||
}
|
||||
}
|
||||
|
||||
return new Vec2();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user