mobile device ratio
This commit is contained in:
Generated
+3848
File diff suppressed because it is too large
Load Diff
+2
-1
@@ -5,7 +5,7 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"build": "vite build && rm -r build/StreamingAssets",
|
||||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
@@ -23,6 +23,7 @@
|
||||
"zustand": "^4.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.11.20",
|
||||
"@types/react": "^18.2.15",
|
||||
"@types/react-dom": "^18.2.7",
|
||||
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import HouseItem from "./HouseItem";
|
||||
import { VILLAS } from "../../../consts/villas";
|
||||
// a1t/m, b2t/m
|
||||
const enableVillas = ["a1t", "a1m", "b2t", "b2m"];
|
||||
|
||||
const HouseList = () => {
|
||||
|
||||
@@ -23,7 +23,7 @@ const MobileApartmentPage = () => {
|
||||
const { unityProvider, sendMessage, addEventListener, removeEventListener } =
|
||||
useUnity();
|
||||
const [isContainerLoaded, setIsContainerLoaded] = useState(false);
|
||||
const isDeviceSupported = !(Number(osVersion) < 17 && isIOS);
|
||||
const isDeviceSupported = (Number(osVersion) > 17 && isIOS) || !isIOS;
|
||||
|
||||
useEffect(() => {
|
||||
if (!isDeviceSupported) {
|
||||
@@ -85,6 +85,7 @@ const MobileApartmentPage = () => {
|
||||
<ButtonPanel />
|
||||
{isDeviceSupported && (
|
||||
<Unity
|
||||
devicePixelRatio={2}
|
||||
unityProvider={unityProvider}
|
||||
style={{ width: "100vw", height: "100vh" }}
|
||||
/>
|
||||
|
||||
@@ -1,7 +1,22 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react-swc'
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const filesNeedToExclude = ["public/StreamingAssets/.*","public/StreamingAssets/.*"];
|
||||
|
||||
const filesPathToExclude = filesNeedToExclude.map((src) => {
|
||||
return fileURLToPath(new URL(src, import.meta.url));
|
||||
});
|
||||
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
build: {
|
||||
outDir:'build',
|
||||
rollupOptions: {
|
||||
external: [...filesPathToExclude],
|
||||
},
|
||||
},
|
||||
|
||||
plugins: [react()],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user