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
b3e87a9a
Commit
b3e87a9a
authored
Aug 07, 2023
by
shujianhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
df72c924
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
91 additions
and
46 deletions
+91
-46
gameIdJsonData.cs
Assets/scripts/Datas/gameIdJsonData.cs
+15
-3
gameSceneLogic.cs
Assets/scripts/Views/gameScene/gameSceneLogic.cs
+44
-24
gameUserInfos.cs
Assets/scripts/Views/gameScene/gameUserInfos.cs
+5
-0
Native.cs
Assets/scripts/Views/maingame/Native.cs
+4
-4
mainGameScaleMove.cs
Assets/scripts/common/mainGameScaleMove.cs
+2
-0
mainGameView.cs
Assets/scripts/common/mainGameView.cs
+19
-5
colorItem.cs
Assets/scripts/perfabItems/colorItem.cs
+1
-7
utilsTools.cs
Assets/scripts/utils/utilsTools.cs
+1
-3
No files found.
Assets/scripts/Datas/gameIdJsonData.cs
View file @
b3e87a9a
...
...
@@ -43,16 +43,28 @@ public class gameIdJsonData
}
public
short
getNextGid
(
short
nowGid
)
{
for
(
int
i
=
0
;
i
<
room
Datas
.
Count
;
i
++)
for
(
int
i
=
0
;
i
<
room
GroupsData
.
Count
;
i
++)
{
if
(
room
Datas
[
i
].
id
.
Equals
(
nowGid
))
if
(
room
GroupsData
[
i
].
id
.
Equals
(
nowGid
))
{
if
(
i
==
roomGroupsData
.
Count
-
1
)
return
-
1
;
if
(
i
.
Equals
(
roomGroupsData
.
Count
-
1
)
)
return
-
1
;
return
roomGroupsData
[
i
+
1
].
id
;
}
}
return
-
1
;
}
public
short
getPrveGid
(
short
nowGid
)
{
for
(
int
i
=
0
;
i
<
roomGroupsData
.
Count
;
i
++)
{
if
(
roomGroupsData
[
i
].
id
.
Equals
(
nowGid
))
{
if
(
i
==
0
)
return
-
1
;
return
roomGroupsData
[
i
-
1
].
id
;
}
}
return
-
1
;
}
public
gameAreaGroupItem
getRoomGroup
(
short
id
)
{
for
(
int
i
=
0
;
i
<
roomGroupsData
.
Count
;
i
++)
...
...
Assets/scripts/Views/gameScene/gameSceneLogic.cs
View file @
b3e87a9a
...
...
@@ -49,6 +49,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
{
Application
.
targetFrameRate
=
60
;
}
utilsTools
.
setGDataByKey
(
"autoFillColor"
,
false
);
dtime
=
DateTime
.
Now
;
if
(
utilsTools
.
ContainsKeyGDataByKey
(
"urlRoot"
)
==
false
)
...
...
@@ -67,6 +68,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
onEvent
(
"tipShowPosMaxScale"
,
onTipShowPosMaxScaleEvent
);
onEvent
(
"gamePlayerEndHandler"
,
onGamePlayerEndHandlerEvent
);
onEvent
(
"closeGameScene"
,
onCloseGameSceneEvent
);
onEvent
(
"removeGroupByGid"
,
onRemoveGroupByGidEvent
);
transform
.
Find
(
"ingameLoad/loadImg"
).
gameObject
.
SetActive
(
false
);
//gameScenUser
var
gridViewList
=
areaGroupList
.
GetComponent
<
gameSceneAreaGroupHandler
>();
...
...
@@ -186,23 +188,6 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
}
var
maingameView
=
gameShowView
.
GetComponent
<
mainGameView
>();
int
idx
=
(
int
)
objects
[
0
];
bool
idxIsIndex
=
true
;
if
(
objects
.
Count
>
1
)
{
idxIsIndex
=
(
bool
)
objects
[
1
];
}
if
(
idxIsIndex
.
Equals
(
false
))
{
short
gid
=
(
short
)
idx
;
for
(
int
i
=
0
;
i
<
groupInfos
.
Count
;
i
++)
{
if
(
gid
.
Equals
(
groupInfos
[
i
].
gid
))
{
idx
=
i
;
break
;
}
}
}
nowidx
=
idx
;
var
nowSelectGroupId
=
groupInfos
[
idx
].
gid
;
item
=
gridViewList
.
getObjectById
(
idx
).
GetComponent
<
colorItem
>();
...
...
@@ -604,13 +589,13 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
//gameEndLogic gameEndlogic = transform.Find("gameEndOperBase").GetComponent<gameEndLogic>();
//gameEndlogic.initView();
//暂时调回放场景
utilsTools
.
sendEvent
(
"
CloseScenePrv
e"
);
utilsTools
.
addTimer_Update
(
gameObject
,
"close"
,
(
String
name
)
=>
{
gameShowView
.
GetComponent
<
mainGameView
>().
onClear
();
SceneManager
.
LoadScene
(
"Scenes/replayeScene"
);
return
false
;
},
10
);
utilsTools
.
sendEvent
(
"
closeGameScen
e"
);
//
utilsTools.addTimer_Update(gameObject, "close", (String name) =>
//
{
//
gameShowView.GetComponent<mainGameView>().onClear();
//
SceneManager.LoadScene("Scenes/replayeScene");
//
return false;
//
}, 10);
}
void
onSelectAreaEvent
(
List
<
UnityEngine
.
Object
>
uobjects
,
List
<
System
.
Object
>
objects
)
{
...
...
@@ -680,8 +665,43 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
}
}
}
public
void
onRemoveGroupByGidEvent
(
List
<
UnityEngine
.
Object
>
uobjects
,
List
<
System
.
Object
>
objects
)
{
short
gid
=
(
short
)
objects
[
0
];
short
gid1
=
(
short
)
objects
[
1
];
for
(
int
i
=
0
;
i
<
groupInfos
.
Count
;
i
++)
{
if
(
groupInfos
[
i
].
gid
.
Equals
(
gid
))
{
nowidx
=
i
;
groupInfos
.
RemoveAt
(
i
);
break
;
}
}
if
(
nowidx
<
0
)
{
for
(
int
i
=
0
;
i
<
groupInfos
.
Count
;
i
++)
{
if
(
groupInfos
[
i
].
gid
.
Equals
(
gid1
))
{
nowidx
=
i
;
break
;
}
}
}
if
(
nowidx
>=
groupInfos
.
Count
)
nowidx
=
groupInfos
.
Count
-
1
;
var
gridViewList
=
areaGroupList
.
GetComponent
<
gameSceneAreaGroupHandler
>();
gradViewBack
gradView
=
(
GameObject
gobject
,
int
idx
,
ListViewBackTypeEnum
lvbType
)
=>
{
this
.
onUpdateGroupGridHandler
(
gobject
,
idx
,
lvbType
,
groupInfos
[
idx
],
false
);
};
gridViewList
.
setDataNoGrid
(
groupInfos
.
Count
,
tempValue1
,
tempValue2
,
tempValue3
,
gradView
,
false
);
var
maingameView
=
gameShowView
.
GetComponent
<
mainGameView
>();
if
(
nowidx
<
0
)
return
;
maingameView
.
switchShowAreaGroup
((
short
)(
groupInfos
[
nowidx
].
gid
));
}
public
void
onCloseGameSceneEvent
(
List
<
UnityEngine
.
Object
>
uobjects
,
List
<
System
.
Object
>
objects
)
{
if
(
utilsTools
.
getGDataByKey
<
bool
>(
"autoFillColor"
,
false
))
return
;
Debug
.
Log
(
"准备关闭"
);
utilsTools
.
sendEvent
(
"CloseScenePrve"
);
utilsTools
.
addTimer_Update
(
gameObject
,
"close"
,
(
String
name
)
=>
...
...
Assets/scripts/Views/gameScene/gameUserInfos.cs
View file @
b3e87a9a
...
...
@@ -26,6 +26,11 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
onEvent
(
"CloseScenePrve"
,
onCloseScenePrveHandler
);
utilsTools
.
addTimer_Update
(
gameObject
,
"first"
,
(
string
name
)
=>
{
if
(
utilsTools
.
ContainsKeyGDataByKey
(
"NativeGameData"
)
==
false
)
{
string
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}"
;
utilsTools
.
setGDataByKey
(
"NativeGameData"
,
JsonUtility
.
FromJson
<
netLableImageItem
>(
json
));
}
if
(
utilsTools
.
ContainsKeyGDataByKey
(
"NativeGameData"
)
==
false
)
{
loadTest
();
...
...
Assets/scripts/Views/maingame/Native.cs
View file @
b3e87a9a
...
...
@@ -18,14 +18,14 @@ public class Native : MonoBehaviour
{
string
param
=
utilsTools
.
getGDataByKey
<
string
>(
"NativeTempData"
,
"splash"
);
showHostMainWindow
(
param
);
#if UNITY_EDITOR
//
#if UNITY_EDITOR
utilsTools
.
addTimer_Sec
(
gameObject
,
"dsfds"
,
(
String
name
)
=>
{
utilsTools
.
setGDataByKey
(
"NativeTempData"
,
"test"
);
jumpGame
(
""
);
return
false
;
},
1
);
#endif
//
#endif
Debug
.
Log
(
"UnityStart"
);
}
private
void
OnEnable
()
...
...
@@ -63,11 +63,11 @@ public class Native : MonoBehaviour
}
void
jumpGame
(
string
json
)
{
#if UNITY_EDITOR
//
#if UNITY_EDITOR
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/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
utilsTools
.
setGDataByKey
(
"NativeGameData"
,
JsonUtility
.
FromJson
<
netLableImageItem
>(
json
));
SceneManager
.
LoadScene
(
utilsTools
.
getGameSceneName
());
...
...
Assets/scripts/common/mainGameScaleMove.cs
View file @
b3e87a9a
...
...
@@ -395,11 +395,13 @@ public class mainGameScaleMove : MonoBehaviour
}
public
void
onAutoFillHander
()
{
if
(
utilsTools
.
getGDataByKey
<
bool
>(
"autoFillColor"
,
false
))
return
;
onResetSizeCenterHandler
();
GetComponent
<
mainGameView
>().
onAutoFillHandler
();
}
public
void
onTipShowPosMaxScale
(
gameAreaItem
areaItem
,
float
width
,
float
height
)
{
if
(
utilsTools
.
getGDataByKey
<
bool
>(
"autoFillColor"
,
false
))
return
;
nowScale
=
new
Vector2
(
maxScale
,
maxScale
);
Vector3
pos
=
new
Vector3
();
float
ptx
=
areaItem
.
px
/
width
*
1.0f
;
//百分比
...
...
Assets/scripts/common/mainGameView.cs
View file @
b3e87a9a
...
...
@@ -43,7 +43,7 @@ public class mainGameView : MonoBehaviour
protected
short
bianlun
=
-
1
;
protected
short
fullShow
=
-
2
;
protected
Texture2D
thumbnailTexture2d
=
null
;
private
bool
isDebugTestToEnd
=
tru
e
;
private
bool
isDebugTestToEnd
=
fals
e
;
public
GameObject
clickPosEff
=
null
;
Dictionary
<
string
,
Color
[
]>
allColor
=
new
Dictionary
<
string
,
Color
[
]>
();
[
SerializeField
]
...
...
@@ -863,7 +863,7 @@ public class mainGameView : MonoBehaviour
{
utilsTools
.
setGDataByKey
(
"firstSwitchShowAreaBegin"
,
utilsTools
.
getTotalMillisecond
());
}
if
(
gid
==
nowSelectgid
)
if
(
gid
.
Equals
(
nowSelectgid
)
)
{
if
(
onAreaHandler
!=
null
)
onAreaHandler
(
gid
,
true
);
...
...
@@ -1367,7 +1367,7 @@ public class mainGameView : MonoBehaviour
//恢复尺寸
//锁定输入
utilsTools
.
setGDataByKey
(
"enableZoomMove"
,
false
);
utilsTools
.
setGDataByKey
(
"autoFillColor"
,
true
);
short
gid
=
nowSelectgid
<
0
?
gameidJsondata
.
roomGroupsData
[
0
].
id
:
nowSelectgid
;
List
<
short
>
aids
=
new
List
<
short
>();
do
...
...
@@ -1375,6 +1375,19 @@ public class mainGameView : MonoBehaviour
getIdsByAreaId
(
gid
,(
short
)(
20
-
aids
.
Count
),
ref
aids
);
gid
=
gameidJsondata
.
getNextGid
(
gid
);
}
while
(
gid
>
-
1
&&
aids
.
Count
<
20
);
if
(
aids
.
Count
<
20
)
{
if
(
nowSelectgid
>
0
)
{
gid
=
gameidJsondata
.
getPrveGid
(
nowSelectgid
);
while
(
gid
>
-
1
)
{
getIdsByAreaId
(
gid
,
(
short
)(
20
-
aids
.
Count
),
ref
aids
);
gid
=
gameidJsondata
.
getPrveGid
(
gid
);
}
}
}
int
idx
=
0
;
int
aidsLen
=
aids
.
Count
();
//查找
...
...
@@ -1386,14 +1399,15 @@ public class mainGameView : MonoBehaviour
var
infos
=
gameidJsondata
.
getAid
(
aid
);
if
(
infos
.
gid
.
Equals
(
nowSelectgid
)
==
false
)
{
in
t
gid
=
infos
.
gid
;
utilsTools
.
sendEventObjectParams
(
"
switchGameAreaGroupId"
,
gid
,
false
);
shor
t
gid
=
infos
.
gid
;
utilsTools
.
sendEventObjectParams
(
"
removeGroupByGid"
,
nowSelectgid
,
gid
);
}
showAreaByPos
(
infos
.
px
,
infos
.
py
,
null
,
true
);
idx
++;
if
(
idx
.
Equals
(
aidsLen
))
{
utilsTools
.
setGDataByKey
(
"enableZoomMove"
,
true
);
utilsTools
.
setGDataByKey
(
"autoFillColor"
,
false
);
return
false
;
}
}
...
...
Assets/scripts/perfabItems/colorItem.cs
View file @
b3e87a9a
...
...
@@ -224,6 +224,7 @@ public class colorItem : MonoBehaviour
{
if
(
isSelect
==
false
&&
isFinish
()
==
false
)
{
if
(
utilsTools
.
getGDataByKey
<
bool
>(
"autoFillColor"
,
false
))
return
;
utilsTools
.
sendEventObjectParams
(
"switchGameAreaGroupId"
,
index
);
}
}
...
...
@@ -233,12 +234,5 @@ public class colorItem : MonoBehaviour
}
public
void
resetSize
(
float
x
,
float
y
)
{
//RectTransform rectTransform = GetComponent<RectTransform>();
//rectTransform.localScale = new Vector3 (100f/x,100f/y, 1);
int
cout
=
transform
.
childCount
;
for
(
int
i
=
0
;
i
<
cout
;
i
++)
{
//transform.GetChild(i).localScale= new Vector3(x/100f, y/100f, 1);
}
}
}
Assets/scripts/utils/utilsTools.cs
View file @
b3e87a9a
...
...
@@ -75,14 +75,12 @@ public class utilsTools
}
public
static
string
getGameSceneName
()
{
if
(
Boolean
.
Parse
(
getGDataByKey
<
string
>(
"showBackPlayer"
,
"false"
)
)
==
false
)
if
(
getGDataByKey
<
string
>(
"Native_name"
,
"main"
).
Equals
(
"mine"
)
==
false
)
{
return
"Scenes/gameScene"
;
}
else
return
"Scenes/replayeScene"
;
}
public
static
bool
removeGDataByKey
(
string
key
)
{
...
...
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