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
c00ca85d
Commit
c00ca85d
authored
Aug 23, 2023
by
JiangWanZhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去掉加载工程文件的测试代码
parent
1621a71a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
136 deletions
+27
-136
Native.cs
Assets/scripts/Views/maingame/Native.cs
+1
-1
mainGameView.cs
Assets/scripts/common/mainGameView.cs
+26
-135
No files found.
Assets/scripts/Views/maingame/Native.cs
View file @
c00ca85d
...
@@ -84,7 +84,7 @@ public class Native : MonoBehaviour
...
@@ -84,7 +84,7 @@ public class Native : MonoBehaviour
Debug
.
Log
(
"JSON:"
+
json
);
Debug
.
Log
(
"JSON:"
+
json
);
json
=
"{\"append\":\"\",\"classId\":\"1,8,10,14\",\"displayDate\":\"20221102\",\"enterType\":\"0\",\"extraJson\":\"{\\\"cut_height\\\": 0, \\\"refer_drawer\\\": \\\"DoMyzu\\\"}\",\"extraType\":0,\"file\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/cc--EDgRpc_nHQru7H.zip\",\"highImg\":\"https://d21z6ifg4bbv2v.cloudfront.net/tspng/cc--EDgRpc_nHQru7H.png\",\"hybridType\":64,\"id\":\"cc--EDgRpc_nHQru7H\",\"originalJson\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsjson/cc--EDgRpc_nHQru7H.json\",\"picAssets\":\"{\\\"pictureBin\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/zsD2ySwS4pJ25frj.p\\\", \\\"pictureThn4\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/V8ZvUuDlOEB7mifd.png\\\", \\\"pictureColorThn4\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/IDdMO8yT0fPPhUtU.jpg?x-oss-process\\u003dstyle/cc400\\\", \\\"pictureWallThn8\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/oWqHjCo5mQvXIVP_.png\\\", \\\"pictureWallColorThn8\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/IDdMO8yT0fPPhUtU.jpg?x-oss-process\\u003dstyle/cc800\\\"}\",\"pictureBin\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/cc--EDgRpc_nHQru7H_pictureBin.p\",\"pictureColorThn4\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/cc--EDgRpc_nHQru7H_pictureColorThn4.jpg\",\"pictureThn4\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/cc--EDgRpc_nHQru7H_pictureThn4.png\",\"schedule\":0,\"seriesName\":\"\",\"sid\":2967,\"sort\":80,\"type\":6}"
;
json
=
"{\"append\":\"\",\"classId\":\"1,8,10,14\",\"displayDate\":\"20221102\",\"enterType\":\"0\",\"extraJson\":\"{\\\"cut_height\\\": 0, \\\"refer_drawer\\\": \\\"DoMyzu\\\"}\",\"extraType\":0,\"file\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/cc--EDgRpc_nHQru7H.zip\",\"highImg\":\"https://d21z6ifg4bbv2v.cloudfront.net/tspng/cc--EDgRpc_nHQru7H.png\",\"hybridType\":64,\"id\":\"cc--EDgRpc_nHQru7H\",\"originalJson\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsjson/cc--EDgRpc_nHQru7H.json\",\"picAssets\":\"{\\\"pictureBin\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/zsD2ySwS4pJ25frj.p\\\", \\\"pictureThn4\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/V8ZvUuDlOEB7mifd.png\\\", \\\"pictureColorThn4\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/IDdMO8yT0fPPhUtU.jpg?x-oss-process\\u003dstyle/cc400\\\", \\\"pictureWallThn8\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/oWqHjCo5mQvXIVP_.png\\\", \\\"pictureWallColorThn8\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/IDdMO8yT0fPPhUtU.jpg?x-oss-process\\u003dstyle/cc800\\\"}\",\"pictureBin\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/cc--EDgRpc_nHQru7H_pictureBin.p\",\"pictureColorThn4\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/cc--EDgRpc_nHQru7H_pictureColorThn4.jpg\",\"pictureThn4\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/cc--EDgRpc_nHQru7H_pictureThn4.png\",\"schedule\":0,\"seriesName\":\"\",\"sid\":2967,\"sort\":80,\"type\":6}"
;
string
name
=
"cc
gCTqoiwmXnQ1RGBb
"
;
string
name
=
"cc
0pwJCtz_oyKIWTCq
"
;
json
=
json
.
Replace
(
"cc--EDgRpc_nHQru7H"
,
name
);
json
=
json
.
Replace
(
"cc--EDgRpc_nHQru7H"
,
name
);
//json = "{\"append\":\"\",\"classId\":\"1,8,10,14\",\"displayDate\":\"20221102\",\"enterType\":\"0\",\"extraJson\":\"{\\\"cut_height\\\": 0, \\\"refer_drawer\\\": \\\"DoMyzu\\\"}\",\"extraType\":0,\"file\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/ccnKNH1bTLS-_Mg7A2.zip\",\"highImg\":\"https://d21z6ifg4bbv2v.cloudfront.net/tspng/ccnKNH1bTLS-_Mg7A2.png\",\"hybridType\":64,\"id\":\"ccnKNH1bTLS-_Mg7A2\",\"originalJson\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsjson/ccnKNH1bTLS-_Mg7A2.json\",\"picAssets\":\"{\\\"pictureBin\\\": \\\"ccv1/production-pic/20221027/ccnKNH1bTLS-_Mg7A2/zsD2ySwS4pJ25frj.p\\\", \\\"pictureThn4\\\": \\\"ccv1/production-pic/20221027/ccnKNH1bTLS-_Mg7A2/V8ZvUuDlOEB7mifd.png\\\", \\\"pictureColorThn4\\\": \\\"ccv1/production-pic/20221027/ccnKNH1bTLS-_Mg7A2/IDdMO8yT0fPPhUtU.jpg?x-oss-process\\u003dstyle/cc400\\\", \\\"pictureWallThn8\\\": \\\"ccv1/production-pic/20221027/ccnKNH1bTLS-_Mg7A2/oWqHjCo5mQvXIVP_.png\\\", \\\"pictureWallColorThn8\\\": \\\"ccv1/production-pic/20221027/ccnKNH1bTLS-_Mg7A2/IDdMO8yT0fPPhUtU.jpg?x-oss-process\\u003dstyle/cc800\\\"}\",\"pictureBin\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/ccnKNH1bTLS-_Mg7A2_pictureBin.p\",\"pictureColorThn4\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/ccnKNH1bTLS-_Mg7A2_pictureColorThn4.jpg\",\"pictureThn4\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/ccnKNH1bTLS-_Mg7A2_pictureThn4.png\",\"schedule\":0,\"seriesName\":\"\",\"sid\":2967,\"sort\":80,\"type\":6}";
//json = "{\"append\":\"\",\"classId\":\"1,8,10,14\",\"displayDate\":\"20221102\",\"enterType\":\"0\",\"extraJson\":\"{\\\"cut_height\\\": 0, \\\"refer_drawer\\\": \\\"DoMyzu\\\"}\",\"extraType\":0,\"file\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/ccnKNH1bTLS-_Mg7A2.zip\",\"highImg\":\"https://d21z6ifg4bbv2v.cloudfront.net/tspng/ccnKNH1bTLS-_Mg7A2.png\",\"hybridType\":64,\"id\":\"ccnKNH1bTLS-_Mg7A2\",\"originalJson\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsjson/ccnKNH1bTLS-_Mg7A2.json\",\"picAssets\":\"{\\\"pictureBin\\\": \\\"ccv1/production-pic/20221027/ccnKNH1bTLS-_Mg7A2/zsD2ySwS4pJ25frj.p\\\", \\\"pictureThn4\\\": \\\"ccv1/production-pic/20221027/ccnKNH1bTLS-_Mg7A2/V8ZvUuDlOEB7mifd.png\\\", \\\"pictureColorThn4\\\": \\\"ccv1/production-pic/20221027/ccnKNH1bTLS-_Mg7A2/IDdMO8yT0fPPhUtU.jpg?x-oss-process\\u003dstyle/cc400\\\", \\\"pictureWallThn8\\\": \\\"ccv1/production-pic/20221027/ccnKNH1bTLS-_Mg7A2/oWqHjCo5mQvXIVP_.png\\\", \\\"pictureWallColorThn8\\\": \\\"ccv1/production-pic/20221027/ccnKNH1bTLS-_Mg7A2/IDdMO8yT0fPPhUtU.jpg?x-oss-process\\u003dstyle/cc800\\\"}\",\"pictureBin\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/ccnKNH1bTLS-_Mg7A2_pictureBin.p\",\"pictureColorThn4\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/ccnKNH1bTLS-_Mg7A2_pictureColorThn4.jpg\",\"pictureThn4\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/ccnKNH1bTLS-_Mg7A2_pictureThn4.png\",\"schedule\":0,\"seriesName\":\"\",\"sid\":2967,\"sort\":80,\"type\":6}";
//#endif
//#endif
...
...
Assets/scripts/common/mainGameView.cs
View file @
c00ca85d
...
@@ -1784,164 +1784,55 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
...
@@ -1784,164 +1784,55 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
string
mappath
=
dirpath
+
$"
{
key
}
_map.png"
;
string
mappath
=
dirpath
+
$"
{
key
}
_map.png"
;
string
loadpath
=
""
;
string
loadpath
=
""
;
bool
localflag
=
false
;
loadpath
=
pngpath
;
if
(
File
.
Exists
(
pngpath
))
//有保存过图片
{
localflag
=
true
;
UnityWebRequest
request_png
=
UnityWebRequestTexture
.
GetTexture
(
pngpath
);
loadpath
=
pngpath
;
#if UNITY_ANDROID
#if UNITY_ANDROID
loadpath
=
"file://"
+
pngpath
;
loadpath
=
"file://"
+
pngpath
;
#endif
#endif
var
file_png
=
new
WWW
(
loadpath
);
var
file_png
=
new
WWW
(
loadpath
);
yield
return
file_png
;
yield
return
file_png
;
if
(
file_png
.
isDone
)
if
(
file_png
.
isDone
)
{
png
=
file_png
.
texture
;
}
}
else
{
{
string
path
=
Application
.
streamingAssetsPath
+
$"/
{
key
}
/
{
key
}
_png.png"
;
png
=
file_png
.
texture
;
WWW
www
=
new
WWW
(
path
);
yield
return
www
;
png
=
www
.
texture
;
}
}
loadpath
=
jpgpath
;
if
(
File
.
Exists
(
jpgpath
))
{
loadpath
=
jpgpath
;
#if UNITY_ANDROID
#if UNITY_ANDROID
loadpath
=
"file://"
+
jpgpath
;
loadpath
=
"file://"
+
jpgpath
;
#endif
#endif
var
file_jpg
=
new
WWW
(
loadpath
);
var
file_jpg
=
new
WWW
(
loadpath
);
yield
return
file_jpg
;
yield
return
file_jpg
;
if
(
file_jpg
.
isDone
)
if
(
file_jpg
.
isDone
)
{
{
jpg_texture
=
file_jpg
.
texture
;
jpg_texture
=
file_jpg
.
texture
;
jpg
=
Sprite
.
Create
(
jpg_texture
,
new
Rect
(
0
,
0
,
jpg_texture
.
width
,
jpg_texture
.
height
),
new
Vector2
(
0.5f
,
0.5f
));
jpg
=
Sprite
.
Create
(
jpg_texture
,
new
Rect
(
0
,
0
,
jpg_texture
.
width
,
jpg_texture
.
height
),
new
Vector2
(
0.5f
,
0.5f
));
}
}
else
{
string
path
=
Application
.
streamingAssetsPath
+
$"/
{
key
}
/
{
key
}
_jpg.jpg"
;
WWW
www
=
new
WWW
(
path
);
yield
return
www
;
jpg_texture
=
www
.
texture
;
}
}
if
(
File
.
Exists
(
mappath
))
{
UnityWebRequest
request_map
=
UnityWebRequestTexture
.
GetTexture
(
mappath
);
loadpath
=
mappath
;
loadpath
=
mappath
;
#if UNITY_ANDROID
#if UNITY_ANDROID
loadpath
=
"file://"
+
mappath
;
loadpath
=
"file://"
+
mappath
;
#endif
#endif
var
file_map
=
new
WWW
(
loadpath
);
var
file_map
=
new
WWW
(
loadpath
);
yield
return
file_map
;
yield
return
file_map
;
if
(
file_map
.
isDone
)
if
(
file_map
.
isDone
)
{
map
=
file_map
.
texture
;
}
}
else
{
{
string
path
=
Application
.
streamingAssetsPath
+
$"/
{
key
}
/
{
key
}
_map.png"
;
map
=
file_map
.
texture
;
WWW
www
=
new
WWW
(
path
);
yield
return
www
;
map
=
www
.
texture
;
}
}
string
binlocalpath
=
Application
.
persistentDataPath
+
$"/MyPic/
{
key
}
/
{
key
}
_json.bin"
;
string
binlocalpath
=
Application
.
persistentDataPath
+
$"/MyPic/
{
key
}
/
{
key
}
_json.bin"
;
ResJsonData
jsondata
=
null
;
ResJsonData
jsondata
=
getdata
(
key
);
if
(!
File
.
Exists
(
binlocalpath
))
{
string
path
=
Application
.
streamingAssetsPath
+
$"/
{
key
}
/
{
key
}
_json.bin"
;
WWW
www
=
new
WWW
(
path
);
while
(!
www
.
isDone
)
{
}
MemoryStream
stream
=
new
MemoryStream
(
www
.
bytes
);
//二进制反序列化
BinaryFormatter
bf
=
new
BinaryFormatter
();
jsondata
=
(
ResJsonData
)
bf
.
Deserialize
(
stream
);
}
else
{
jsondata
=
getdata
(
key
);
}
string
bindynamiclocalpath
=
Application
.
persistentDataPath
+
$"/MyPic/
{
key
}
/
{
key
}
_dynamic.bin"
;
string
bindynamiclocalpath
=
Application
.
persistentDataPath
+
$"/MyPic/
{
key
}
/
{
key
}
_dynamic.bin"
;
DynamicData
dynamic
=
null
;
DynamicData
dynamic
=
getdynamicdata
(
key
);
if
(!
File
.
Exists
(
bindynamiclocalpath
))
{
string
path
=
Application
.
streamingAssetsPath
+
$"/
{
key
}
/
{
key
}
_dynamic.bin"
;
WWW
www
=
new
WWW
(
path
);
while
(!
www
.
isDone
)
{
}
MemoryStream
stream
=
new
MemoryStream
(
www
.
bytes
);
//二进制反序列化
BinaryFormatter
bf
=
new
BinaryFormatter
();
dynamic
=
(
DynamicData
)
bf
.
Deserialize
(
stream
);
}
else
{
dynamic
=
getdynamicdata
(
key
);
}
if
(
localflag
)
//加载本地的到这里就回去了,下面是加载工程;里面的后续跑的
System
.
Diagnostics
.
Stopwatch
sw
=
new
System
.
Diagnostics
.
Stopwatch
();
{
sw
.
Start
();
System
.
Diagnostics
.
Stopwatch
sw
=
new
System
.
Diagnostics
.
Stopwatch
();
sw
.
Start
();
item
.
Init
(
key
,
png
,
jpg
,
jsondata
,
dynamic
,
map
);
sw
.
Start
();
GroupListManager
.
Instance
.
Init_Text
.
text
=
$"初始化消耗时间:
{
sw
.
ElapsedMilliseconds
}
"
;
yield
break
;
}
SaveManager
.
Instance
.
SaveRes
(
key
,
dynamic
,
png
);
SaveManager
.
Instance
.
SaveJPG
(
key
,
jpg_texture
);
SaveManager
.
Instance
.
SaveMap
(
key
,
map
);
SaveManager
.
Instance
.
SaveJson
(
key
,
jsondata
);
while
(!
SaveManager
.
Instance
.
IsSaveOver
)
{
yield
return
null
;
}
item
.
Init
(
key
,
png
,
jpg
,
jsondata
,
dynamic
,
map
);
item
.
Init
(
key
,
png
,
jpg
,
jsondata
,
dynamic
,
map
);
sw
.
Start
();
GroupListManager
.
Instance
.
Init_Text
.
text
=
$"初始化消耗时间:
{
sw
.
ElapsedMilliseconds
}
"
;
//加载本地的
// loadpath = pngpath;
//#if UNITY_ANDROID
// loadpath = "file://" + pngpath;
//#endif
// var www_png = new WWW(pngpath);
// yield return www_png;
// if (www_png.isDone)
// {
// png = www_png.texture;
// }
// loadpath = jpgpath;
//#if UNITY_ANDROID
// loadpath = "file://" + jpgpath;
//#endif
// var www_jpg = new WWW(jpgpath);
// yield return www_jpg;
// if (www_jpg.isDone)
// {
// jpg_texture = www_jpg.texture;
// jpg = Sprite.Create(jpg_texture, new Rect(0, 0, jpg_texture.width, jpg_texture.height), new Vector2(0.5f, 0.5f));
// }
// jsondata = getdata(key);
// item.Init(name, png, jpg, jsondata, dynamic);
}
}
...
...
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