Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOProUnity_V2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fallenstardust
YGOProUnity_V2
Commits
96320e5d
Commit
96320e5d
authored
Sep 03, 2021
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
4d0be090
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
20 deletions
+38
-20
Assets/SibylSystem/BackGroundPic/BackGroundPic.cs
Assets/SibylSystem/BackGroundPic/BackGroundPic.cs
+13
-11
Assets/SibylSystem/Setting/Setting.cs
Assets/SibylSystem/Setting/Setting.cs
+25
-9
No files found.
Assets/SibylSystem/BackGroundPic/BackGroundPic.cs
View file @
96320e5d
...
...
@@ -23,19 +23,21 @@ public class BackGroundPic : Servant
public
override
void
applyShowArrangement
()
{
var
s
=
(
float
)
Utils
.
UIHeight
()
/
Screen
.
height
;
var
tex
=
backGround
.
GetComponent
<
UITexture
>().
mainTexture
;
var
ss
=
tex
.
height
/
(
float
)
tex
.
width
;
var
width
=
(
int
)
(
Screen
.
width
*
s
);
var
height
=
(
int
)
(
width
*
ss
);
if
(
height
<
Screen
.
height
)
var
component
=
backGround
.
GetComponent
<
UITexture
>();
var
texture
=
component
.
mainTexture
;
if
(
texture
.
width
<=
texture
.
height
*
Screen
.
width
/
Screen
.
height
)
{
height
=
(
int
)
(
Screen
.
height
*
s
);
width
=
(
int
)
(
height
/
ss
);
// 图窄屏幕宽,用宽度
component
.
width
=
Utils
.
UIWidth
();
component
.
height
=
component
.
width
*
texture
.
height
/
texture
.
width
;
}
else
{
// 图宽屏幕窄,用高度
component
.
height
=
Utils
.
UIHeight
();
component
.
width
=
component
.
height
*
texture
.
width
/
texture
.
height
;
}
backGround
.
GetComponent
<
UITexture
>().
height
=
height
+
2
;
backGround
.
GetComponent
<
UITexture
>().
width
=
width
+
2
;
}
public
override
void
applyHideArrangement
()
...
...
Assets/SibylSystem/Setting/Setting.cs
View file @
96320e5d
using
System
;
using
System.Linq
;
using
UnityEngine
;
using
UnityEngine.Assertions
;
public
class
Setting
:
WindowServant2D
{
...
...
@@ -16,10 +18,19 @@ public class Setting : WindowServant2D
private
UISlider
sliderVsize
;
public
int
star
=
5
;
private
UIPopupList
_screen
;
public
override
void
initialize
()
{
gameObject
=
SetWindow
(
this
,
Program
.
I
().
new_ui_setting
);
setting
=
gameObject
.
GetComponentInChildren
<
LAZYsetting
>();
_screen
=
UIHelper
.
getByName
<
UIPopupList
>(
gameObject
,
"screen_"
);
_screen
.
items
=
new
[]
{
new
UnityEngine
.
Resolution
{
width
=
1300
,
height
=
700
}}.
Concat
(
Screen
.
resolutions
)
.
Select
(
r
=>
$"
{
r
.
width
}
x
{
r
.
height
}
"
)
.
Distinct
()
.
ToList
();
UIHelper
.
registEvent
(
gameObject
,
"exit_"
,
onClickExit
);
UIHelper
.
registEvent
(
gameObject
,
"screen_"
,
resizeScreen
);
UIHelper
.
registEvent
(
gameObject
,
"full_"
,
resizeScreen
);
...
...
@@ -85,7 +96,7 @@ public class Setting : WindowServant2D
UIHelper
.
registEvent
(
setting
.
Vlink
.
gameObject
,
onCP
);
onchangeMouse
();
onchangeCloud
();
s
etScreenSizeValue
();
S
etScreenSizeValue
();
}
private
void
readVales
()
...
...
@@ -117,10 +128,10 @@ public class Setting : WindowServant2D
//private int dontResizeTwice = 2;
public
void
s
etScreenSizeValue
()
public
void
S
etScreenSizeValue
()
{
//dontResizeTwice = 3
;
UIHelper
.
getByName
<
UIPopupList
>(
gameObject
,
"screen_"
).
value
=
Screen
.
width
+
"*"
+
Screen
.
heigh
t
;
var
target
=
$"
{
Screen
.
currentResolution
.
width
}
x
{
Screen
.
currentResolution
.
height
}
"
;
if
(
_screen
.
value
!=
target
)
_screen
.
value
=
targe
t
;
}
private
void
onCP
()
...
...
@@ -220,12 +231,17 @@ public class Setting : WindowServant2D
//dontResizeTwice = 2;
if
(
UIHelper
.
isMaximized
())
UIHelper
.
RestoreWindow
();
var
mats
=
UIHelper
.
getByName
<
UIPopupList
>(
gameObject
,
"screen_"
).
value
.
Split
(
new
[]
{
"*"
},
StringSplitOptions
.
RemoveEmptyEntries
);
if
(
mats
.
Length
==
2
)
Screen
.
SetResolution
(
int
.
Parse
(
mats
[
0
]),
int
.
Parse
(
mats
[
1
]),
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"full_"
).
value
);
Program
.
go
(
100
,
()
=>
{
Program
.
I
().
fixScreenProblems
();
});
.
Split
(
new
[]
{
" x "
},
StringSplitOptions
.
RemoveEmptyEntries
);
Assert
.
IsTrue
(
mats
.
Length
==
2
);
Screen
.
SetResolution
(
int
.
Parse
(
mats
[
0
]),
int
.
Parse
(
mats
[
1
]),
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"full_"
).
value
);
Program
.
go
(
100
,
()
=>
{
SetScreenSizeValue
();
Program
.
I
().
fixScreenProblems
();
});
}
public
void
saveWhenQuit
()
...
...
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