gaesup-world 0.8.12 → 0.8.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gaesup/physics/check/moving.js +3 -2
- package/dist/gaesup/tools/clicker/index.js +2 -2
- package/dist/gaesup/world/context/index.js +3 -0
- package/dist/gaesup/world/context/reducer.d.ts +1 -0
- package/dist/gaesup/world/context/type.d.ts +4 -0
- package/dist/gaesup/world/initalize/index.d.ts +1 -0
- package/dist/gaesup/world/initalize/index.js +1 -1
- package/dist/gaesup/world/type.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default function moving(prop) {
|
|
2
|
-
var _a = prop.worldContext, states = _a.states, joystick = _a.joystick, mode = _a.mode, control = _a.control, clicker = _a.clicker;
|
|
2
|
+
var _a = prop.worldContext, states = _a.states, joystick = _a.joystick, mode = _a.mode, control = _a.control, clicker = _a.clicker, clickerOption = _a.clickerOption;
|
|
3
3
|
var forward = control.forward, backward = control.backward, leftward = control.leftward, rightward = control.rightward, shift = control.shift, space = control.space;
|
|
4
4
|
if (mode.controller === "gameboy" || mode.controller === "keyboard") {
|
|
5
5
|
states.isMoving = forward || backward || leftward || rightward;
|
|
@@ -16,7 +16,8 @@ export default function moving(prop) {
|
|
|
16
16
|
else if (mode.controller === "clicker") {
|
|
17
17
|
states.isMoving = clicker.isOn;
|
|
18
18
|
states.isNotMoving = !clicker.isOn;
|
|
19
|
-
states.isRunning =
|
|
19
|
+
states.isRunning =
|
|
20
|
+
(shift || clicker.isRun) && states.isMoving && clickerOption.isRun;
|
|
20
21
|
states.isJumping = space;
|
|
21
22
|
}
|
|
22
23
|
}
|
|
@@ -3,6 +3,6 @@ import { useContext } from "react";
|
|
|
3
3
|
import { GaesupWorldContext } from "../../world/context";
|
|
4
4
|
export function Clicker(_a) {
|
|
5
5
|
var onMarker = _a.onMarker, runMarker = _a.runMarker;
|
|
6
|
-
var _b = useContext(GaesupWorldContext), clicker = _b.clicker, mode = _b.mode;
|
|
7
|
-
return (_jsx(_Fragment, { children: mode.controller === "clicker" && (_jsxs("group", { position: clicker.point, children: [clicker.isOn && onMarker, clicker.isOn && clicker.isRun && runMarker] })) }));
|
|
6
|
+
var _b = useContext(GaesupWorldContext), clicker = _b.clicker, mode = _b.mode, clickerOption = _b.clickerOption;
|
|
7
|
+
return (_jsx(_Fragment, { children: mode.controller === "clicker" && (_jsxs("group", { position: clicker.point, children: [clicker.isOn && onMarker, clicker.isOn && clickerOption.isRun && clicker.isRun && runMarker] })) }));
|
|
8
8
|
}
|
|
@@ -17,6 +17,7 @@ export declare function gaesupWorldReducer(props: Partial<gaesupWorldContextType
|
|
|
17
17
|
animationState?: import("./type").animationStateType;
|
|
18
18
|
keyBoardMap?: import("../../tools/keyBoardToolTip/type").keyboardMapType;
|
|
19
19
|
cameraOption?: import("./type").cameraOptionType;
|
|
20
|
+
clickerOption?: import("./type").clickerOptionType;
|
|
20
21
|
clicker?: import("./type").clickerType;
|
|
21
22
|
moveTo?: (position: import("three").Vector3, target: import("three").Vector3) => Promise<void>;
|
|
22
23
|
rideable?: {
|
|
@@ -107,6 +107,9 @@ export type clickerType = {
|
|
|
107
107
|
isOn: boolean;
|
|
108
108
|
isRun: boolean;
|
|
109
109
|
};
|
|
110
|
+
export type clickerOptionType = {
|
|
111
|
+
isRun: boolean;
|
|
112
|
+
};
|
|
110
113
|
export type wheelStateType = {
|
|
111
114
|
position: THREE.Vector3;
|
|
112
115
|
rotation: THREE.Euler;
|
|
@@ -156,6 +159,7 @@ export type gaesupWorldContextType = {
|
|
|
156
159
|
animationState: animationStateType;
|
|
157
160
|
keyBoardMap: keyboardMapType;
|
|
158
161
|
cameraOption: cameraOptionType;
|
|
162
|
+
clickerOption: clickerOptionType;
|
|
159
163
|
clicker: clickerType;
|
|
160
164
|
moveTo: (position: THREE.Vector3, target: THREE.Vector3) => Promise<void>;
|
|
161
165
|
rideable: {
|
|
@@ -17,6 +17,7 @@ export default function initGaesupWorld(props: gaesupWorldPropsType): {
|
|
|
17
17
|
animationState?: import("../context/type").animationStateType;
|
|
18
18
|
keyBoardMap?: import("../../tools/keyBoardToolTip/type").keyboardMapType;
|
|
19
19
|
cameraOption?: import("../context/type").cameraOptionType;
|
|
20
|
+
clickerOption?: import("../context/type").clickerOptionType;
|
|
20
21
|
clicker?: import("../context/type").clickerType;
|
|
21
22
|
moveTo?: (position: import("three").Vector3, target: import("three").Vector3) => Promise<void>;
|
|
22
23
|
rideable?: {
|
|
@@ -27,7 +27,7 @@ export default function initGaesupWorld(props) {
|
|
|
27
27
|
minimap: gaesupWorldDefault.minimap,
|
|
28
28
|
joystick: gaesupWorldDefault.joystick,
|
|
29
29
|
control: gaesupWorldDefault.control,
|
|
30
|
-
|
|
30
|
+
clickerOption: Object.assign(gaesupWorldDefault.clickerOption, props.clickerOption || {}),
|
|
31
31
|
animationState: gaesupWorldDefault.animationState,
|
|
32
32
|
keyBoardMap: Object.assign(gaesupWorldDefault.keyBoardMap, props.keyBoardMap || {}),
|
|
33
33
|
moveTo: null,
|
|
@@ -2,7 +2,7 @@ import { ReactNode } from "react";
|
|
|
2
2
|
import * as THREE from "three";
|
|
3
3
|
import { keyboardMapType } from "../tools/keyBoardToolTip/type";
|
|
4
4
|
import { dispatchType } from "../utils/type";
|
|
5
|
-
import { blockType, cameraOptionType,
|
|
5
|
+
import { blockType, cameraOptionType, clickerOptionType, gaesupWorldContextType, modeType, urlsType } from "./context/type";
|
|
6
6
|
export type gaesupWorldInitType = {
|
|
7
7
|
value: gaesupWorldContextType;
|
|
8
8
|
dispatch: dispatchType<gaesupWorldContextType>;
|
|
@@ -17,5 +17,5 @@ export type gaesupWorldPropsType = {
|
|
|
17
17
|
cameraOption?: cameraOptionType;
|
|
18
18
|
moveTo?: (position: THREE.Vector3, target: THREE.Vector3) => void;
|
|
19
19
|
block?: blockType;
|
|
20
|
-
|
|
20
|
+
clickerOption?: clickerOptionType;
|
|
21
21
|
};
|