mobile device ratio

This commit is contained in:
2024-02-27 18:16:16 +05:00
parent 50c24be8b1
commit c038ea32bd
6 changed files with 4206 additions and 463 deletions
+3848
View File
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -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 = () => {
+2 -1
View File
@@ -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" }}
/>
+15
View File
@@ -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()],
})
+339 -460
View File
File diff suppressed because it is too large Load Diff