Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GalaxySmash
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hà Trung (NEGAXY)
GalaxySmash
Commits
5dc8452e
Commit
5dc8452e
authored
Dec 12, 2021
by
HaTrungVI
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trung: Fix resolution
parent
a571ff95
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
1 deletion
+94
-1
firstloading.unity
Assets/OSG Infinity Square Space/Scenes/firstloading.unity
+48
-1
AvoidNativeResolution.cs
Assets/Scripts/AvoidNativeResolution.cs
+35
-0
AvoidNativeResolution.cs.meta
Assets/Scripts/AvoidNativeResolution.cs.meta
+11
-0
No files found.
Assets/OSG Infinity Square Space/Scenes/firstloading.unity
View file @
5dc8452e
...
...
@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity
:
1
m_CustomReflection
:
{
fileID
:
0
}
m_Sun
:
{
fileID
:
0
}
m_IndirectSpecularColor
:
{
r
:
0.446578
98
,
g
:
0.4964133
,
b
:
0.5748178
,
a
:
1
}
m_IndirectSpecularColor
:
{
r
:
0.446578
74
,
g
:
0.49641258
,
b
:
0.5748172
,
a
:
1
}
m_UseRadianceAmbientProbe
:
0
---
!u!157
&3
LightmapSettings
:
...
...
@@ -1614,6 +1614,53 @@ MonoBehaviour:
m_RequiresDepthTexture
:
0
m_RequiresColorTexture
:
0
m_Version
:
2
---
!u!1
&2033920571
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
2033920573
}
-
component
:
{
fileID
:
2033920572
}
m_Layer
:
0
m_Name
:
AvoidNativeResolution
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!114
&2033920572
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
2033920571
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
f0a0975d01fd0d342978f3a3013b4d73
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
totalChange
:
1
overideScale
:
0.7
perfectFps
:
60
fullScreen
:
1
---
!u!4
&2033920573
Transform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
2033920571
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
868.60455
,
y
:
1069.564
,
z
:
-942.7166
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
10
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!1001
&2044911679
PrefabInstance
:
m_ObjectHideFlags
:
0
...
...
Assets/Scripts/AvoidNativeResolution.cs
0 → 100644
View file @
5dc8452e
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
AvoidNativeResolution
:
MonoBehaviour
{
public
int
totalChange
=
1
;
[
Range
(
0f
,
1f
)]
public
float
overideScale
=
1f
;
[
Range
(
30
,
60
)]
public
int
perfectFps
=
60
;
public
bool
fullScreen
=
true
;
private
int
originWidth
;
private
int
originHeight
;
private
int
currentWidth
;
private
int
currentHeight
;
public
static
int
count
=
0
;
private
void
Awake
()
{
Screen
.
sleepTimeout
=
SleepTimeout
.
NeverSleep
;
}
private
void
Start
()
{
if
(
count
<
totalChange
)
{
originWidth
=
Screen
.
width
;
originHeight
=
Screen
.
height
;
currentWidth
=
(
int
)(
originWidth
*
overideScale
);
currentHeight
=
(
int
)(
originHeight
*
overideScale
);
Screen
.
SetResolution
(
currentWidth
,
currentHeight
,
fullScreen
,
perfectFps
);
Application
.
targetFrameRate
=
perfectFps
;
count
+=
1
;
}
}
}
Assets/Scripts/AvoidNativeResolution.cs.meta
0 → 100644
View file @
5dc8452e
fileFormatVersion: 2
guid: f0a0975d01fd0d342978f3a3013b4d73
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment