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
3b4b25f7
Commit
3b4b25f7
authored
Aug 09, 2023
by
JiangWanZhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加一些备注
parent
ac8baf3f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
235 additions
and
232 deletions
+235
-232
GameScenUserInfo.cs
Assets/scripts/Datas/GameScenUserInfo.cs
+1
-1
gameAreaGroupItem.cs
Assets/scripts/Datas/gameAreaGroupItem.cs
+1
-1
gameAreaItem.cs
Assets/scripts/Datas/gameAreaItem.cs
+4
-4
gameIdJsonData.cs
Assets/scripts/Datas/gameIdJsonData.cs
+1
-1
gameSceneLogic.cs
Assets/scripts/Views/gameScene/gameSceneLogic.cs
+29
-57
replayerBack.cs
Assets/scripts/Views/replayerScene/replayerBack.cs
+7
-7
checkRootFirstRun.cs
Assets/scripts/common/checkRootFirstRun.cs
+6
-6
mainGameOneImageView.cs
Assets/scripts/common/mainGameOneImageView.cs
+15
-14
mainGameScaleMove.cs
Assets/scripts/common/mainGameScaleMove.cs
+12
-4
mainGameView.cs
Assets/scripts/common/mainGameView.cs
+143
-121
DigitMatrixShort.cs
Assets/scripts/utils/DigitMatrixShort.cs
+10
-10
mainGameViewHelp.cs
Assets/scripts/utils/mainGameViewHelp.cs
+6
-6
No files found.
Assets/scripts/Datas/GameScenUserInfo.cs
View file @
3b4b25f7
...
...
@@ -24,7 +24,7 @@ public class GameScenUserInfo
//以上是url
public
int
status
=
0
;
//0 未开始 1 这个id进过游戏 2 至少有一个区域点亮 3完成
public
double
progress
=
0
;
//0 -- 1 具体自己算百分比
public
List
<
AreaInfoUseData
>
areaInfoUseData
=
new
List
<
AreaInfoUseData
>();
public
List
<
AreaInfoUseData
>
areaInfoUseData
=
new
List
<
AreaInfoUseData
>();
//涂的区域的顺序
private
string
getUrlByLocalPath
(
string
url
)
{
if
(
url
.
StartsWith
(
"http"
)
==
false
)
return
""
;
...
...
Assets/scripts/Datas/gameAreaGroupItem.cs
View file @
3b4b25f7
...
...
@@ -6,7 +6,7 @@ using UnityEngine;
public
class
gameAreaGroupItem
{
public
short
id
;
public
List
<
short
>
roomIds
;
public
List
<
short
>
roomIds
;
//属于这个组的区域id‘集合
public
float
R
;
public
float
G
;
public
float
B
;
...
...
Assets/scripts/Datas/gameAreaItem.cs
View file @
3b4b25f7
...
...
@@ -12,10 +12,10 @@ public class gameAreaItem
public
float
G
;
public
float
B
;
public
short
id
;
public
short
gid
=
-
1
;
//
组
id
public
short
valid
;
//未知
含义 未启用
public
short
useAreaData
;
//未知
含义 未启用
public
bool
notPaintCol
;
//未
启用
public
short
gid
=
-
1
;
//
��i
d
public
short
valid
;
//δ֪
���� ���
public
short
useAreaData
;
//δ֪
���� ���
public
bool
notPaintCol
;
//δ
����
public
string
tempExKey
=
""
;
public
bool
isShow
=
false
;
public
int
threadHandState
=
0
;
...
...
Assets/scripts/Datas/gameIdJsonData.cs
View file @
3b4b25f7
...
...
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using
Unity.VisualScripting
;
using
UnityEngine
;
public
class
gameIdJsonData
public
class
gameIdJsonData
//json文件的所有数据
{
public
string
nowId
=
""
;
public
short
width
=
0
;
...
...
Assets/scripts/Views/gameScene/gameSceneLogic.cs
View file @
3b4b25f7
...
...
@@ -17,6 +17,7 @@ class DebugNetHotData
public
bool
isFile
;
public
string
msg
;
}
//初始化、下载、解压
public
class
gameSceneLogic
:
MonoBehaviour
,
IEventHandler
{
// Start is called before the first frame update
...
...
@@ -58,18 +59,18 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
}
Application
.
SetStackTraceLogType
(
LogType
.
Log
,
StackTraceLogType
.
None
);
onEvent
(
"switchGameAreaGroupId"
,
this
.
onEvent_switchGameAreaGroupId_Handler
);
onEvent
(
"gameViewOnInitEnd"
,
this
.
onEvent_gameViewOnInitEnd_Handler
);
onEvent
(
"gameClickPos"
,
this
.
onEvent_gameClickPos_Handler
);
onEvent
(
"inGameLoadingBarEnd"
,
this
.
onEvent_inGameLoadingBarEnd_Handler
);
onEvent
(
"showAreaEventOk"
,
onSelectAreaEvent
);
onEvent
(
"initViewShowData"
,
onInitViewShowDataEvent
);
onEvent
(
"changeGameUserProgress"
,
onChangeGameUserProgressEvent
);
onEvent
(
"tipShowPosMaxScale"
,
onTipShowPosMaxScaleEvent
);
onEvent
(
"gamePlayerEndHandler"
,
onGamePlayerEndHandlerEvent
);
onEvent
(
"closeGameScene"
,
onCloseGameSceneEvent
);
onEvent
(
"removeGroupByGid"
,
onRemoveGroupByGidEvent
);
transform
.
Find
(
"ingameLoad/loadImg"
).
gameObject
.
SetActive
(
false
);
onEvent
(
"switchGameAreaGroupId"
,
this
.
onEvent_switchGameAreaGroupId_Handler
);
//切换组的ID
onEvent
(
"gameViewOnInitEnd"
,
this
.
onEvent_gameViewOnInitEnd_Handler
);
//游戏图片初始化完成
onEvent
(
"gameClickPos"
,
this
.
onEvent_gameClickPos_Handler
);
//灰色的点击回掉
onEvent
(
"inGameLoadingBarEnd"
,
this
.
onEvent_inGameLoadingBarEnd_Handler
);
//进入游戏的进度条加载完成
onEvent
(
"showAreaEventOk"
,
onSelectAreaEvent
);
//当前组的都涂完了
onEvent
(
"initViewShowData"
,
onInitViewShowDataEvent
);
//初始化数据完成
onEvent
(
"changeGameUserProgress"
,
onChangeGameUserProgressEvent
);
//整体进度改变
onEvent
(
"tipShowPosMaxScale"
,
onTipShowPosMaxScaleEvent
);
// 点提示,当前组随机一个没涂的位置放大
onEvent
(
"gamePlayerEndHandler"
,
onGamePlayerEndHandlerEvent
);
//整个大图都涂完了
onEvent
(
"closeGameScene"
,
onCloseGameSceneEvent
);
//关游戏
onEvent
(
"removeGroupByGid"
,
onRemoveGroupByGidEvent
);
//自动涂gid不一致会调过来
transform
.
Find
(
"ingameLoad/loadImg"
).
gameObject
.
SetActive
(
false
);
//gameScenUser
var
gridViewList
=
areaGroupList
.
GetComponent
<
gameSceneAreaGroupHandler
>();
gridViewList
.
gameObject
.
SetActive
(
false
);
...
...
@@ -86,8 +87,6 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
addHotParams
<
float
>(
"TUSE_doubleTouchScale"
,
"doubleTouchScale"
,
float
.
TryParse
);
addHotParams
<
short
>(
"TUSE_areaOutValue"
,
"areaOutValue"
,
short
.
TryParse
);
addHotParams
<
float
>(
"TUSE_MoveScale"
,
"moveScale"
,
float
.
TryParse
);
addHotParams
<
float
>(
"TUSE_doubleTouchScale"
,
"doubleTouchScale"
,
float
.
TryParse
);
addHotParams
<
float
>(
"TUSE_doubleTouchScale"
,
"doubleTouchScale"
,
float
.
TryParse
);
addHotParams
<
float
>(
"TUSE_dyMinShowFontSize"
,
"dyMinShowFontSize"
,
float
.
TryParse
);
addHotParams
<
int
>(
"TUSE_PhoneOffsetValue"
,
"PhoneOffsetValue"
,
int
.
TryParse
);
return
true
;
...
...
@@ -101,7 +100,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
void
addHotParams
<
T
>(
string
netKey
,
string
localKey
,
StringOutTValue
<
T
>
back
,
NotifyBoolParam
notifyBoolParam
=
null
)
{
string
url
=
string
.
Format
(
"http://www.xn--3-y50c.com:8560/keysOper?key={0}"
,
netKey
)
;
string
url
=
$"http://www.xn--3-y50c.com:8560/keysOper?key=
{
netKey
}
"
;
utilsTools
.
setGDataByKey
(
url
,
localKey
);
utilsTools
.
httpGET
(
this
,
url
,
true
,
(
string
id
,
string
url
,
bool
isSuccess
,
System
.
Object
data
)
=>
{
...
...
@@ -131,6 +130,8 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
{
ActionManages
.
update
();
}
//创建列表item的时候回调并设置、初始化和刷新
private
void
onUpdateGroupGridHandler
(
GameObject
gobject
,
int
idx
,
ListViewBackTypeEnum
lvbType
,
TempGroupInfos
group
,
bool
isFirst
=
false
)
{
if
(
lvbType
==
ListViewBackTypeEnum
.
create
||
ListViewBackTypeEnum
.
update
==
lvbType
)
...
...
@@ -170,6 +171,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
childEventHandlers
[
eventName
](
uobjects
,
objects
);
}
}
//切换组的id
private
void
onEvent_switchGameAreaGroupId_Handler
(
List
<
UnityEngine
.
Object
>
uobjects
,
List
<
System
.
Object
>
objects
)
{
Vector3
vector3
;
...
...
@@ -203,6 +205,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
}
});
}
//游戏图片初始化完成
private
void
onEvent_gameViewOnInitEnd_Handler
(
List
<
UnityEngine
.
Object
>
uobjects
,
List
<
System
.
Object
>
objects
)
{
var
gridViewList
=
areaGroupList
.
GetComponent
<
gameSceneAreaGroupHandler
>();
...
...
@@ -364,7 +367,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
//rectTransform2.localPosition = new Vector3(rectTransform2.localPosition.x, transform1.localPosition.y - 10);
}
private
void
handlerLoadingPosition
(
Image
image
)
private
void
handlerLoadingPosition
(
Image
image
)
//进度条上面的图缩放一下
{
Debug
.
Log
(
"handlerLoadingPosition hand endl"
);
image
.
gameObject
.
SetActive
(
true
);
...
...
@@ -427,11 +430,11 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
{
Debug
.
Log
(
"handlerLoadingPosition hand begin"
);
string
zpath
=
utilsTools
.
getWritableByPath
(
"outFiles/"
+
gameScenUser
.
id
+
".zip"
);
if
(
utilsTools
.
Is
Phone
==
fals
e
)
if
(
utilsTools
.
Is
Win
==
tru
e
)
zpath
=
zpath
.
Replace
(
"/"
,
"\\"
);
gameScenUser
.
createWorkDirectory
();
string
outPath
=
GameScenUserInfo
.
getAllRoot
();
if
(
utilsTools
.
Is
Phone
==
fals
e
)
if
(
utilsTools
.
Is
Win
==
tru
e
)
{
outPath
=
outPath
.
Replace
(
"/"
,
"\\"
);
}
...
...
@@ -447,51 +450,14 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
utilsTools
.
setGDataByKey
(
"downGaoQing"
,
utilsTools
.
getTotalMillisecond
());
gameShowView
.
GetComponent
<
mainGameView
>().
loadGameImgId
();
if
(
utilsTools
.
IsExistIO
(
lineImg
)
==
false
)
{
//utilsTools.httpDOWNIMG(this, gameScenUser.img, lineImg, (string id, string url, bool isSuccess, System.Object data) =>
//{
// return onDownColorImgHandler(id, url, isSuccess, data, lineImg);
//});
}
else
{
//if (utilsTools.IsExistIO(suoluetu) == false)
//{
// //utilsTools.loadLocalImage(this, image, lineImg, (bool isOk) =>
// //{
// // if (isOk)
// // {
// // Debug.Log("sdfdsfds " + (utilsTools.getTotalMillisecond() - temp1).ToSafeString());
// // image.color = Color.white;
// // handlerLoadingPosition(image);
// // }
// //});
//}
//else
//{
// int temp1 = utilsTools.getTotalMillisecond();
// utilsTools.loadLocalImage(this, image, suoluetu, (bool isOk) =>
// {
// if (isOk)
// {
// Debug.Log("sdfdsfds " + (utilsTools.getTotalMillisecond() - temp1).ToSafeString());
// image.color = Color.white;
// handlerLoadingPosition(image);
// }
// });
//}
}
}
//下载和解压zip 没有下载过就去下载线稿图
void
onInitViewShowDataEvent
(
List
<
UnityEngine
.
Object
>
uobjects
,
List
<
System
.
Object
>
objects
)
{
utilsTools
.
setGDataByKey
(
"firstT"
,
utilsTools
.
getTotalMillisecond
());
GameScenUserInfo
gameScenUser
=
(
GameScenUserInfo
)
objects
[
0
];
string
zpath
=
utilsTools
.
getWritableByPath
(
"outFiles/"
+
gameScenUser
.
id
+
".zip"
);
if
(
utilsTools
.
Is
Phone
==
fals
e
)
if
(
utilsTools
.
Is
Win
==
tru
e
)
zpath
=
zpath
.
Replace
(
"/"
,
"\\"
);
string
suoluetu
=
gameScenUser
.
getLocalThumbnailPath
();
Image
image
=
transform
.
Find
(
"ingameLoad/loadImg"
).
GetComponent
<
Image
>();
...
...
@@ -563,6 +529,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
}
}
//整体的进度改变
void
onChangeGameUserProgressEvent
(
List
<
UnityEngine
.
Object
>
uobjects
,
List
<
System
.
Object
>
objects
)
{
int
pro
=
(
int
)
objects
[
0
];
transform
.
Find
(
"ingameLoad"
).
gameObject
.
SetActive
(
false
);
...
...
@@ -571,6 +538,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
UnityEngine
.
UI
.
Slider
slider
=
transform
.
Find
(
"gameProgress"
).
GetComponent
<
UnityEngine
.
UI
.
Slider
>();
slider
.
value
=
pro
;
}
//点提示,当前组随机一个没涂的位置放大
void
onTipShowPosMaxScaleEvent
(
List
<
UnityEngine
.
Object
>
uobjects
,
List
<
System
.
Object
>
objects
)
{
System
.
Object
obj
=
objects
[
0
];
...
...
@@ -579,6 +547,8 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
gameAreaItem
gameAreaItem1
=
obj
as
gameAreaItem
;
gameShowView
.
GetComponent
<
mainGameScaleMove
>().
onTipShowPosMaxScale
(
gameAreaItem1
,
width
,
height
);
}
//整个大图都涂完了
void
onGamePlayerEndHandlerEvent
(
List
<
UnityEngine
.
Object
>
uobjects
,
List
<
System
.
Object
>
objects
)
{
//Debug.Log("游戏完成,播放结束动画");
...
...
@@ -597,6 +567,8 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
// return false;
// }, 10);
}
//当前组的都涂完了
void
onSelectAreaEvent
(
List
<
UnityEngine
.
Object
>
uobjects
,
List
<
System
.
Object
>
objects
)
{
gameAreaItem
gameArea
=
(
gameAreaItem
)
objects
[
0
];
...
...
Assets/scripts/Views/replayerScene/replayerBack.cs
View file @
3b4b25f7
...
...
@@ -44,7 +44,7 @@ public class replayerBack : MonoBehaviour, IEventHandler
initData
();
return
false
;
},
5
);
//string tuijian = "{\"status\":200,\"msg\":\"
请求成功\
",\"sign\":\"\",\"result\":{\"data\":[";
//string tuijian = "{\"status\":200,\"msg\":\"
����ɹ�\",
\"sign\":\"\",\"result\":{\"data\":[";
//for (int i = 0; i < 8; i++)
//{
// tuijian = tuijian + json + ",";
...
...
@@ -132,7 +132,7 @@ public class replayerBack : MonoBehaviour, IEventHandler
keyValuePairs
.
Add
(
idx
,
true
);
}
List
<
Vector2Int
>
removeLists
=
new
List
<
Vector2Int
>();
foreach
(
var
item
in
GroupByAreaPtInfos
.
mapAllDatas
)
//
因为有特意裁处空白保持圆角和长的非1
:2
foreach
(
var
item
in
GroupByAreaPtInfos
.
mapAllDatas
)
//
��Ϊ������ô��հױ���Բ�Ǻͳ��ķ�1:2
{
for
(
int
i
=
0
;
i
<
item
.
Value
.
Count
;
i
++)
{
...
...
@@ -159,11 +159,11 @@ public class replayerBack : MonoBehaviour, IEventHandler
GameScenUserInfo
gameScenUser
=
(
GameScenUserInfo
)
objects
[
0
];
nowGameScenUser
=
gameScenUser
;
string
zpath
=
utilsTools
.
getWritableByPath
(
"outFiles/"
+
gameScenUser
.
id
+
".zip"
);
if
(
utilsTools
.
Is
Phone
==
fals
e
)
if
(
utilsTools
.
Is
Win
==
tru
e
)
zpath
=
zpath
.
Replace
(
"/"
,
"\\"
);
string
suoluetu
=
gameScenUser
.
getColorImgLocalPath
();
//gameScenUser.getLocalThumbnailPath();
Image
image
=
mainShowView
.
GetComponent
<
Image
>();
image
.
color
=
new
Color
(
1
,
1
,
1
,
0
);
//未
加载出来时候就透明化
image
.
color
=
new
Color
(
1
,
1
,
1
,
0
);
//δ
���س���ʱ�������
string
key
=
gameScenUser
.
id
+
"_showAd"
;
showAd
=
utilsDB
.
getDBBoolDataByKey
(
key
,
showAd
);
if
(
utilsTools
.
IsExistIO
(
suoluetu
)
==
false
)
...
...
@@ -319,7 +319,7 @@ public class replayerBack : MonoBehaviour, IEventHandler
utilsTools
.
sendEvent
(
"CloseScenePrve"
);
utilsTools
.
addTimer_Update
(
gameObject
,
"close"
,
(
String
name
)
=>
{
Debug
.
Log
(
"
关闭
"
);
Debug
.
Log
(
"
�ر�"
);
var
gameBackJavaData
=
utilsTools
.
getGDataByKey
<
GameBackJavaData
>(
"gameBackJavaData"
,
null
);
gameBackJavaData
.
name
=
"replayer"
;
if
(
gameBackJavaData
==
null
)
...
...
@@ -499,7 +499,7 @@ public class replayerBack : MonoBehaviour, IEventHandler
{
if
(
mp4OperNext
==
1
)
{
Debug
.
Log
(
"
分享中
"
);
Debug
.
Log
(
"
������"
);
gameObject
.
transform
.
Find
(
"inSaveProgress"
).
gameObject
.
SetActive
(
false
);
utilsTools
.
share
(
""
,
gameObject
.
name
,
""
);
}
...
...
@@ -507,7 +507,7 @@ public class replayerBack : MonoBehaviour, IEventHandler
{
gameObject
.
transform
.
Find
(
"inSaveProgress/fore"
).
gameObject
.
SetActive
(
false
);
gameObject
.
transform
.
Find
(
"inSaveProgress/end"
).
gameObject
.
SetActive
(
true
);
Debug
.
Log
(
"
保存完成
"
);
Debug
.
Log
(
"
�������"
);
}
}
}
...
...
Assets/scripts/common/checkRootFirstRun.cs
View file @
3b4b25f7
...
...
@@ -6,7 +6,7 @@ using Unity.VisualScripting;
using
UnityEngine
;
using
UnityEngine.UI
;
//
这个节点必须在现实的下边
//
����ڵ��������ʵ���±�
class
PosChecks
{
public
Vector2
pos
;
...
...
@@ -122,7 +122,7 @@ public class checkRootFirstRun : MonoBehaviour
var
an1
=
new
Vector2
(
x1
,
y1
);
Debug
.
Log
(
an1
);
utilsTools
.
setAnchor
(
gobject
,
an1
);
if
(
utilsTools
.
Is
Phone
==
fals
e
){
if
(
utilsTools
.
Is
Win
==
tru
e
){
gobject
.
localScale
=
new
Vector2
(
0.2f
,
0.2f
);
ActionManages
.
addMoveByScale
(
gobject
.
gameObject
,
9
,
5f
,
(
GameObject
_
,
int
id
)
=>{
gobject
.
localScale
=
new
Vector2
(
0.2f
,
0.2f
);
...
...
@@ -134,7 +134,7 @@ public class checkRootFirstRun : MonoBehaviour
int
i
=
posChecks
[
0
].
isUse
==
false
?
0
:
(
posChecks
[
1
].
isUse
==
false
?
1
:
-
1
);
if
(
i
==
-
1
)
{
//
先清理一边老的的
//
������һ���ϵĵ�
drawBlock
(
posChecks
[
0
].
pos
,
backColor
);
posChecks
[
0
].
isUse
=
false
;
drawBlock
(
posChecks
[
1
].
pos
,
backColor
);
...
...
@@ -167,7 +167,7 @@ public class checkRootFirstRun : MonoBehaviour
}
private
void
LateUpdate
()
{
if
(
utilsTools
.
Is
Phone
)
if
(
utilsTools
.
Is
Win
)
{
if
(
Input
.
touchCount
==
2
)
{
...
...
@@ -271,13 +271,13 @@ public class checkRootFirstRun : MonoBehaviour
Vector2
vector
=
utilsTools
.
ScreenToUILocalPos
(
rectTransform
,
tempPos
.
pos
);
if
(
rectTransform
.
rect
.
Contains
(
vector
))
{
Debug
.
Log
(
"
在区域内
"
);
Debug
.
Log
(
"
��������"
);
tempPos
.
pos
=
vector
;
pushDrawPos
();
}
else
{
Debug
.
Log
(
"
不在区域内
"
);
Debug
.
Log
(
"
����������"
);
}
}
}
...
...
Assets/scripts/common/mainGameOneImageView.cs
View file @
3b4b25f7
...
...
@@ -7,7 +7,7 @@ using Unity.VisualScripting;
using
UnityEngine
;
using
UnityEngine.UI
;
public
class
mainGameOneImageView
:
mainGameView
public
class
mainGameOneImageView
:
mainGameView
//回放上面,回放用的是一张图片
{
// Start is called before the first frame update
public
GameObject
oneImg
=
null
;
...
...
@@ -169,7 +169,7 @@ public class mainGameOneImageView : mainGameView
});
if
(
cout
==
0
)
{
//没
有可渲染区域
//û
�п���Ⱦ����
removeAids
.
Add
(
item
.
m_aid
);
List
<
Vector2Short
>
tempLineColors
=
new
List
<
Vector2Short
>();
groupPtInfo
.
getLineByAid
(
item
.
m_aid
,
ref
tempLineColors
);
...
...
@@ -207,7 +207,7 @@ public class mainGameOneImageView : mainGameView
if
(
removeAids
.
Count
>
0
)
{
//
移除已经播放完成
//
�Ƴ��Ѿ��������
foreach
(
var
aid
in
removeAids
)
{
for
(
int
i
=
0
;
i
<
showAreaAnimationDatas
.
Count
;
i
++)
...
...
@@ -222,7 +222,7 @@ public class mainGameOneImageView : mainGameView
drawThumbnailByAid
(
removeAids
);
if
(
showAreaAnimationDatas
.
Count
==
0
)
{
//
保存一次缩略遮罩
图
//
����һ����������ͼ
if
(
utilsTools
.
isEqualByValue
(
gameScenUseInfo
.
progress
,
1.0
,
0.0000002f
))
{
TaskManages
.
getInstance
().
addTask
(
this
,
(
System
.
Object
[]
parma
)
=>
...
...
@@ -249,7 +249,7 @@ public class mainGameOneImageView : mainGameView
},
4
);
return
;
}
//为
缩略图准备
//Ϊ
����ͼ��
Vector2Short
vector2Short
=
allColorSize
[
"final"
];
Vector2Short
vector2ShortOut
=
allColorSize
[
"outColor"
];
Color
[]
colors
=
new
Color
[
vector2Short
.
x
*
vector2Short
.
y
];
...
...
@@ -308,7 +308,7 @@ public class mainGameOneImageView : mainGameView
lineImg
.
SetActive
(
false
);
return
;
}
//
显示指定区域
//
��ʾָ������
if
(
GroupByAreaPtInfos
.
mapAllDatas
.
ContainsKey
((
short
)
areaId
))
{
gameAreaItem
areaItem1
=
gameidJsondata
.
getAid
((
short
)
areaId
);
...
...
@@ -329,7 +329,7 @@ public class mainGameOneImageView : mainGameView
allColor2
[
"outColor"
][
idx
]
=
color
;
allColor2
[
"thumbnail"
][
y
*
size2
.
x
+
x
]
=
color
;
}
//
边缘怎
么弄?
//
��Ե��ôŪ
?
if
(
isApply
==
true
)
{
Apply
();
...
...
@@ -341,7 +341,7 @@ public class mainGameOneImageView : mainGameView
}
}
//
回放使用
//
�ط�ʹ��
public
void
showAreaPrveClear
(
bool
isfirst
)
{
if
(
InitEndIsShowLine
==
false
)
{
...
...
@@ -373,7 +373,7 @@ public class mainGameOneImageView : mainGameView
}
public
override
void
resetSize
()
{
//
怎么保持宽高比
//
��ô���ֿ��߱�
if
(
InitEndIsShowLine
==
true
)
{
float
width
=
gameidJsondata
.
width
;
...
...
@@ -391,7 +391,7 @@ public class mainGameOneImageView : mainGameView
width
=
utilsTools
.
DisplaySize
.
x
*
0.65f
;
height
=
width
*
2
;
}
//确
定好宽高后赋
值
//ȷ
���ÿ��ߺ�ֵ
GameObject
[]
gameObjects
=
{
oneImg
,
areaIdBase
};
Vector3
tempPos
=
rectTransform
.
localPosition
;
if
(
width
.
Equals
(
height
)
==
false
)
...
...
@@ -533,10 +533,11 @@ public class mainGameOneImageView : mainGameView
});
}
}
public
void
idHashPosToArrayPosEx
()
public
void
idHashPosToArrayPosEx
()
{
idHashPosToArrayPos
();
//
将边缘重复放入周边区域
//
����Ե�ظ������ܱ����� 将边缘重复放入周边区域
for
(
int
i
=
0
;
i
<
allBianLun
.
Count
();
i
++)
{
int
idx
=
allBianLun
[
i
];
...
...
@@ -729,13 +730,13 @@ public class mainGameOneImageView : mainGameView
}
utilsTools
.
setGDataByKey
(
"loadBinBegin"
,
utilsTools
.
getTotalMillisecond
());
string
binpath
=
colorPath
.
Substring
(
0
,
linePath
.
Length
-
4
)
+
".bin"
;
if
(
utilsTools
.
Is
Phone
==
fals
e
)
if
(
utilsTools
.
Is
Win
==
tru
e
)
{
binpath
=
binpath
.
Replace
(
"/"
,
"\\"
);
}
Byte
[]
bytes
=
File
.
ReadAllBytes
(
binpath
);
bytesInitDigitMatrix
(
bytes
);
Debug
.
Log
(
"bin
初始化完成
--------------"
);
Debug
.
Log
(
"bin
��ʼ�����---
-----------"
);
int
start
=
0
;
int
step
=
BitConverter
.
GetBytes
((
short
)
2
).
Length
;
int
stepInt
=
BitConverter
.
GetBytes
(
65539
).
Length
;
...
...
Assets/scripts/common/mainGameScaleMove.cs
View file @
3b4b25f7
...
...
@@ -68,6 +68,8 @@ public class mainGameScaleMove : MonoBehaviour
resetBtn
.
SetActive
(
false
);
}
}
public
void
setCheckInput
()
{
if
(
checkInput
==
null
)
...
...
@@ -273,11 +275,17 @@ public class mainGameScaleMove : MonoBehaviour
}
Vector2
diff
=
new
Vector2
(
Input
.
mousePosition
.
x
+
winPrvePos
.
x
,
Input
.
mousePosition
.
y
+
winPrvePos
.
y
);
onOneTouchMove
(
Input
.
mousePosition
,
diff
);
}
else
if
(
utilsTools
.
ContainsKey
(
gameObject
,
"oneTouchBegin"
))
}
else
if
(
utilsTools
.
ContainsKey
(
gameObject
,
"oneTouchBegin"
))
{
Vector2
diff
=
new
Vector2
(
Input
.
mousePosition
.
x
+
winPrvePos
.
x
,
Input
.
mousePosition
.
y
+
winPrvePos
.
y
);
onOneTouchEnd
(
Input
.
mousePosition
,
diff
);
}
}
private
void
onOneTouchBegin
(
Vector2
vector2
)
{
...
...
@@ -367,7 +375,7 @@ public class mainGameScaleMove : MonoBehaviour
// Update is called once per frame
void
Update
()
{
if
(
checkInput
!=
null
)
{
if
(
utilsTools
.
getGDataByKey
<
bool
>(
"enableZoomMove"
,
false
))
...
...
@@ -375,7 +383,6 @@ public class mainGameScaleMove : MonoBehaviour
checkInput
();
}
}
}
private
void
updateScaleView
()
{
...
...
@@ -406,12 +413,13 @@ public class mainGameScaleMove : MonoBehaviour
Vector3
pos
=
new
Vector3
();
float
ptx
=
areaItem
.
px
/
width
*
1.0f
;
//百分比
float
pty
=
areaItem
.
py
/
height
*
1.0f
;
for
(
int
i
=
0
;
i
<
transform
.
childCount
;
i
++)
{
var
itemChild
=
transform
.
GetChild
(
i
);
itemChild
.
localScale
=
nowScale
;
}
Debug
.
Log
(
areaItem
.
ToString
());
RectTransform
idAreaRectTransform
=
transform
.
Find
(
"areaIdBase/"
+
areaItem
.
tempExKey
).
GetComponent
<
RectTransform
>();
pos
=
idAreaRectTransform
.
localPosition
*
-
1
*
nowScale
/
initScale
;
...
...
Assets/scripts/common/mainGameView.cs
View file @
3b4b25f7
This diff is collapsed.
Click to expand it.
Assets/scripts/utils/DigitMatrixShort.cs
View file @
3b4b25f7
...
...
@@ -5,21 +5,21 @@ using System;
using
UnityEngine.UIElements
;
using
Unity.VisualScripting
;
/// <summary>
///
数字矩阵
///
���־���
/// </summary>
public
class
DigitMatrixShort
public
class
DigitMatrixShort
//泛洪算法 颜料桶算法
{
#
region
属性
#
region
����
public
DigitMatrixSetBack
back
=
null
;
public
DigitMatrixIsEqual
<
short
>
isEqualItem
=
null
;
public
bool
isPause
=
false
;
/// <summary>
///
行数
///
����
/// </summary>
public
short
RowCount
{
get
;
private
set
;
}
/// <summary>
///
列数
///
����
/// </summary>
public
short
ColumnCount
{
get
;
private
set
;
}
...
...
@@ -72,15 +72,15 @@ public class DigitMatrixShort
},
bianLun
,
false
);
//foreach (var item in tempPts)
//{
// Data[item.Item1, item.Item2] = oldValue;//
恢复
// Data[item.Item1, item.Item2] = oldValue;//
�ָ�
//}
}
#
region
FloodFill8WithStack
/// <summary>
///
漫水填充(基于堆的8邻域填充
)
///
��ˮ���(���ڶѵ�8�������)
/// </summary>
/// <param name="r">
行
</param>
/// <param name="c">
列
</param>
/// <param name="r">
��<
/param>
/// <param name="c">
��<
/param>
/// <param name="newValue"></param>
/// <param name="oldValue"></param>
/// <param name="matrix"></param>
...
...
@@ -135,7 +135,7 @@ public class DigitMatrixShort
CheckNewSeed
(
r
-
1
,
c
+
1
);
CheckNewSeed
(
r
+
1
,
c
-
1
);
tryValues
=
tryValues
+
1
;
if
(
tryValues
>
4096
*
4096
*
10
)
break
;
//
基本死循环了
if
(
tryValues
>
4096
*
4096
*
10
)
break
;
//
������ѭ����
}
}
#
endregion
...
...
Assets/scripts/utils/mainGameViewHelp.cs
View file @
3b4b25f7
...
...
@@ -26,7 +26,7 @@ public class AreaAnimationDiffuse
public
short
m_y
;
public
short
m_aid
;
public
short
m_fpsStart
=
1
;
//r 开始
public
short
m_fpsEnd
=
100
;
//r 结束
public
short
m_fpsEnd
=
50
;
//r 结束 这个值调大了可以让动画效果变快,小了就是变慢
//key beginStart 值 value 这个圆环的像素
public
ConcurrentDictionary
<
short
,
List
<
short
>>
m_datas
=
new
ConcurrentDictionary
<
short
,
List
<
short
>>();
public
int
nowState
=
0
;
//0 尚未开始 1 处理中 2 处理完成
...
...
@@ -71,12 +71,12 @@ public class RectInt
dowm
=
rectInt
.
dowm
;
}
}
public
class
GroupByAreaPtInfos
public
class
GroupByAreaPtInfos
//把组和大图对应的区域关联起来
{
//public Dictionary<short, List<Vector2Short>> datas = new Dictionary<short, List<Vector2Short>>();
public
Dictionary
<
short
,
bool
>
datasBool
=
new
Dictionary
<
short
,
bool
>();
private
Dictionary
<
short
,
bool
>
lines
=
new
Dictionary
<
short
,
bool
>();
public
static
Dictionary
<
short
,
List
<
int
>>
mapAllDatas
=
new
Dictionary
<
short
,
List
<
int
>>();
public
Dictionary
<
short
,
bool
>
datasBool
=
new
Dictionary
<
short
,
bool
>();
//key 区域id bool true:没涂
private
Dictionary
<
short
,
bool
>
lines
=
new
Dictionary
<
short
,
bool
>();
//key:区域id true没涂
public
static
Dictionary
<
short
,
List
<
int
>>
mapAllDatas
=
new
Dictionary
<
short
,
List
<
int
>>();
//key:区域id value:全部的像素点坐标
public
static
int
width
;
public
static
int
height
;
public
bool
getDataByAid
(
short
aid
,
ref
List
<
Vector2Short
>
data
,
bool
isReBack
=
false
)
...
...
@@ -203,7 +203,7 @@ public class ColorIndexTables
color
=
new
Color
(
temp
.
r
,
temp
.
g
,
temp
.
b
,
temp
.
a
);
return
true
;
}
public
bool
getTiledColor
(
int
x
,
int
y
,
ref
Color
color
)
public
bool
getTiledColor
(
int
x
,
int
y
,
ref
Color
color
)
//选中区域整个铺满
{
if
(
x
<
0
)
{
...
...
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