Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
T
tuseGameColor
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shujianhe
tuseGameColor
Commits
7e08d726
Commit
7e08d726
authored
Jul 28, 2023
by
shujianhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
93c80321
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
294 additions
and
40 deletions
+294
-40
gameSceneLogic.cs
Assets/scripts/Views/gameScene/gameSceneLogic.cs
+1
-1
gameUserInfos.cs
Assets/scripts/Views/gameScene/gameUserInfos.cs
+30
-0
mainGameOneImageView.cs
Assets/scripts/common/mainGameOneImageView.cs
+250
-3
mainGameView.cs
Assets/scripts/common/mainGameView.cs
+13
-36
No files found.
Assets/scripts/Views/gameScene/gameSceneLogic.cs
View file @
7e08d726
...
...
@@ -572,7 +572,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
utilsTools
.
setGDataByKey
(
"NativeTempData"
,
"main"
);
SceneManager
.
LoadScene
(
"Scenes/MainGame"
);
return
false
;
},
35
);
},
40
);
}
public
void
onTestTemp1
()
...
...
Assets/scripts/Views/gameScene/gameUserInfos.cs
View file @
7e08d726
...
...
@@ -44,6 +44,7 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
if
(
isSuccess
)
{
HistoryClick
historyClick
=
JsonUtility
.
FromJson
<
HistoryClick
>(
data
as
string
);
if
(
historyClick
==
null
)
return
0
;
string
history
=
historyClick
.
getHistory
();
gameScenUserInfo
.
setShowAreaids
(
history
);
return
0
;
...
...
@@ -148,8 +149,37 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
Debug
.
Log
(
"onCloseScenePrveHandler 2"
);
utilsTools
.
saveGameScenUserInfo
(
gameScenUserInfo
);
Debug
.
Log
(
"onCloseScenePrveHandler 3"
);
string
nativeParam1
=
utilsTools
.
getGDataByKey
<
string
>(
"NativeTempData"
,
""
);
if
(
nativeParam1
.
Equals
(
""
)
==
false
)
{
float
allAreaSize
=
(
float
)
utilsTools
.
getGDataByKey
<
int
>(
"allAreaSize"
,
0
);
float
schedule1
=
(
int
)(
gameScenUserInfo
.
areaInfoUseData
.
Count
*
100f
/
allAreaSize
);
int
schedule
=
0
;
if
(
schedule1
<
1.00001
)
{
schedule
=
1
;
}
else
if
(
schedule1
>
98.999999991
)
{
if
(
utilsTools
.
getGDataByKey
<
int
>(
"allAreaSize"
,
0
).
Equals
(
gameScenUserInfo
.
areaInfoUseData
.
Count
))
{
schedule
=
100
;
}
else
{
schedule
=
99
;
}
}
else
{
schedule
=
(
int
)
schedule1
;
}
nativeParam1
=
nativeParam1
+
"_"
+
schedule
.
ToString
();
utilsTools
.
setGDataByKey
(
"NativeTempData"
,
nativeParam1
);
}
updateProgress
();
Debug
.
Log
(
"onCloseScenePrveHandler 4"
);
gameScenUserInfo
=
null
;
//直接释放如果期间没有保存,就一起丢失
}
}
...
...
Assets/scripts/common/mainGameOneImageView.cs
View file @
7e08d726
This diff is collapsed.
Click to expand it.
Assets/scripts/common/mainGameView.cs
View file @
7e08d726
...
...
@@ -38,11 +38,11 @@ public class mainGameView : MonoBehaviour
private
GameScenUserInfo
gameScenUseInfo
=
null
;
//x,y aid 当前帧向量 起点终点 等宽度计算扩散
private
List
<
AreaAnimationDiffuse
>
showAreaAnimationDatas
=
new
List
<
AreaAnimationDiffuse
>();
pr
ivate
Dictionary
<
short
,
GroupByAreaPtInfos
>
groupPtInfos
=
new
Dictionary
<
short
,
GroupByAreaPtInfos
>();
pr
ivate
Dictionary
<
short
,
GroupByAreaPtInfos
>
groupPtInfos_All
=
new
Dictionary
<
short
,
GroupByAreaPtInfos
>();
//不管是否涂色都会记录
pr
otected
Dictionary
<
short
,
GroupByAreaPtInfos
>
groupPtInfos
=
new
Dictionary
<
short
,
GroupByAreaPtInfos
>();
pr
otected
Dictionary
<
short
,
GroupByAreaPtInfos
>
groupPtInfos_All
=
new
Dictionary
<
short
,
GroupByAreaPtInfos
>();
//不管是否涂色都会记录
protected
short
bianlun
=
-
1
;
protected
short
fullShow
=
-
2
;
pr
ivate
Texture2D
thumbnailTexture2d
=
null
;
pr
otected
Texture2D
thumbnailTexture2d
=
null
;
private
bool
isDebugTestToEnd
=
false
;
public
GameObject
clickPosEff
=
null
;
Dictionary
<
string
,
Color
[
]>
allColor
=
new
Dictionary
<
string
,
Color
[
]>
();
...
...
@@ -528,7 +528,7 @@ public class mainGameView : MonoBehaviour
}
public
void
updateScaleView
()
{
Vector3
vector3
=
lineImg
.
transform
.
localScale
;
Vector3
vector3
=
areaIdBase
.
transform
.
localScale
;
float
dyMinShowFontSize
=
utilsTools
.
getGDataByKey
<
float
>(
"dyMinShowFontSize"
,
minShowFontSize
);
if
(
areaIdBase
!=
null
&&
perfabPath
.
Equals
(
""
)
==
false
)
{
...
...
@@ -717,17 +717,13 @@ public class mainGameView : MonoBehaviour
utilsTools
.
sendEventObjectParams
(
"inGameLoadingValue"
,
3f
,
false
);
fillAnimation
=
Boolean
.
Parse
(
utilsTools
.
getGDataByKey
<
String
>(
"fillanimation"
,
"false"
));
int
selectId
=
int
.
Parse
(
utilsTools
.
getGDataByKey
<
String
>(
"highlight_areas"
,
"0"
));
if
(
selectId
<
0
||
selectId
>=
allSelectTexturePaths
.
Count
())
{
selectId
=
0
;
}
selectTextureIdx
=
selectId
;
this
.
gameScenUseInfo
=
gameUserInfo
;
for
(
short
i
=
0
;
i
<
gameUserInfo
.
areaInfoUseData
.
Count
;
i
++)
{
var
userAreaData
=
gameUserInfo
.
areaInfoUseData
[
i
];
aid2selectOrderIdx
.
Add
(
userAreaData
.
id
,
i
);
if
(
aid2selectOrderIdx
.
ContainsKey
(
userAreaData
.
id
)
==
false
)
aid2selectOrderIdx
.
Add
(
userAreaData
.
id
,
i
);
}
utilsTools
.
setGDataByKey
(
"loadBinBegin"
,
utilsTools
.
getTotalMillisecond
());
TaskManages
.
getInstance
().
insertTask
(
this
,
(
System
.
Object
[]
_
)
=>
...
...
@@ -827,7 +823,7 @@ public class mainGameView : MonoBehaviour
}
});
}
public
void
showArea
(
int
areaId
,
OnAreaHandler
onAreaHandler
=
null
)
public
v
irtual
v
oid
showArea
(
int
areaId
,
OnAreaHandler
onAreaHandler
=
null
)
{
if
(
areaId
==
-
1
)
{
...
...
@@ -845,11 +841,6 @@ public class mainGameView : MonoBehaviour
{
lineTexture2d
.
SetPixel
(
item
.
x
,
item
.
y
,
color
);
//回放使用
}
//groupPtInfos_All[areaItem1.gid].getLineByAid(areaItem1.id, ref areaAllPts);
//foreach (var item in areaAllPts)
//{
// lineTexture2d.SetPixel(item.x, item.y, color);
//}
lineTexture2d
.
Apply
();
}
else
if
(
onAreaHandler
!=
null
)
...
...
@@ -858,7 +849,7 @@ public class mainGameView : MonoBehaviour
}
}
public
bool
switchShowAreaGroup
(
short
gid
,
OnAreaHandler
onAreaHandler
=
null
)
public
virtual
bool
switchShowAreaGroup
(
short
gid
,
OnAreaHandler
onAreaHandler
=
null
)
{
//utilsTools.setGDataByKey("makeThumbnailBegin", utilsTools.getTotalMillisecond());
if
(
utilsTools
.
ContainsKeyGDataByKey
(
"firstSwitchShowAreaBegin"
)
==
false
)
...
...
@@ -1268,7 +1259,7 @@ public class mainGameView : MonoBehaviour
}
}
public
void
resetSize
()
public
v
irtual
v
oid
resetSize
()
{
//怎么保持宽高比
float
width
=
lineTexture2d
.
width
;
...
...
@@ -1276,20 +1267,6 @@ public class mainGameView : MonoBehaviour
float
bet
=
width
/
height
;
RectTransform
rectTransform
=
lineImg
.
GetComponent
<
RectTransform
>();
RectTransform
baseTransform
=
rectTransform
.
transform
.
parent
.
GetComponent
<
RectTransform
>();
Vector2
maxSize
=
new
Vector2
(
baseTransform
.
rect
.
width
*
0.95f
,
baseTransform
.
rect
.
height
*
0.95f
);
float
bet1
=
1.0f
;
//while (true)
//{
// float tempWidth = rectTransform.rect.width * bet1 * rectTransform.localScale.x;
// float tempHeight = rectTransform.rect.width / bet * bet1 * rectTransform.localScale.y;
// if (tempWidth < maxSize.x && tempHeight < maxSize.y)
// {
// width = tempWidth;
// height = tempHeight;
// break;
// }
// bet1 = bet1 * 0.95f;
//}
if
(
width
.
Equals
(
height
))
{
width
=
utilsTools
.
DisplaySize
.
x
*
1
;
...
...
@@ -1320,7 +1297,7 @@ public class mainGameView : MonoBehaviour
utilsTools
.
setGDataByKey
(
"sltTextureSize"
,
new
Vector2
(
lowImgTexture2d
.
width
/
4
,
lowImgTexture2d
.
height
/
4
));
}
}
public
bool
getSize
(
out
int
width
,
out
int
height
)
public
virtual
bool
getSize
(
out
int
width
,
out
int
height
)
{
width
=
-
1
;
height
=
-
1
;
...
...
@@ -1447,7 +1424,7 @@ public class mainGameView : MonoBehaviour
utilsTools
.
sendEventObjectParams
(
"gamePlayerEndHandler"
);
}
}
pr
ivate
void
loadSelectImageTexture
(
Texture2D
nowSelectTexture
,
NotifyEmptParam
notify
,
int
width
=
0
,
int
height
=
0
)
pr
otected
virtual
void
loadSelectImageTexture
(
Texture2D
nowSelectTexture
,
NotifyEmptParam
notify
,
int
width
=
0
,
int
height
=
0
)
{
if
(
width
==
0
||
height
==
0
)
{
...
...
@@ -1506,7 +1483,7 @@ public class mainGameView : MonoBehaviour
},
objects2
);
}
pr
ivate
void
loadSelectImageTextureId
(
int
idx
=
0
,
NotifyEmptParam
notify
=
null
)
pr
otected
void
loadSelectImageTextureId
(
int
idx
=
0
,
NotifyEmptParam
notify
=
null
)
{
string
path
=
allSelectTexturePaths
[
idx
];
var
req
=
Resources
.
LoadAsync
<
Texture2D
>(
path
);
...
...
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