Update StorageActionProps to make max optional; adjust MaterialAnimator padding for improved layout consistency.
This commit is contained in:
parent
5369a97105
commit
d30668e723
|
@ -6,7 +6,7 @@ interface StorageActionProps {
|
|||
type: "store" | "spawn" | "default";
|
||||
value: string;
|
||||
min: number;
|
||||
max: number;
|
||||
max?: number;
|
||||
defaultValue: string;
|
||||
currentMaterialType: string;
|
||||
handleCapacityChange: (value: string) => void;
|
||||
|
|
|
@ -244,7 +244,6 @@ function StorageMechanics() {
|
|||
value={currentCapacity}
|
||||
defaultValue="0"
|
||||
min={0}
|
||||
max={20}
|
||||
currentMaterialType={currentMaterialType}
|
||||
handleCapacityChange={handleCapacityChange}
|
||||
handleMaterialTypeChange={handleMaterialTypeChange}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { useFrame } from '@react-three/fiber';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import * as THREE from 'three';
|
||||
import { MaterialModel } from '../../../materials/instances/material/materialModel';
|
||||
|
||||
|
@ -9,7 +9,7 @@ type MaterialAnimatorProps = {
|
|||
currentPhase: string;
|
||||
};
|
||||
|
||||
export default function MaterialAnimator({ ikSolver, armBot, currentPhase }: MaterialAnimatorProps) {
|
||||
export default function MaterialAnimator({ ikSolver, armBot, currentPhase }: Readonly<MaterialAnimatorProps>) {
|
||||
const sphereRef = useRef<any>(null);
|
||||
const [isRendered, setIsRendered] = useState<boolean>(false);
|
||||
|
||||
|
@ -58,7 +58,7 @@ export default function MaterialAnimator({ ikSolver, armBot, currentPhase }: Mat
|
|||
{isRendered && (
|
||||
<MaterialModel
|
||||
matRef={sphereRef}
|
||||
materialType={armBot.currentAction?.materialType || 'Default material'}
|
||||
materialType={armBot.currentAction?.materialType ?? 'Default material'}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
|
|
|
@ -9,7 +9,7 @@ const MaterialAnimator = ({
|
|||
const meshRef = useRef<any>(null!);
|
||||
const [hasLoad, setHasLoad] = useState(false);
|
||||
const { scene } = useThree();
|
||||
const padding = 0;
|
||||
const padding = 0.1;
|
||||
|
||||
useEffect(() => {
|
||||
setHasLoad(storage.currentLoad > 0);
|
||||
|
|
Loading…
Reference in New Issue