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
f3192eda
Commit
f3192eda
authored
Jul 04, 2023
by
shujianhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 缩放和移动后正常点击区域并逐渐填充,点击后气泡扩散暂未实现
parent
a3463f7f
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
963 additions
and
659 deletions
+963
-659
gameScene.unity
Assets/Scenes/gameScene.unity
+51
-139
gameAreaGroupItem.cs
Assets/scripts/Datas/gameAreaGroupItem.cs
+15
-4
gameAreaItem.cs
Assets/scripts/Datas/gameAreaItem.cs
+12
-4
gameIdJsonData.cs
Assets/scripts/Datas/gameIdJsonData.cs
+2
-2
gameSceneLogic.cs
Assets/scripts/Views/gameScene/gameSceneLogic.cs
+64
-95
gameUserInfos.cs
Assets/scripts/Views/gameScene/gameUserInfos.cs
+12
-5
mainGameScaleMove.cs
Assets/scripts/common/mainGameScaleMove.cs
+65
-56
mainGameView.cs
Assets/scripts/common/mainGameView.cs
+577
-235
nodeNetProxy.cs
Assets/scripts/common/nodeNetProxy.cs
+22
-13
MouseDragSelect.cs
Assets/scripts/test/MouseDragSelect.cs
+7
-7
tempzhangs.cs
Assets/scripts/test/tempzhangs.cs
+5
-5
TaskManages.cs
Assets/scripts/utils/TaskManages.cs
+46
-9
utilsTools.cs
Assets/scripts/utils/utilsTools.cs
+1
-2
shadercompiler-UnityShaderCompiler.exe0.log
Logs/shadercompiler-UnityShaderCompiler.exe0.log
+3
-0
default-2022.dwlt
UserSettings/Layouts/default-2022.dwlt
+81
-83
Assembly-CSharp.csproj.AssemblyReference.cache
obj/Debug/Assembly-CSharp.csproj.AssemblyReference.cache
+0
-0
tsmi.db
tsmi.db
+0
-0
No files found.
Assets/Scenes/gameScene.unity
View file @
f3192eda
...
@@ -794,6 +794,7 @@ GameObject:
...
@@ -794,6 +794,7 @@ GameObject:
serializedVersion
:
6
serializedVersion
:
6
m_Component
:
m_Component
:
-
component
:
{
fileID
:
593691933
}
-
component
:
{
fileID
:
593691933
}
-
component
:
{
fileID
:
593691934
}
m_Layer
:
0
m_Layer
:
0
m_Name
:
areaIdBase
m_Name
:
areaIdBase
m_TagString
:
Untagged
m_TagString
:
Untagged
...
@@ -821,6 +822,51 @@ RectTransform:
...
@@ -821,6 +822,51 @@ RectTransform:
m_AnchoredPosition
:
{
x
:
0
,
y
:
0
}
m_AnchoredPosition
:
{
x
:
0
,
y
:
0
}
m_SizeDelta
:
{
x
:
950
,
y
:
1280
}
m_SizeDelta
:
{
x
:
950
,
y
:
1280
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!61
&593691934
BoxCollider2D
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
593691932
}
m_Enabled
:
1
m_Density
:
1
m_Material
:
{
fileID
:
0
}
m_IncludeLayers
:
serializedVersion
:
2
m_Bits
:
0
m_ExcludeLayers
:
serializedVersion
:
2
m_Bits
:
0
m_LayerOverridePriority
:
0
m_ForceSendLayers
:
serializedVersion
:
2
m_Bits
:
4294967295
m_ForceReceiveLayers
:
serializedVersion
:
2
m_Bits
:
4294967295
m_ContactCaptureLayers
:
serializedVersion
:
2
m_Bits
:
4294967295
m_CallbackLayers
:
serializedVersion
:
2
m_Bits
:
4294967295
m_IsTrigger
:
1
m_UsedByEffector
:
0
m_UsedByComposite
:
0
m_Offset
:
{
x
:
0
,
y
:
0
}
m_SpriteTilingProperty
:
border
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
0
}
pivot
:
{
x
:
0
,
y
:
0
}
oldSize
:
{
x
:
0
,
y
:
0
}
newSize
:
{
x
:
0
,
y
:
0
}
adaptiveTilingThreshold
:
0
drawMode
:
0
adaptiveTiling
:
0
m_AutoTiling
:
0
serializedVersion
:
2
m_Size
:
{
x
:
950
,
y
:
1280
}
m_EdgeRadius
:
0
---
!u!1
&706874198
---
!u!1
&706874198
GameObject
:
GameObject
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
@@ -897,142 +943,6 @@ CanvasRenderer:
...
@@ -897,142 +943,6 @@ CanvasRenderer:
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
706874198
}
m_GameObject
:
{
fileID
:
706874198
}
m_CullTransparentMesh
:
1
m_CullTransparentMesh
:
1
---
!u!1
&759592344
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
759592345
}
-
component
:
{
fileID
:
759592347
}
-
component
:
{
fileID
:
759592346
}
m_Layer
:
0
m_Name
:
debugView
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!224
&759592345
RectTransform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
759592344
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_ConstrainProportionsScale
:
0
m_Children
:
[]
m_Father
:
{
fileID
:
1474894691
}
m_RootOrder
:
-1
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0
,
y
:
0.5
}
m_AnchorMax
:
{
x
:
1
,
y
:
0.5
}
m_AnchoredPosition
:
{
x
:
-5.9033203
,
y
:
-1559.2
}
m_SizeDelta
:
{
x
:
-74.776
,
y
:
136.63
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!114
&759592346
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
759592344
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
f4688fdb7df04437aeb418b961361dc5
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
m_Material
:
{
fileID
:
0
}
m_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
m_RaycastTarget
:
0
m_RaycastPadding
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
0
}
m_Maskable
:
1
m_OnCullStateChanged
:
m_PersistentCalls
:
m_Calls
:
[]
m_text
:
this is a testtextxfx zdfzsdfdsfdsfdsfffffffff ffffffffffffff ffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff fffffffffffffffffffffffffffff5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffssssssssssssssssssssssssssssssssssssffffffhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
m_isRightToLeft
:
0
m_fontAsset
:
{
fileID
:
11400000
,
guid
:
8f586378b4e144a9851e7b34d9b748ee
,
type
:
2
}
m_sharedMaterial
:
{
fileID
:
2180264
,
guid
:
8f586378b4e144a9851e7b34d9b748ee
,
type
:
2
}
m_fontSharedMaterials
:
[]
m_fontMaterial
:
{
fileID
:
0
}
m_fontMaterials
:
[]
m_fontColor32
:
serializedVersion
:
2
rgba
:
4287981311
m_fontColor
:
{
r
:
1
,
g
:
0.40060285
,
b
:
0.58431375
,
a
:
1
}
m_enableVertexGradient
:
0
m_colorMode
:
3
m_fontColorGradient
:
topLeft
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
topRight
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
bottomLeft
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
bottomRight
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
m_fontColorGradientPreset
:
{
fileID
:
0
}
m_spriteAsset
:
{
fileID
:
0
}
m_tintAllSprites
:
0
m_StyleSheet
:
{
fileID
:
0
}
m_TextStyleHashCode
:
-1183493901
m_overrideHtmlColors
:
0
m_faceColor
:
serializedVersion
:
2
rgba
:
4294967295
m_fontSize
:
36
m_fontSizeBase
:
36
m_fontWeight
:
400
m_enableAutoSizing
:
0
m_fontSizeMin
:
18
m_fontSizeMax
:
72
m_fontStyle
:
0
m_HorizontalAlignment
:
2
m_VerticalAlignment
:
512
m_textAlignment
:
65535
m_characterSpacing
:
0
m_wordSpacing
:
0
m_lineSpacing
:
0
m_lineSpacingMax
:
0
m_paragraphSpacing
:
0
m_charWidthMaxAdj
:
0
m_enableWordWrapping
:
1
m_wordWrappingRatios
:
0.4
m_overflowMode
:
3
m_linkedTextComponent
:
{
fileID
:
0
}
parentLinkedComponent
:
{
fileID
:
0
}
m_enableKerning
:
1
m_enableExtraPadding
:
0
checkPaddingRequired
:
0
m_isRichText
:
1
m_parseCtrlCharacters
:
1
m_isOrthographic
:
1
m_isCullingEnabled
:
0
m_horizontalMapping
:
0
m_verticalMapping
:
0
m_uvLineOffset
:
0
m_geometrySortingOrder
:
0
m_IsTextObjectScaleStatic
:
0
m_VertexBufferAutoSizeReduction
:
0
m_useMaxVisibleDescender
:
1
m_pageToDisplay
:
1
m_margin
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
0
}
m_isUsingLegacyAnimationComponent
:
0
m_isVolumetricText
:
0
m_hasFontAssetChanged
:
0
m_baseMaterial
:
{
fileID
:
0
}
m_maskOffset
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
0
}
---
!u!222
&759592347
CanvasRenderer
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
759592344
}
m_CullTransparentMesh
:
1
---
!u!1
&859724157
---
!u!1
&859724157
GameObject
:
GameObject
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
@@ -1536,7 +1446,6 @@ RectTransform:
...
@@ -1536,7 +1446,6 @@ RectTransform:
-
{
fileID
:
1656126341
}
-
{
fileID
:
1656126341
}
-
{
fileID
:
1013381886
}
-
{
fileID
:
1013381886
}
-
{
fileID
:
133508485
}
-
{
fileID
:
133508485
}
-
{
fileID
:
759592345
}
m_Father
:
{
fileID
:
297775248
}
m_Father
:
{
fileID
:
297775248
}
m_RootOrder
:
-1
m_RootOrder
:
-1
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
...
@@ -1761,6 +1670,7 @@ MonoBehaviour:
...
@@ -1761,6 +1670,7 @@ MonoBehaviour:
lowImg
:
{
fileID
:
303685715
}
lowImg
:
{
fileID
:
303685715
}
areaIdBase
:
{
fileID
:
593691932
}
areaIdBase
:
{
fileID
:
593691932
}
perfabPath
:
perfabs/areaGroupId
perfabPath
:
perfabs/areaGroupId
lowImgTexture2ds
:
[]
---
!u!114
&1656126344
---
!u!114
&1656126344
MonoBehaviour
:
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
@@ -1780,7 +1690,9 @@ MonoBehaviour:
...
@@ -1780,7 +1690,9 @@ MonoBehaviour:
-
{
fileID
:
1893464095
}
-
{
fileID
:
1893464095
}
-
{
fileID
:
1755905471
}
-
{
fileID
:
1755905471
}
-
{
fileID
:
133508484
}
-
{
fileID
:
133508484
}
-
{
fileID
:
759592344
}
-
{
fileID
:
0
}
-
{
fileID
:
0
}
DebugSprites
:
[]
---
!u!222
&1656126346
---
!u!222
&1656126346
CanvasRenderer
:
CanvasRenderer
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
@@ -2085,7 +1997,7 @@ MonoBehaviour:
...
@@ -2085,7 +1997,7 @@ MonoBehaviour:
m_HandleRect
:
{
fileID
:
1977147924
}
m_HandleRect
:
{
fileID
:
1977147924
}
m_Direction
:
0
m_Direction
:
0
m_Value
:
1
m_Value
:
1
m_Size
:
1
m_Size
:
0.9999999
m_NumberOfSteps
:
0
m_NumberOfSteps
:
0
m_OnValueChanged
:
m_OnValueChanged
:
m_PersistentCalls
:
m_PersistentCalls
:
...
...
Assets/scripts/Datas/gameAreaGroupItem.cs
View file @
f3192eda
...
@@ -5,11 +5,22 @@ using UnityEngine;
...
@@ -5,11 +5,22 @@ using UnityEngine;
[System.Serializable]
[System.Serializable]
public
class
gameAreaGroupItem
public
class
gameAreaGroupItem
{
{
public
double
gid
;
public
short
id
;
public
List
<
short
>
areaIds
;
public
List
<
short
>
roomIds
;
public
List
<
UInt16
>
RGB
;
public
float
R
;
public
float
G
;
public
float
B
;
public
bool
isComplete
=
false
;
public
void
getRGB
(
out
Color
color
)
public
void
getRGB
(
out
Color
color
)
{
{
color
=
new
Color
(
RGB
[
0
]
/
255
,
RGB
[
1
]
/
255
,
RGB
[
2
]
/
255
,
1
);
color
=
new
Color
(
R
/
255f
,
G
/
255f
,
B
/
255f
,
1
);
}
public
static
int
sortByIsComplete
(
gameAreaGroupItem
a
,
gameAreaGroupItem
b
)
{
if
(
a
.
isComplete
==
b
.
isComplete
)
{
return
a
.
id
-
b
.
id
;
}
return
a
.
isComplete
?
1
:
-
1
;
}
}
}
}
Assets/scripts/Datas/gameAreaItem.cs
View file @
f3192eda
...
@@ -5,9 +5,17 @@ using UnityEngine;
...
@@ -5,9 +5,17 @@ using UnityEngine;
[System.Serializable]
[System.Serializable]
public
class
gameAreaItem
public
class
gameAreaItem
{
{
public
short
x
;
public
short
px
;
public
short
y
;
public
short
py
;
public
ushort
id
;
public
short
pr
;
public
short
gid
;
public
float
R
;
public
float
G
;
public
float
B
;
public
short
id
;
public
short
gid
=
-
1
;
//组id
public
short
valid
;
//未知含义 未启用
public
short
useAreaData
;
//未知含义 未启用
public
bool
notPaintCol
;
//未启用
public
string
tempExKey
=
""
;
public
string
tempExKey
=
""
;
public
bool
isShow
=
false
;
}
}
Assets/scripts/Datas/gameIdJsonData.cs
View file @
f3192eda
...
@@ -7,6 +7,6 @@ public class gameIdJsonData
...
@@ -7,6 +7,6 @@ public class gameIdJsonData
public
string
nowId
=
""
;
public
string
nowId
=
""
;
public
short
width
=
0
;
public
short
width
=
0
;
public
short
height
=
0
;
public
short
height
=
0
;
public
List
<
gameAreaItem
>
center
s
=
new
List
<
gameAreaItem
>();
public
List
<
gameAreaItem
>
roomData
s
=
new
List
<
gameAreaItem
>();
public
List
<
gameAreaGroupItem
>
groups
=
new
List
<
gameAreaGroupItem
>();
public
List
<
gameAreaGroupItem
>
roomGroupsData
=
new
List
<
gameAreaGroupItem
>();
}
}
Assets/scripts/Views/gameScene/gameSceneLogic.cs
View file @
f3192eda
using
System
;
using
System.Collections
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
TMPro
;
using
TMPro
;
using
Unity.VisualScripting
;
using
Unity.VisualScripting
;
using
UnityEngine
;
using
UnityEngine
;
using
UnityEngine.UI
;
public
class
gameSceneLogic
:
MonoBehaviour
,
IEventHandler
public
class
gameSceneLogic
:
MonoBehaviour
,
IEventHandler
{
{
...
@@ -10,58 +12,51 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
...
@@ -10,58 +12,51 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
public
GameObject
gameShowView
=
null
;
public
GameObject
gameShowView
=
null
;
public
GameObject
areaGroupList
=
null
;
public
GameObject
areaGroupList
=
null
;
public
static
int
maxIdValue
=
100
;
public
static
int
maxIdValue
=
100
;
private
int
now
SelectGroupId
=
4
;
private
int
now
idx
=
4
;
public
float
progress
=
0
;
public
float
progress
=
0
;
public
bool
showAreaId
=
true
;
public
bool
showAreaId
=
true
;
private
TextMeshProUGUI
debugViewObj
=
null
;
private
TextMeshProUGUI
debugViewObj
=
null
;
private
List
<
TempGroupInfos
>
groupInfos
=
null
;
private
Vector2
pos1
=
new
Vector2
(-
10000
,
-
10000
);
private
int
rvalue
=
-
1
;
void
Start
()
void
Start
()
{
{
//GetComponent<TextMeshProUGUI>()
//GetComponent<TextMeshProUGUI>()
utilsTools
.
onEvent
(
this
,
"switchGameAreaGroupId"
);
utilsTools
.
onEvent
(
this
,
"switchGameAreaGroupId"
);
utilsTools
.
onEvent
(
this
,
"gameViewOnInitEnd"
);
utilsTools
.
onEvent
(
this
,
"gameViewOnInitEnd"
);
utilsTools
.
onEvent
(
this
,
"debugViewLogHandler"
);
utilsTools
.
onEvent
(
this
,
"gameClickPos"
);
var
debugTran
=
transform
.
Find
(
"debugView"
);
if
(
debugTran
!=
null
)
{
debugViewObj
=
debugTran
.
GetComponent
<
TextMeshProUGUI
>();
if
(
debugViewObj
==
null
)
debugTran
.
gameObject
.
SetActive
(
false
);
else
{
debugTran
.
gameObject
.
SetActive
(
utilsTools
.
IsPhone
);
}
}
var
gridViewList
=
areaGroupList
.
GetComponent
<
gameSceneAreaGroupHandler
>();
var
gridViewList
=
areaGroupList
.
GetComponent
<
gameSceneAreaGroupHandler
>();
gridViewList
.
gameObject
.
SetActive
(
tru
e
);
gridViewList
.
gameObject
.
SetActive
(
fals
e
);
gameShowView
.
GetComponent
<
mainGameView
>().
loadTest
();
gameShowView
.
GetComponent
<
mainGameView
>().
loadTest
();
//gridViewList.setDataNoGrid(20, 150, 150, 15, (GameObject gobject, int idx, ListViewBackTypeEnum lvbType) =>
//{
// if (lvbType == ListViewBackTypeEnum.create || ListViewBackTypeEnum.update == lvbType)
// {
// var item = gobject.GetComponent<colorItem>();
// bool isSelect = idx == nowSelectGroupId;
// item.IsSelect = isSelect;
// Vector3 vector3;
// Quaternion quaternion;
// gobject.transform.GetLocalPositionAndRotation(out vector3, out quaternion);
// vector3.y = -95f;
// if (isSelect)
// {
// vector3.y = vector3.y + 14;
// }
// gobject.transform.SetLocalPositionAndRotation(vector3, quaternion);
// item.IdName = idx.ToString();
// float idxf = idx;
// item.UseColor = new Color(idxf * 10 / 255f, 0.5f, (22 - idxf) * 10 / 255f, 1.0f);
// item.NowProgress = idx < 4 ? 0.0f : (idx < 15 ? idx / 13f : 1.0f);
// }
//}, false);
}
}
// Update is called once per frame
// Update is called once per frame
void
Update
()
void
Update
()
{
{
}
}
private
void
onUpdateGroupGridHandler
(
GameObject
gobject
,
int
idx
,
ListViewBackTypeEnum
lvbType
,
TempGroupInfos
group
)
{
if
(
lvbType
==
ListViewBackTypeEnum
.
create
||
ListViewBackTypeEnum
.
update
==
lvbType
)
{
var
item
=
gobject
.
GetComponent
<
colorItem
>();
bool
isSelect
=
idx
==
nowidx
;
item
.
IsSelect
=
isSelect
;
Vector3
vector3
;
Quaternion
quaternion
;
gobject
.
transform
.
GetLocalPositionAndRotation
(
out
vector3
,
out
quaternion
);
vector3
.
y
=
-
95f
;
if
(
isSelect
)
{
vector3
.
y
=
vector3
.
y
+
14
;
}
gobject
.
transform
.
SetLocalPositionAndRotation
(
vector3
,
quaternion
);
item
.
IdName
=
(
group
.
gid
).
ToString
();
item
.
index
=
idx
;
item
.
UseColor
=
group
.
rgb
;
item
.
NowProgress
=
group
.
jindu
;
}
}
public
void
onEventHandler
(
string
eventName
,
List
<
UnityEngine
.
Object
>
uobjects
,
List
<
System
.
Object
>
objects
)
public
void
onEventHandler
(
string
eventName
,
List
<
UnityEngine
.
Object
>
uobjects
,
List
<
System
.
Object
>
objects
)
{
{
if
(
eventName
.
Equals
(
"switchGameAreaGroupId"
))
if
(
eventName
.
Equals
(
"switchGameAreaGroupId"
))
...
@@ -70,94 +65,68 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
...
@@ -70,94 +65,68 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
Quaternion
quaternion
;
Quaternion
quaternion
;
var
gridViewList
=
areaGroupList
.
GetComponent
<
gameSceneAreaGroupHandler
>();
var
gridViewList
=
areaGroupList
.
GetComponent
<
gameSceneAreaGroupHandler
>();
colorItem
item
=
null
;
colorItem
item
=
null
;
if
(
now
SelectGroupId
>=
0
)
if
(
now
idx
>=
0
)
{
{
item
=
gridViewList
.
getObjectById
(
now
SelectGroupId
).
GetComponent
<
colorItem
>();
item
=
gridViewList
.
getObjectById
(
now
idx
).
GetComponent
<
colorItem
>();
item
.
IsSelect
=
false
;
item
.
IsSelect
=
false
;
item
.
transform
.
GetLocalPositionAndRotation
(
out
vector3
,
out
quaternion
);
item
.
transform
.
GetLocalPositionAndRotation
(
out
vector3
,
out
quaternion
);
vector3
.
y
=
vector3
.
y
-
14
;
vector3
.
y
=
vector3
.
y
-
14
;
item
.
transform
.
SetLocalPositionAndRotation
(
vector3
,
quaternion
);
item
.
transform
.
SetLocalPositionAndRotation
(
vector3
,
quaternion
);
}
}
var
maingameView
=
gameShowView
.
GetComponent
<
mainGameView
>();
var
maingameView
=
gameShowView
.
GetComponent
<
mainGameView
>();
nowSelectGroupId
=
(
int
)
objects
[
0
];
int
idx
=
(
int
)
objects
[
0
];
item
=
gridViewList
.
getObjectById
(
nowSelectGroupId
).
GetComponent
<
colorItem
>();
nowidx
=
idx
;
var
nowSelectGroupId
=
groupInfos
[
idx
].
gid
;
item
=
gridViewList
.
getObjectById
(
idx
).
GetComponent
<
colorItem
>();
item
.
IsSelect
=
true
;
item
.
IsSelect
=
true
;
item
.
transform
.
GetLocalPositionAndRotation
(
out
vector3
,
out
quaternion
);
item
.
transform
.
GetLocalPositionAndRotation
(
out
vector3
,
out
quaternion
);
vector3
.
y
=
vector3
.
y
+
14
;
vector3
.
y
=
vector3
.
y
+
14
;
item
.
transform
.
SetLocalPositionAndRotation
(
vector3
,
quaternion
);
item
.
transform
.
SetLocalPositionAndRotation
(
vector3
,
quaternion
);
print
(
"切换下表开始
"
+
nowSelectGroupId
.
ToString
());
Debug
.
Log
(
"切换下标开始"
+
nowSelectGroupId
.
ToString
());
maingameView
.
switchShowAreaGroup
((
short
)
nowSelectGroupId
,
(
int
id
,
bool
isOk
)
=>
{
maingameView
.
switchShowAreaGroup
((
short
)
nowSelectGroupId
,
(
int
id
,
bool
isOk
)
=>
{
print
(
"切换下表完成
"
+
id
.
ToString
());
Debug
.
Log
(
"切换下标完成"
+
id
.
ToString
());
});
});
}
else
if
(
eventName
.
Equals
(
"gameViewOnInitEnd"
))
}
else
if
(
eventName
.
Equals
(
"gameViewOnInitEnd"
))
{
{
var
gridViewList
=
areaGroupList
.
GetComponent
<
gameSceneAreaGroupHandler
>();
var
gridViewList
=
areaGroupList
.
GetComponent
<
gameSceneAreaGroupHandler
>();
gridViewList
.
gameObject
.
SetActive
(
true
);
gridViewList
.
gameObject
.
SetActive
(
true
);
var
maingameView
=
gameShowView
.
GetComponent
<
mainGameView
>();
var
maingameView
=
gameShowView
.
GetComponent
<
mainGameView
>();
var
ColorInfos
=
maingameView
.
getGroups
();
groupInfos
=
maingameView
.
getGroups
();
gridViewList
.
setDataNoGrid
(
ColorInfos
.
Count
,
150
,
150
,
20
,
(
GameObject
gobject
,
int
idx
,
ListViewBackTypeEnum
lvbType
)
=>
int
cout
=
0
;
for
(
int
i
=
0
;
i
<
groupInfos
.
Count
;
i
++)
{
{
if
(
lvbType
==
ListViewBackTypeEnum
.
create
||
ListViewBackTypeEnum
.
update
==
lvbType
)
if
(
groupInfos
[
i
].
jindu
==
1
)
{
{
break
;
var
item
=
gobject
.
GetComponent
<
colorItem
>();
bool
isSelect
=
idx
==
nowSelectGroupId
;
item
.
IsSelect
=
isSelect
;
Vector3
vector3
;
Quaternion
quaternion
;
gobject
.
transform
.
GetLocalPositionAndRotation
(
out
vector3
,
out
quaternion
);
vector3
.
y
=
-
95f
;
if
(
isSelect
)
{
vector3
.
y
=
vector3
.
y
+
14
;
}
gobject
.
transform
.
SetLocalPositionAndRotation
(
vector3
,
quaternion
);
item
.
IdName
=
(
idx
+
1
).
ToString
();
item
.
index
=
idx
;
float
idxf
=
idx
;
item
.
UseColor
=
new
Color
(
idxf
*
10
/
255f
,
0.5f
,
(
22
-
idxf
)
*
10
/
255f
,
1.0f
);
item
.
NowProgress
=
0
;
}
}
cout
++;
}
gridViewList
.
setDataNoGrid
(
cout
,
150
,
150
,
20
,
(
GameObject
gobject
,
int
idx
,
ListViewBackTypeEnum
lvbType
)
=>
{
this
.
onUpdateGroupGridHandler
(
gobject
,
idx
,
lvbType
,
groupInfos
[
idx
]);
},
false
);
},
false
);
if
(
now
SelectGroupId
>
0
)
if
(
now
idx
>
0
)
{
{
print
(
"切换下表开始
"
+
nowSelectGroupId
.
ToString
());
//Debug.Log("切换下标开始"
+ nowSelectGroupId.ToString());
maingameView
.
switchShowAreaGroup
((
short
)(
nowSelectGroupI
d
),
(
int
id
,
bool
isOk
)
=>
{
maingameView
.
switchShowAreaGroup
((
short
)(
groupInfos
[
nowidx
].
gi
d
),
(
int
id
,
bool
isOk
)
=>
{
print
(
"切换下表完成
"
+
id
.
ToString
());
Debug
.
Log
(
"切换下标完成"
+
id
.
ToString
());
});
});
}
}
}
else
if
(
eventName
.
Equals
(
"
debugViewLogHandler
"
))
}
else
if
(
eventName
.
Equals
(
"
gameClickPos
"
))
{
{
string
s
=
""
;
short
x
=
(
short
)
objects
[
0
];
if
(
objects
!=
null
)
short
y
=
(
short
)
objects
[
1
];
{
var
maingameView
=
gameShowView
.
GetComponent
<
mainGameView
>();
for
(
int
i
=
0
;
i
<
objects
.
Count
;
i
++)
maingameView
.
showAreaByPos
(
x
,
y
,
(
int
id
,
bool
isOk
)
=>
{
{
Debug
.
Log
(
"点击区域"
+
id
.
ToSafeString
()
+
" 显示"
+
isOk
.
ToSafeString
());
s
=
s
+
objects
[
i
].
ToString
()
+
","
;
return
;
}
});
}
//groupInfos = maingameView.getGroups();
if
(
uobjects
!=
null
)
{
for
(
int
i
=
0
;
i
<
uobjects
.
Count
;
i
++)
{
s
=
s
+
uobjects
[
i
].
ToString
()
+
","
;
}
}
if
(
s
.
Length
==
0
)
return
;
print
(
s
);
//if (utilsTools.IsPhone == false || debugViewObj == null)
//{
// print(s);
//}
//else
//{
// debugViewObj.text = s;
//}
}
}
}
}
public
void
onTestTemp1
()
public
void
onTestTemp1
()
{
{
print
(
"是否卡顿?
"
);
Debug
.
Log
(
"---->>>
"
);
}
}
}
}
Assets/scripts/Views/gameScene/gameUserInfos.cs
View file @
f3192eda
using
System.Collections
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
Unity.VisualScripting
;
using
UnityEngine
;
using
UnityEngine
;
using
UnityEngine.Assertions
;
public
class
gameUserInfos
:
MonoBehaviour
,
IEventHandler
public
class
gameUserInfos
:
MonoBehaviour
,
IEventHandler
{
{
...
@@ -17,16 +19,21 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
...
@@ -17,16 +19,21 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
}
}
public
void
startId
(
string
id
)
public
void
startId
(
string
id
)
{
{
gameSaveKey
=
"gameUserData_"
+
id
.
ToString
();
GameScenUserInfo
gameScenUser
=
utilsTools
.
getGameScenUserInfo
(
id
);
string
defvalue
=
""
;
if
(
gameScenUser
==
null
)
string
oldGameInfo
=
utilsDB
.
getDBJsonDataByKey
(
gameSaveKey
,
defvalue
);
if
(
oldGameInfo
.
Equals
(
defvalue
))
{
{
return
;
}
}
List
<
short
>
shorts
=
new
List
<
short
>();
for
(
int
i
=
0
;
i
<
gameScenUser
.
areaInfoUseData
.
Count
;
i
++)
{
shorts
.
Add
(
gameScenUser
.
areaInfoUseData
[
i
].
id
);
}
GetComponent
<
mainGameView
>().
loadGameImgId
(
gameScenUser
.
img
,
gameScenUser
.
finishImg
,
gameScenUser
.
json
,
""
,
shorts
);
}
}
void
IEventHandler
.
onEventHandler
(
string
eventName
,
List
<
UnityEngine
.
Object
>
uobjects
,
List
<
System
.
Object
>
objects
)
void
IEventHandler
.
onEventHandler
(
string
eventName
,
List
<
UnityEngine
.
Object
>
uobjects
,
List
<
System
.
Object
>
objects
)
{
{
}
}
}
}
Assets/scripts/common/mainGameScaleMove.cs
View file @
f3192eda
using
System
;
using
System.Collections
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
Unity.VisualScripting
;
using
Unity.VisualScripting
;
using
UnityEngine
;
using
UnityEngine
;
using
UnityEngine.UI
;
delegate
void
CheckInput
();
delegate
void
CheckInput
();
public
class
mainGameScaleMove
:
MonoBehaviour
public
class
mainGameScaleMove
:
MonoBehaviour
{
{
...
@@ -14,10 +17,11 @@ public class mainGameScaleMove : MonoBehaviour
...
@@ -14,10 +17,11 @@ public class mainGameScaleMove : MonoBehaviour
private
bool
skipDoubleScale
=
false
;
private
bool
skipDoubleScale
=
false
;
public
float
OldTouchCurrDis
=
-
1000
;
public
float
OldTouchCurrDis
=
-
1000
;
public
float
minScale
=
0.25f
;
public
float
minScale
=
0.25f
;
public
float
maxScale
=
8f
;
public
float
maxScale
=
1.25f
;
//
8f;
public
List
<
GameObject
>
ignoreList
=
new
List
<
GameObject
>();
public
List
<
GameObject
>
ignoreList
=
new
List
<
GameObject
>();
private
List
<
System
.
Object
>
logTempList
=
null
;
private
List
<
System
.
Object
>
logTempList
=
null
;
private
Vector2
winPrvePos
=
new
Vector2
(-
90000
,
-
90000
);
private
Vector2
winPrvePos
=
new
Vector2
(-
90000
,
-
90000
);
public
List
<
Sprite
>
DebugSprites
=
new
List
<
Sprite
>();
public
Vector2
NowPos
public
Vector2
NowPos
{
{
get
{
return
nowPos
;
}
get
{
return
nowPos
;
}
...
@@ -89,18 +93,18 @@ public class mainGameScaleMove : MonoBehaviour
...
@@ -89,18 +93,18 @@ public class mainGameScaleMove : MonoBehaviour
TouchPhase
touchPhase
=
oneTouch
.
phase
;
TouchPhase
touchPhase
=
oneTouch
.
phase
;
if
(
touchPhase
==
TouchPhase
.
Began
)
if
(
touchPhase
==
TouchPhase
.
Began
)
{
{
MyPrint
(
"one Click begin"
);
Debug
.
Log
(
"one Click begin"
);
onOneTouchBegin
(
oneTouch
.
position
);
onOneTouchBegin
(
oneTouch
.
position
);
}
}
else
if
(
touchPhase
==
TouchPhase
.
Moved
)
else
if
(
touchPhase
==
TouchPhase
.
Moved
)
{
{
if
(
utilsTools
.
ContainsKey
(
gameObject
,
"oneTouchBegin"
)
==
false
)
return
;
if
(
utilsTools
.
ContainsKey
(
gameObject
,
"oneTouchBegin"
)
==
false
)
return
;
MyPrint
(
"one Click move"
);
Debug
.
Log
(
"one Click move"
);
onOneTouchMove
(
oneTouch
.
position
,
oneTouch
.
deltaPosition
);
onOneTouchMove
(
oneTouch
.
position
,
oneTouch
.
deltaPosition
);
}
else
if
(
touchPhase
==
TouchPhase
.
Ended
)
}
else
if
(
touchPhase
==
TouchPhase
.
Ended
)
{
{
if
(
utilsTools
.
ContainsKey
(
gameObject
,
"oneTouchBegin"
)
==
false
)
return
;
if
(
utilsTools
.
ContainsKey
(
gameObject
,
"oneTouchBegin"
)
==
false
)
return
;
MyPrint
(
"one Click end"
);
Debug
.
Log
(
"one Click end"
);
onOneTouchEnd
(
oneTouch
.
position
,
oneTouch
.
deltaPosition
);
onOneTouchEnd
(
oneTouch
.
position
,
oneTouch
.
deltaPosition
);
}
else
if
(
touchPhase
==
TouchPhase
.
Canceled
)
}
else
if
(
touchPhase
==
TouchPhase
.
Canceled
)
{
{
...
@@ -138,25 +142,24 @@ public class mainGameScaleMove : MonoBehaviour
...
@@ -138,25 +142,24 @@ public class mainGameScaleMove : MonoBehaviour
var
itemChild
=
transform
.
GetChild
(
i
);
var
itemChild
=
transform
.
GetChild
(
i
);
itemChild
.
localScale
=
nowScale
;
itemChild
.
localScale
=
nowScale
;
}
}
MyPrint
(
"scale"
,
""
,
nowScale
,
nowSize
);
}
}
void
clearOneTouchBegin
()
void
clearOneTouchBegin
()
{
{
MyPrint
(
"one Click clear"
);
Debug
.
Log
(
"one Click clear"
);
utilsTools
.
delUserDataByKey
(
gameObject
,
"oneTouchBegin"
);
utilsTools
.
delUserDataByKey
(
gameObject
,
"oneTouchBegin"
);
}
}
bool
checkMouseInIgnoreList
(
Vector2
vector
)
bool
checkMouseInIgnoreList
(
Vector2
vector
)
{
{
for
(
int
i
=
0
;
i
<
ignoreList
.
Count
;
i
++)
for
(
int
i
=
0
;
i
<
ignoreList
.
Count
;
i
++)
{
{
if
(
ignoreList
[
i
]
==
null
)
continue
;
RectTransform
checkRectTransform
=
ignoreList
[
i
].
transform
.
GetComponent
<
RectTransform
>();
RectTransform
checkRectTransform
=
ignoreList
[
i
].
transform
.
GetComponent
<
RectTransform
>();
var
newLocalPos
=
utilsTools
.
ScreenToUILocalPos
(
checkRectTransform
,
vector
);
var
newLocalPos
=
utilsTools
.
ScreenToUILocalPos
(
checkRectTransform
,
vector
);
if
(
checkRectTransform
.
rect
.
Contains
(
newLocalPos
))
return
true
;
if
(
checkRectTransform
.
rect
.
Contains
(
newLocalPos
))
return
true
;
}
}
return
false
;
return
false
;
}
}
//
左键点击 右键缩放
//
左键点击 右键缩放
void
checkInputByComputer
()
void
checkInputByComputer
()
{
{
if
(
Input
.
GetMouseButtonDown
(
0
))
if
(
Input
.
GetMouseButtonDown
(
0
))
...
@@ -212,85 +215,91 @@ public class mainGameScaleMove : MonoBehaviour
...
@@ -212,85 +215,91 @@ public class mainGameScaleMove : MonoBehaviour
{
{
delatPos
.
y
=
0
;
delatPos
.
y
=
0
;
}
}
if
(
delatPos
.
x
==
delatPos
.
y
&&
delatPos
.
x
==
0
)
return
;
//
都不用移动就不更新坐标
if
(
delatPos
.
x
==
delatPos
.
y
&&
delatPos
.
x
==
0
)
return
;
//
都不用移动就不更新坐标
tempVector3
.
x
+=
delatPos
.
x
;
tempVector3
.
x
+=
delatPos
.
x
;
tempVector3
.
y
+=
delatPos
.
y
;
tempVector3
.
y
+=
delatPos
.
y
;
MyPrint
(
"move"
,
tempVector3
,
nowScale
,
nowSize
);
Debug
.
Log
(
"move"
+
tempVector3
.
ToSafeString
()+
nowScale
.
ToSafeString
()+
nowSize
.
ToSafeString
()
);
}
}
itemChild
.
SetLocalPositionAndRotation
(
tempVector3
,
quaternion
);
itemChild
.
SetLocalPositionAndRotation
(
tempVector3
,
quaternion
);
}
}
//更新坐标 应该记录当前显示的位置
//更新坐标 应该记录当前显示的位置
}
private
void
MyPrint
(
System
.
Object
param1
,
System
.
Object
param2
=
null
,
System
.
Object
param3
=
null
,
System
.
Object
param4
=
null
)
{
logTempList
[
0
]
=
param1
;
if
(
param2
==
null
)
logTempList
[
1
]
=
""
;
else
logTempList
[
1
]
=
param2
;
if
(
param3
==
null
)
logTempList
[
2
]
=
""
;
else
logTempList
[
1
]
=
param3
;
if
(
param4
==
null
)
logTempList
[
3
]
=
""
;
else
logTempList
[
1
]
=
param4
;
utilsTools
.
sendEventObjects
(
"debugViewLogHandler"
,
logTempList
);
}
}
private
void
onOneTouchEnd
(
Vector2
nowPos
,
Vector2
delatPos
)
private
void
onOneTouchEnd
(
Vector2
nowPos
,
Vector2
delatPos
)
{
{
utilsTools
.
getUserData
<
Vector2
>(
gameObject
,
"oneTouchBegin"
,
out
tempVector
,
defvalueVector
);
utilsTools
.
getUserData
<
Vector2
>(
gameObject
,
"oneTouchBegin"
,
out
tempVector
,
defvalueVector
);
if
(
tempVector
.
Equals
(
defvalueVector
))
//
说明之前已经移除了
if
(
tempVector
.
Equals
(
defvalueVector
))
//
说明之前已经移除了
{
{
return
;
return
;
}
}
float
sqrMagnitude
=
(
nowPos
-
tempVector
).
SqrMagnitude
();
float
sqrMagnitude
=
(
nowPos
-
tempVector
).
SqrMagnitude
();
clearOneTouchBegin
();
clearOneTouchBegin
();
if
(
sqrMagnitude
>
20f
)
{
//
按下和抬起距离太远就不算点击
if
(
sqrMagnitude
>
20f
)
{
//
按下和抬起距离太远就不算点击
MyPrint
(
"begin end diff big "
,
sqrMagnitude
);
Debug
.
Log
(
"begin end diff big "
+
sqrMagnitude
);
return
;
return
;
}
}
onOneClick
(
nowPos
);
onOneClick
(
nowPos
);
}
}
//
获取图片和屏幕交集的区域 //屏幕坐标系
//
获取图片和屏幕交集的区域 //屏幕坐标系
Rect
ImageToSceneJiao
()
Rect
ImageToSceneJiao
()
{
{
//
将四个点转成屏幕坐标系
//
将四个点转成屏幕坐标系
RectTransform
firstRectTransform
=
transform
.
GetChild
(
0
).
GetComponent
<
RectTransform
>();
RectTransform
firstRectTransform
=
transform
.
GetChild
(
0
).
GetComponent
<
RectTransform
>();
Rect
rect
=
firstRectTransform
.
rect
;
Rect
rect
=
firstRectTransform
.
rect
;
//Vector2 localtemp;
//Vector2 worldtemp;
//Vector2 pingtemp;
//Vector2 pingtemp2;
//localtemp = new Vector2(rect.xMin, rect.yMin);
//worldtemp = firstRectTransform.TransformPoint(localtemp);
//pingtemp = Camera.main.WorldToScreenPoint(worldtemp);
//MyPrint(localtemp, worldtemp, pingtemp);
//localtemp = new Vector2(rect.xMax, rect.yMax);
//worldtemp = firstRectTransform.TransformPoint(localtemp);
//pingtemp2 = Camera.main.WorldToScreenPoint(worldtemp);
//Rect wuti = new Rect(pingtemp.x, pingtemp.y, pingtemp2.x, pingtemp2.y);
//Rect pingRect = new Rect(0, 0, utilsTools.DisplaySize.x, utilsTools.DisplaySize.y);
//Rect ret = new Rect(0, 0, 0, 0);
//if (wuti.x < pingRect.x)
// ret.x = pingRect.x;
//else
// ret.x = wuti.x;
//if (wuti.y < pingRect.y)
// ret.y = pingRect.y;
//MyPrint(localtemp, worldtemp, pingtemp);
return
rect
;
return
rect
;
}
}
private
Vector3
GetNativePosition
(
Vector3
screenPos
)
{
// 将屏幕坐标转换为世界坐标
screenPos
.
z
=
10000f
;
Vector3
worldPos
=
Camera
.
main
.
ScreenToWorldPoint
(
screenPos
);
Ray2D
ray
=
new
Ray2D
(
worldPos
,
Vector2
.
right
);
RaycastHit2D
hit
=
Physics2D
.
Raycast
(
ray
.
origin
,
ray
.
direction
);
if
(
hit
.
collider
!=
null
)
{
Debug
.
Log
(
"有碰撞 ...."
);
}
else
{
Debug
.
Log
(
"没有碰撞 "
);
}
// 获取节点的缩放信息
Vector3
scale
=
transform
.
localScale
;
// 获取节点的位置信息
Vector3
position
=
transform
.
localPosition
;
// 计算节点的逆变换矩阵
Matrix4x4
inverseTransform
=
Matrix4x4
.
TRS
(-
position
,
Quaternion
.
identity
,
Vector3
.
one
).
inverse
;
inverseTransform
*=
Matrix4x4
.
Scale
(
new
Vector3
(
1
/
scale
.
x
,
1
/
scale
.
y
,
1
/
scale
.
z
));
// 将世界坐标转换为节点内的原生坐标
Vector3
nativePos
=
inverseTransform
.
MultiplyPoint
(
worldPos
);
return
nativePos
;
}
private
void
onOneClick
(
Vector2
nowPos
)
private
void
onOneClick
(
Vector2
nowPos
)
{
{
RectTransform
firstRectTransform
=
transform
.
GetChild
(
0
).
GetComponent
<
RectTransform
>();
Vector3
temp
=
new
Vector3
(
nowPos
.
x
,
nowPos
.
y
);
var
localPos
=
utilsTools
.
ScreenToUILocalPos
(
firstRectTransform
,
nowPos
);
mainGameView
mainView
=
GetComponent
<
mainGameView
>();
if
(
firstRectTransform
.
rect
.
Contains
(
localPos
))
//首先要区域内
int
width
;
int
height
;
if
(
mainView
.
getSize
(
out
width
,
out
height
)
==
false
)
return
;
var
lineTransform
=
transform
.
Find
(
"low"
).
GetComponent
<
RectTransform
>();
Vector2
vector
=
utilsTools
.
ScreenToUILocalPos
(
lineTransform
,
nowPos
);
if
(
lineTransform
.
rect
.
Contains
(
vector
))
{
{
Vector2
localPos1
=
(
localPos
-
(
nowPos
*
nowScale
*
3f
));
Vector2
scaleVector
=
new
Vector2
(
width
/
lineTransform
.
rect
.
width
,
height
/
lineTransform
.
rect
.
height
);
MyPrint
(
"click"
,
nowPos
,
localPos
,
localPos1
);
Vector2
pos1
=
vector
*
scaleVector
;
short
x
=
Convert
.
ToInt16
(
pos1
.
x
+
width
/
2
);
short
y
=
Convert
.
ToInt16
(
pos1
.
y
+
height
/
2
);
List
<
System
.
Object
>
senddata
=
new
List
<
System
.
Object
>()
{
x
,
y
};
utilsTools
.
sendEventObjects
(
"gameClickPos"
,
senddata
);
}
}
else
else
{
{
MyPrint
(
"click"
,
nowPos
,
localPos
,
"noRect
"
);
print
(
"2
"
);
}
}
//nowPos = GetNativePosition(temp);
//Debug.Log("当前点击位置到图片对应"+temp.ToSafeString());
}
}
// Update is called once per frame
// Update is called once per frame
void
Update
()
void
Update
()
...
...
Assets/scripts/common/mainGameView.cs
View file @
f3192eda
using
Newtonsoft.Json.Linq
;
using
System
;
using
System
;
using
System.Collections
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -11,27 +12,53 @@ using UnityEditor;
...
@@ -11,27 +12,53 @@ using UnityEditor;
using
UnityEngine
;
using
UnityEngine
;
using
UnityEngine.UI
;
using
UnityEngine.UI
;
public
class
TempGroupInfos
{
public
Color
rgb
;
public
int
gid
;
public
float
jindu
;
}
class
AreaAnimationDiffuse
{
public
short
m_x
;
public
short
m_y
;
public
short
m_aid
;
public
short
m_fpsStart
=
1
;
//r 开始
public
short
m_fpsEnd
=
20
;
//r 结束
public
AreaAnimationDiffuse
(
short
x
,
short
y
,
short
aid
)
{
m_x
=
x
;
m_y
=
y
;
m_aid
=
aid
;
}
}
public
class
mainGameView
:
MonoBehaviour
public
class
mainGameView
:
MonoBehaviour
{
{
private
gameIdJsonData
gameidJsondata
=
null
;
private
gameIdJsonData
gameidJsondata
=
null
;
private
string
progresName
=
""
;
private
string
progresName
=
""
;
public
GameObject
lineImg
=
null
;
//
线图
public
GameObject
lineImg
=
null
;
//
线图
public
GameObject
colorImg
=
null
;
//
颜色图
public
GameObject
colorImg
=
null
;
//
颜色图
public
GameObject
lowImg
=
null
;
//
底图
public
GameObject
lowImg
=
null
;
//
底图
public
GameObject
areaIdBase
=
null
;
public
GameObject
areaIdBase
=
null
;
[
Header
(
"
区域id的预制体
"
)]
[
Header
(
"
区域id的预制体"
)]
public
string
perfabPath
=
""
;
public
string
perfabPath
=
""
;
private
GameObject
areaIdperfabObj
=
null
;
private
GameObject
areaIdperfabObj
=
null
;
public
DigitMatrixShort
digitMatrix
=
null
;
public
DigitMatrixShort
digitMatrix
=
null
;
protected
Texture2D
lineTexture2d
=
null
;
protected
Texture2D
lineTexture2d
=
null
;
p
rotected
List
<
Texture2D
>
lowImgTexture2ds
=
new
List
<
Texture2D
>();
p
ublic
List
<
Texture2D
>
lowImgTexture2ds
=
new
List
<
Texture2D
>();
protected
short
nowSelectgid
=
-
1
;
protected
short
nowSelectgid
=
-
1
;
private
string
[]
initDigitMatrixs
=
{
""
,
""
};
private
string
[]
initDigitMatrixs
=
{
""
,
""
};
private
string
runGameDatas
=
"runGameDatas"
;
private
string
runGameDatas
=
"runGameDatas"
;
private
List
<
short
>
nowSelectInfos
=
null
;
private
Vector2
pos1
=
new
Vector2
(-
1000
,
-
1000
);
//x,y aid 当前帧向量 起点终点 等宽度计算扩散
private
List
<
AreaAnimationDiffuse
>
showAreaAnimationDatas
=
new
List
<
AreaAnimationDiffuse
>();
private
int
rvalue
=
-
1
;
public
void
onInitDigitMatrix
(
string
name
)
public
void
onInitDigitMatrix
(
string
name
)
{
{
print
(
"onInitDigitMatrix >> "
+
name
);
Debug
.
Log
(
"onInitDigitMatrix >> "
+
name
);
if
(
lowImg
==
null
&&
name
.
Equals
(
"select"
)
==
false
)
if
(
lowImg
==
null
&&
name
.
Equals
(
"select"
)
==
false
)
onInitDigitMatrix
(
"select"
);
onInitDigitMatrix
(
"select"
);
for
(
int
i
=
0
;
i
<
initDigitMatrixs
.
Count
();
i
++)
for
(
int
i
=
0
;
i
<
initDigitMatrixs
.
Count
();
i
++)
...
@@ -53,9 +80,83 @@ public class mainGameView : MonoBehaviour
...
@@ -53,9 +80,83 @@ public class mainGameView : MonoBehaviour
utilsTools
.
CreateDirectory
(
savepath
);
utilsTools
.
CreateDirectory
(
savepath
);
return
savepath
+
"/temp_"
+
gid
.
ToString
()
+
".png"
;
return
savepath
+
"/temp_"
+
gid
.
ToString
()
+
".png"
;
}
}
public
void
saveGroupTexture
(
int
pgid
,
Texture2D
nowGroupIdTexture
)
{
string
temppath
=
getSelectPathByGid
(
pgid
);
utilsTools
.
saveByteToPath
(
nowGroupIdTexture
.
EncodeToPNG
(),
temppath
);
utilsTools
.
saveImageDefaultMetaInfoToPath
(
temppath
);
GameObject
.
Destroy
(
nowGroupIdTexture
);
nowGroupIdTexture
=
null
;
}
public
bool
addTaskInMakeGroupMap
(
int
i
,
Texture2D
lowImgTexture2dFirst
,
bool
isNowShow
)
{
var
tm
=
TaskManages
.
getInstance
();
var
group
=
gameidJsondata
.
roomGroupsData
[
i
];
short
pgid
=
group
.
id
;
if
(
group
.
isComplete
)
return
false
;
string
temppath
=
getSelectPathByGid
(
pgid
);
if
(
utilsTools
.
IsExistIO
(
temppath
))
{
Debug
.
Log
(
"已经存在所以跳过 "
+
pgid
.
ToSafeString
());
return
false
;
}
Texture2D
nowGroupIdTexture
=
null
;
Tuple
<
bool
,
int
,
Texture2D
>
tuple
=
new
Tuple
<
bool
,
int
,
Texture2D
>(
isNowShow
,
i
,
nowGroupIdTexture
);
for
(
int
i1
=
0
;
i1
<
gameidJsondata
.
roomGroupsData
[
i
].
roomIds
.
Count
();
i1
++)
{
var
aid1
=
gameidJsondata
.
roomGroupsData
[
i
].
roomIds
[
i1
];
System
.
Object
[]
taskParams
=
{
aid1
,
pgid
,
isNowShow
,
temppath
};
tm
.
addTask
(
this
,
(
System
.
Object
[]
listparam
)
=>
{
bool
isGameShow
=
(
bool
)
listparam
[
2
];
if
(
isGameShow
==
true
&&
utilsTools
.
IsExistIO
(
temppath
)
==
true
)
{
if
(
nowGroupIdTexture
!=
null
)
{
GameObject
.
Destroy
(
nowGroupIdTexture
);
nowGroupIdTexture
=
null
;
}
return
;
}
if
(
nowGroupIdTexture
==
null
)
{
nowGroupIdTexture
=
new
Texture2D
(
lowImgTexture2dFirst
.
width
,
lowImgTexture2dFirst
.
height
,
lowImgTexture2dFirst
.
format
,
false
);
nowGroupIdTexture
.
LoadRawTextureData
(
lowImgTexture2dFirst
.
GetRawTextureData
());
}
int
aid
=
(
short
)
listparam
[
0
];
var
areaInfo
=
gameidJsondata
.
roomDatas
[
aid
];
short
tempgid
=
(
short
)
listparam
[
1
];
int
setcout
=
0
;
digitMatrix
.
PeekFloodFill8WithStack
(
areaInfo
.
px
,
areaInfo
.
py
,
-
5
,
(
short
)(
aid
+
20
),
(
short
x1
,
short
y1
,
short
c
)
=>
{
nowGroupIdTexture
.
SetPixel
(
x1
,
y1
,
Color
.
white
);
setcout
=
setcout
+
1
;
return
true
;
});
},
taskParams
);
}
System
.
Object
[]
param1
=
{
pgid
,
isNowShow
};
tm
.
addTask
(
this
,
(
System
.
Object
[]
listparam
)
=>
{
bool
isGameShow
=
(
bool
)
listparam
[
1
];
if
(
isGameShow
==
true
&&
utilsTools
.
IsExistIO
(
temppath
)
==
true
)
{
if
(
nowGroupIdTexture
!=
null
)
{
GameObject
.
Destroy
(
nowGroupIdTexture
);
nowGroupIdTexture
=
null
;
}
return
;
}
if
(
nowGroupIdTexture
!=
null
)
saveGroupTexture
((
short
)
listparam
[
0
],
nowGroupIdTexture
);
},
param1
);
return
true
;
}
public
void
onLoadFileOk
(
int
typeId
)
public
void
onLoadFileOk
(
int
typeId
)
{
{
if
(
typeId
==
1
)
if
(
typeId
==
1
)
{
{
Debug
.
Log
(
"begin init lunkuo"
);
Debug
.
Log
(
"begin init lunkuo"
);
...
@@ -67,7 +168,7 @@ public class mainGameView : MonoBehaviour
...
@@ -67,7 +168,7 @@ public class mainGameView : MonoBehaviour
int
x
=
(
int
)
datas
[
0
];
int
x
=
(
int
)
datas
[
0
];
int
setp
=
(
int
)
datas
[
1
];
int
setp
=
(
int
)
datas
[
1
];
int
height
=
(
int
)
datas
[
2
];
int
height
=
(
int
)
datas
[
2
];
print
(
"执行任务参数列表
typeid 1 "
+
(
x
+
setp
).
ToSafeString
());
Debug
.
Log
(
"执行任务参数列表 typ
eid 1 "
+
(
x
+
setp
).
ToSafeString
());
for
(
int
i
=
x
;
i
<
(
x
+
setp
);
i
++)
for
(
int
i
=
x
;
i
<
(
x
+
setp
);
i
++)
{
{
for
(
int
j
=
0
;
j
<
height
;
j
++)
for
(
int
j
=
0
;
j
<
height
;
j
++)
...
@@ -93,14 +194,14 @@ public class mainGameView : MonoBehaviour
...
@@ -93,14 +194,14 @@ public class mainGameView : MonoBehaviour
TaskItemBack
taskItemBack1
=
(
System
.
Object
[]
param
)
=>
TaskItemBack
taskItemBack1
=
(
System
.
Object
[]
param
)
=>
{
{
gameAreaItem
gai
=
(
gameAreaItem
)
param
[
0
];
gameAreaItem
gai
=
(
gameAreaItem
)
param
[
0
];
print
(
"area reset id "
+
(
gai
.
id
+
20
).
ToString
());
Debug
.
Log
(
"area reset id "
+
(
gai
.
id
+
20
).
ToString
());
digitMatrix
.
FloodFill8WithStack
(
gai
.
x
,
gai
.
y
,
(
short
)(
gai
.
id
+
20
),
0
,
null
);
digitMatrix
.
FloodFill8WithStack
(
gai
.
px
,
gai
.
p
y
,
(
short
)(
gai
.
id
+
20
),
0
,
null
);
};
};
//
给每一个空白设置 区域
id
//
给每一个空白设置 区域id
for
(
int
i
=
0
;
i
<
gameidJsondata
.
center
s
.
Count
;
i
++)
for
(
int
i
=
0
;
i
<
gameidJsondata
.
roomData
s
.
Count
;
i
++)
{
{
var
item
=
gameidJsondata
.
center
s
[
i
];
var
item
=
gameidJsondata
.
roomData
s
[
i
];
if
(
digitMatrix
.
Data
[
item
.
x
,
item
.
y
]
==
0
){
if
(
digitMatrix
.
Data
[
item
.
px
,
item
.
p
y
]
==
0
){
System
.
Object
[]
temps
=
{
item
};
System
.
Object
[]
temps
=
{
item
};
taskManages
.
addTask
(
this
,
taskItemBack1
,
temps
);
taskManages
.
addTask
(
this
,
taskItemBack1
,
temps
);
}
}
...
@@ -126,8 +227,6 @@ public class mainGameView : MonoBehaviour
...
@@ -126,8 +227,6 @@ public class mainGameView : MonoBehaviour
TaskManages
tm
=
TaskManages
.
getInstance
();
TaskManages
tm
=
TaskManages
.
getInstance
();
var
lowImgTexture2dFirst
=
lowImgTexture2ds
[
0
];
var
lowImgTexture2dFirst
=
lowImgTexture2ds
[
0
];
Texture2D
nowGroupIdTexture
=
null
;
Texture2D
nowGroupIdTexture
=
null
;
//lowImgTexture2ds = new List<Texture2D>();
Action
<
int
>
tempSaveTexture
=
(
int
nowgid
)
=>
Action
<
int
>
tempSaveTexture
=
(
int
nowgid
)
=>
{
{
string
temppath
=
getSelectPathByGid
(
nowgid
);
string
temppath
=
getSelectPathByGid
(
nowgid
);
...
@@ -137,134 +236,46 @@ public class mainGameView : MonoBehaviour
...
@@ -137,134 +236,46 @@ public class mainGameView : MonoBehaviour
nowGroupIdTexture
=
null
;
nowGroupIdTexture
=
null
;
return
;
return
;
};
};
TaskItemBack
onUpdataeColor
=
(
System
.
Object
[]
listparam
)
=>
{
int
start
=
(
int
)
listparam
[
0
];
int
setp
=
(
int
)
listparam
[
1
];
int
maxWidth
=
(
int
)
listparam
[
2
];
int
height
=
(
int
)
listparam
[
3
];
int
gid
=
(
int
)
listparam
[
4
];
Color
oldColor1
=
new
Color
(
1
,
1
,
1
,
0
);
Color
oldColor2
=
new
Color
(
1
,
1
,
1
,
1
);
List
<
short
>
shorts
=
gameidJsondata
.
groups
[
gid
].
areaIds
;
for
(
int
col
=
start
;
col
<
(
start
+
setp
);
col
++)
{
for
(
int
line
=
0
;
line
<
height
;
line
++)
{
short
flg
=
digitMatrix
.
Data
[
col
,
line
];
if
(
flg
>=
20
&&
shorts
.
IndexOf
((
short
)(
flg
-
20f
))
>=
0
)
{
nowGroupIdTexture
.
SetPixel
(
col
,
line
,
oldColor2
);
}
else
{
nowGroupIdTexture
.
SetPixel
(
col
,
line
,
oldColor1
);
}
}
}
};
//for (int i = 0;i < gameidJsondata.groups.Count; i++)
//{
// tm.addTask(this, (System.Object[] listparams) =>
// {
// Texture2D newTextureByRawData = new Texture2D(lowImgTexture2dFirst.width, lowImgTexture2dFirst.height, lowImgTexture2dFirst.format, false);
// newTextureByRawData.LoadRawTextureData(lowImgTexture2dFirst.GetRawTextureData());
// lowImgTexture2ds.Add(newTextureByRawData);
// });
//}
TaskItemBack
checkPtNextHandler
=
null
;
TaskItemBack
checkPtNextHandler
=
null
;
checkPtNextHandler
=
(
System
.
Object
[]
listparam
)
=>
checkPtNextHandler
=
(
System
.
Object
[]
listparam
)
=>
{
{
var
checkPt
=
gameidJsondata
.
centers
[
gameidJsondata
.
center
s
.
Count
-
1
];
var
checkPt
=
gameidJsondata
.
roomDatas
[
gameidJsondata
.
roomData
s
.
Count
-
1
];
float
flg
=
digitMatrix
.
Data
[
checkPt
.
x
,
checkPt
.
y
];
float
flg
=
digitMatrix
.
Data
[
checkPt
.
px
,
checkPt
.
p
y
];
if
(
flg
==
0
)
if
(
flg
==
0
)
{
{
tm
.
addTask
(
this
,
checkPtNextHandler
);
tm
.
addTask
(
this
,
checkPtNextHandler
);
return
;
return
;
}
}
print
(
"开始生成组图片"
);
Debug
.
Log
(
"开始生成组图片"
);
int
tempsetp
=
200
;
gameidJsondata
.
roomGroupsData
.
Sort
(
gameAreaGroupItem
.
sortByIsComplete
);
for
(
int
i
=
0
;
i
<
gameidJsondata
.
groups
.
Count
;
i
++)
int
j
=
0
;
int
i
=
0
;
while
(
j
<
11
&&
i
<
gameidJsondata
.
roomGroupsData
.
Count
)
{
{
string
temppath
=
getSelectPathByGid
(
i
);
if
(
addTaskInMakeGroupMap
(
i
,
lowImgTexture2dFirst
,
false
)
==
true
)
tm
.
addTask
(
this
,
(
System
.
Object
[]
listparam
)
=>
{
nowGroupIdTexture
=
new
Texture2D
(
lowImgTexture2dFirst
.
width
,
lowImgTexture2dFirst
.
height
,
lowImgTexture2dFirst
.
format
,
false
);
Color
colorstemp
=
Color
.
yellow
;
colorstemp
.
a
=
0
;
nowGroupIdTexture
.
LoadRawTextureData
(
lowImgTexture2dFirst
.
GetRawTextureData
());
});
for
(
int
i1
=
0
;
i1
<
gameidJsondata
.
groups
[
i
].
areaIds
.
Count
();
i1
++)
{
{
System
.
Object
[]
taskParams
=
{
gameidJsondata
.
groups
[
i
].
areaIds
[
i1
],
i
};
j
++;
tm
.
addTask
(
this
,
(
System
.
Object
[]
listparam
)
=>
{
int
aid
=
(
short
)
listparam
[
0
];
var
areaInfo
=
gameidJsondata
.
centers
[
aid
];
int
tempgid
=
(
int
)
listparam
[
1
];
int
setcout
=
0
;
digitMatrix
.
PeekFloodFill8WithStack
(
areaInfo
.
x
,
areaInfo
.
y
,
-
5
,
(
short
)(
aid
+
20
),
(
short
x1
,
short
y1
,
short
c
)
=>
{
nowGroupIdTexture
.
SetPixel
(
x1
,
y1
,
Color
.
white
);
setcout
=
setcout
+
1
;
return
true
;
});
print
(
listparam
[
0
].
ToSafeString
()
+
">>"
+
tempgid
.
ToSafeString
()
+
" end "
+
setcout
.
ToString
());
},
taskParams
);
}
}
System
.
Object
[]
param1
=
{
i
};
i
++;
tm
.
addTask
(
this
,
(
System
.
Object
[]
listparam
)
=>
{
tempSaveTexture
((
int
)
listparam
[
0
]);
},
param1
);
}
}
tm
.
addTask
(
this
,
(
System
.
Object
[]
_
)
=>
if
(
areaIdBase
!=
null
&&
perfabPath
.
Equals
(
""
)
==
false
)
{
{
if
(
areaIdBase
!=
null
&&
perfabPath
.
Equals
(
""
)
==
false
)
//创建一堆节点
{
TaskItemBack
onUpdateByIdNode
=
(
System
.
Object
[]
listparam
)
=>
//创建一堆节点
TaskItemBack
onUpdateByIdNode
=
(
System
.
Object
[]
listparam
)
=>
{
checkAddAreaId
();
onInitDigitMatrix
(
"select"
);
};
tm
.
addTask
(
this
,
onUpdateByIdNode
);
}
else
{
{
checkAddAreaId
();
onInitDigitMatrix
(
"select"
);
onInitDigitMatrix
(
"select"
);
}
};
});
tm
.
addTask
(
this
,
onUpdateByIdNode
);
}
//for (int i1 = 0; i1 < lowImgTexture2dFirst.width; i1 += tempsetp)
else
//{
{
// System.Object[] taskParams = { i1, tempsetp, lowImgTexture2dFirst.width, lowImgTexture2dFirst.height };
onInitDigitMatrix
(
"select"
);
// if (i1 + tempsetp + tempsetp > lowImgTexture2dFirst.width)
}
// {
for
(;
i
<
gameidJsondata
.
roomGroupsData
.
Count
();
i
++)
// taskParams[1] = lowImgTexture2dFirst.width - i1;
{
// tm.addTask(this, onUpdataeColor, taskParams);
addTaskInMakeGroupMap
(
i
,
lowImgTexture2dFirst
,
true
);
// tm.addTask(this, (System.Object[] _) =>
}
// {
// if (areaIdBase != null && perfabPath.Equals("") == false)
// {
// //创建一堆节点
// TaskItemBack onUpdateByIdNode = (System.Object[] listparam) =>
// {
// checkAddAreaId();
// onInitDigitMatrix("select");
// };
// tm.addTask(this, onUpdateByIdNode);
// }
// else
// {
// onInitDigitMatrix("select");
// }
// });
// break;
// }
// tm.addTask(this, onUpdataeColor, taskParams);
//}
};
};
tm
.
addTask
(
this
,
checkPtNextHandler
);
tm
.
addTask
(
this
,
checkPtNextHandler
);
...
@@ -272,12 +283,12 @@ public class mainGameView : MonoBehaviour
...
@@ -272,12 +283,12 @@ public class mainGameView : MonoBehaviour
{
{
TaskManages
tm
=
TaskManages
.
getInstance
();
TaskManages
tm
=
TaskManages
.
getInstance
();
TaskItemBack
firstHandlGid
=
(
System
.
Object
[]
temp
)
=>
{
TaskItemBack
firstHandlGid
=
(
System
.
Object
[]
temp
)
=>
{
for
(
int
i
=
0
;
i
<
gameidJsondata
.
groups
.
Count
;
i
++)
for
(
int
i
=
0
;
i
<
gameidJsondata
.
roomGroupsData
.
Count
;
i
++)
{
{
var
group
=
gameidJsondata
.
groups
[
i
];
var
group
=
gameidJsondata
.
roomGroupsData
[
i
];
for
(
int
i1
=
0
;
i1
<
group
.
area
Ids
.
Count
();
i1
++)
for
(
int
i1
=
0
;
i1
<
group
.
room
Ids
.
Count
();
i1
++)
{
{
gameidJsondata
.
centers
[
group
.
areaIds
[
i1
]].
gid
=
(
short
)(
i
+
1
)
;
gameidJsondata
.
roomDatas
[
group
.
roomIds
[
i1
]].
gid
=
group
.
id
;
}
}
}
}
return
;
return
;
...
@@ -294,14 +305,14 @@ public class mainGameView : MonoBehaviour
...
@@ -294,14 +305,14 @@ public class mainGameView : MonoBehaviour
Vector3
localPosTemp
=
new
Vector3
();
Vector3
localPosTemp
=
new
Vector3
();
Quaternion
quaternion
=
new
Quaternion
();
Quaternion
quaternion
=
new
Quaternion
();
var
areaIdBaseTransform
=
areaIdBase
.
transform
.
GetComponent
<
RectTransform
>();
var
areaIdBaseTransform
=
areaIdBase
.
transform
.
GetComponent
<
RectTransform
>();
for
(
int
i
=
0
;
i
<
gameidJsondata
.
center
s
.
Count
;
i
++)
for
(
int
i
=
0
;
i
<
gameidJsondata
.
roomData
s
.
Count
;
i
++)
{
{
var
item
=
gameidJsondata
.
center
s
[
i
];
var
item
=
gameidJsondata
.
roomData
s
[
i
];
if
(
digitMatrix
.
Data
[
item
.
x
,
item
.
y
]
>=
20
)
if
(
digitMatrix
.
Data
[
item
.
px
,
item
.
p
y
]
>=
20
)
{
{
item
.
tempExKey
=
"idFlg_"
+
j
.
ToSafeString
();
item
.
tempExKey
=
"idFlg_"
+
j
.
ToSafeString
();
j
++;
j
++;
//
转成物体坐标系
?
//
转成物体坐标系?
Transform
idValueTran
=
areaIdBase
.
transform
.
Find
(
item
.
tempExKey
);
Transform
idValueTran
=
areaIdBase
.
transform
.
Find
(
item
.
tempExKey
);
if
(
idValueTran
==
null
)
if
(
idValueTran
==
null
)
{
{
...
@@ -314,16 +325,16 @@ public class mainGameView : MonoBehaviour
...
@@ -314,16 +325,16 @@ public class mainGameView : MonoBehaviour
idValueTran
.
parent
=
areaIdBase
.
transform
;
idValueTran
.
parent
=
areaIdBase
.
transform
;
idGameObject
.
name
=
item
.
tempExKey
;
idGameObject
.
name
=
item
.
tempExKey
;
}
}
//
怎么转换坐标
//
怎么转换坐标
RectTransform
rectTransform
=
areaIdBase
.
transform
.
parent
.
GetComponent
<
RectTransform
>();
RectTransform
rectTransform
=
areaIdBase
.
transform
.
parent
.
GetComponent
<
RectTransform
>();
//
坐标怎么设置?
//
坐标怎么设置?
idValueTran
.
GetLocalPositionAndRotation
(
out
localPosTemp
,
out
quaternion
);
idValueTran
.
GetLocalPositionAndRotation
(
out
localPosTemp
,
out
quaternion
);
//
严格居中 字体大小等问题 需要调整json的生成脚本生成逻辑后才能继续
//
严格居中 字体大小等问题 需要调整json的生成脚本生成逻辑后才能继续
localPosTemp
.
x
=
(
float
)
item
.
x
/
(
float
)
width
*
rectTransform
.
rect
.
width
-
(
rectTransform
.
rect
.
width
/
2
);
localPosTemp
.
x
=
(
float
)
item
.
p
x
/
(
float
)
width
*
rectTransform
.
rect
.
width
-
(
rectTransform
.
rect
.
width
/
2
);
localPosTemp
.
y
=
(
float
)
item
.
y
/
(
float
)
height
*
rectTransform
.
rect
.
height
-
(
rectTransform
.
rect
.
height
/
2
);
localPosTemp
.
y
=
(
float
)
item
.
p
y
/
(
float
)
height
*
rectTransform
.
rect
.
height
-
(
rectTransform
.
rect
.
height
/
2
);
idValueTran
.
SetLocalPositionAndRotation
(
localPosTemp
,
quaternion
);
idValueTran
.
SetLocalPositionAndRotation
(
localPosTemp
,
quaternion
);
idValueTran
.
gameObject
.
SetActive
(
false
);
idValueTran
.
gameObject
.
SetActive
(
false
);
idValueTran
.
GetComponent
<
TextMeshProUGUI
>().
text
=
item
.
gid
.
ToString
();
idValueTran
.
GetComponent
<
TextMeshProUGUI
>().
text
=
(
item
.
gid
)
.
ToString
();
}
}
}
}
for
(
int
i
=
j
;
i
<
short
.
MaxValue
;
i
++)
for
(
int
i
=
j
;
i
<
short
.
MaxValue
;
i
++)
...
@@ -336,38 +347,8 @@ public class mainGameView : MonoBehaviour
...
@@ -336,38 +347,8 @@ public class mainGameView : MonoBehaviour
}
}
protected
void
onInitEndHandler
()
protected
void
onInitEndHandler
()
{
{
//for (int i = 0; i < gameidJsondata.centers.; i++)
utilsTools
.
sendEvent
(
"gameViewOnInitEnd"
);
//{
// var item = gameidJsondata.centers[i];
// System.Object[] temp1 = { item };
// TaskManages.getInstance().addTask(this, (System.Object[] param) =>
// {
// gameAreaItem areaItem = (gameAreaItem)param[0];
// showArea(areaItem.id);
// }, temp1);
// //shorts.Add(item.id);
//}
//utilsTools.addTimer_Sec(gameObject, "test auto add Color", (string name1) =>
//{
// int idx = Random.Range(0, shorts.Count);
// showArea(shorts[idx]);
// return true;
//}, 2.0, (uint)(shorts.Count + 20));
//switchShowAreaGroup(3);
//for(int i = 0;i < 20; i++)
//{
// showArea(i);
//}
utilsTools
.
sendEvent
(
"gameViewOnInitEnd"
);
for
(
int
i
=
0
;
i
<
0
;
i
++)
{
showArea
(
i
);
}
}
}
//typeId 1 == line
//typeId 2 == color
//typeId 3 == json
public
void
loadFileInfo
(
string
url
,
string
localpath
,
int
typeId
)
public
void
loadFileInfo
(
string
url
,
string
localpath
,
int
typeId
)
{
{
if
(
typeId
==
1
||
typeId
==
2
)
if
(
typeId
==
1
||
typeId
==
2
)
...
@@ -399,15 +380,15 @@ public class mainGameView : MonoBehaviour
...
@@ -399,15 +380,15 @@ public class mainGameView : MonoBehaviour
image
.
sprite
=
Sprite
.
Create
(
texture2d
,
new
Rect
(
0
,
0
,
texture2d
.
width
,
texture2d
.
height
),
new
Vector2
(
0.5f
,
0.5f
));
image
.
sprite
=
Sprite
.
Create
(
texture2d
,
new
Rect
(
0
,
0
,
texture2d
.
width
,
texture2d
.
height
),
new
Vector2
(
0.5f
,
0.5f
));
if
(
lowImg
!=
null
&&
typeId
==
2
)
if
(
lowImg
!=
null
&&
typeId
==
2
)
{
{
//
添加底图
//
添加底图
string
dir
=
utilsTools
.
getWritableByPath
(
runGameDatas
);
string
dir
=
utilsTools
.
getWritableByPath
(
runGameDatas
);
string
lowPath
=
dir
+
"/"
+
texture2d
.
width
.
ToSafeString
()
+
"X"
+
texture2d
.
height
.
ToSafeString
()+
".png"
;
string
lowPath
=
dir
+
"/"
+
texture2d
.
width
.
ToSafeString
()
+
"X"
+
texture2d
.
height
.
ToSafeString
()+
".png"
;
print
(
lowPath
);
Debug
.
Log
(
lowPath
);
if
(
utilsTools
.
IsExistIO
(
lowPath
)
==
false
)
if
(
utilsTools
.
IsExistIO
(
lowPath
)
==
false
)
{
{
Texture2D
lowTexture
=
new
Texture2D
(
texture2d
.
width
,
texture2d
.
height
,
TextureFormat
.
RGBA32
,
false
);
Texture2D
lowTexture
=
new
Texture2D
(
texture2d
.
width
,
texture2d
.
height
,
TextureFormat
.
RGBA32
,
false
);
Color
color
=
new
Color
(
1
,
1
,
1
,
0
);
Color
color
=
new
Color
(
1
,
1
,
1
,
0
);
print
(
"tttttttttttttttt **** create select img"
);
Debug
.
Log
(
"tttttttttttttttt **** create select img"
);
for
(
int
x
=
0
;
x
<
texture2d
.
width
;
x
++)
for
(
int
x
=
0
;
x
<
texture2d
.
width
;
x
++)
{
{
for
(
int
y
=
0
;
y
<
texture2d
.
height
;
y
++)
for
(
int
y
=
0
;
y
<
texture2d
.
height
;
y
++)
...
@@ -415,15 +396,13 @@ public class mainGameView : MonoBehaviour
...
@@ -415,15 +396,13 @@ public class mainGameView : MonoBehaviour
lowTexture
.
SetPixel
(
x
,
y
,
color
);
lowTexture
.
SetPixel
(
x
,
y
,
color
);
}
}
}
}
print
(
"tttttttttttttttt **** create select img 1"
);
utilsTools
.
saveByteToPath
(
lowTexture
.
EncodeToPNG
(),
lowPath
);
utilsTools
.
saveByteToPath
(
lowTexture
.
EncodeToPNG
(),
lowPath
);
utilsTools
.
saveImageDefaultMetaInfoToPath
(
lowPath
);
utilsTools
.
saveImageDefaultMetaInfoToPath
(
lowPath
);
print
(
"tttttttttttttttt **** create select img 2"
);
}
}
Image
lowImgView
=
lowImg
.
GetComponent
<
Image
>();
Image
lowImgView
=
lowImg
.
GetComponent
<
Image
>();
print
(
lowPath
);
Debug
.
Log
(
lowPath
);
utilsTools
.
loadLocalImage
(
this
,
lowImgView
,
lowPath
,
(
bool
isOk
)
=>
{
utilsTools
.
loadLocalImage
(
this
,
lowImgView
,
lowPath
,
(
bool
isOk
)
=>
{
print
(
"lowImgTexture2d isOk "
+
isOk
.
ToSafeString
());
Debug
.
Log
(
"lowImgTexture2d isOk "
+
isOk
.
ToSafeString
());
if
(
isOk
)
if
(
isOk
)
{
{
var
lowImgTexture2d
=
lowImgView
.
sprite
.
texture
;
var
lowImgTexture2d
=
lowImgView
.
sprite
.
texture
;
...
@@ -454,13 +433,40 @@ public class mainGameView : MonoBehaviour
...
@@ -454,13 +433,40 @@ public class mainGameView : MonoBehaviour
{
{
string
jsondata
=
data
as
string
;
string
jsondata
=
data
as
string
;
this
.
gameidJsondata
=
JsonUtility
.
FromJson
<
gameIdJsonData
>(
jsondata
);
this
.
gameidJsondata
=
JsonUtility
.
FromJson
<
gameIdJsonData
>(
jsondata
);
if
(
this
.
nowSelectInfos
!=
null
)
{
int
centerSize
=
gameidJsondata
.
roomDatas
.
Count
();
for
(
int
i
=
0
;
i
<
this
.
nowSelectInfos
.
Count
();
i
++)
{
int
aid
=
this
.
nowSelectInfos
[
i
];
if
(
aid
<
0
||
aid
>=
centerSize
)
{
Debug
.
LogError
(
"本地db错误,或者json错误,超出范围"
);
return
0
;
}
gameidJsondata
.
roomDatas
[
aid
].
isShow
=
true
;
}
for
(
int
i
=
0
;
i
<
gameidJsondata
.
roomGroupsData
.
Count
();
i
++)
{
var
group
=
gameidJsondata
.
roomGroupsData
[
i
];
group
.
isComplete
=
true
;
for
(
int
j
=
0
;
j
<
group
.
roomIds
.
Count
();
j
++)
{
if
(
gameidJsondata
.
roomDatas
[
group
.
roomIds
[
j
]].
isShow
==
false
)
{
group
.
isComplete
=
false
;
break
;
}
}
}
}
onLoadFileOk
(
typeId
);
onLoadFileOk
(
typeId
);
return
0
;
return
0
;
}
}
});
});
}
}
}
}
public
bool
loadGameImgId
(
string
lineUrl
,
string
colorUrl
,
string
jsonUrl
)
public
bool
loadGameImgId
(
string
lineUrl
,
string
colorUrl
,
string
jsonUrl
,
string
gid
,
List
<
short
>
selectIds
=
null
)
{
{
if
(
lowImg
!=
null
)
lowImg
.
SetActive
(
false
);
if
(
lowImg
!=
null
)
lowImg
.
SetActive
(
false
);
if
(
lineUrl
.
EndsWith
(
".png"
)
==
false
)
if
(
lineUrl
.
EndsWith
(
".png"
)
==
false
)
...
@@ -510,26 +516,19 @@ public class mainGameView : MonoBehaviour
...
@@ -510,26 +516,19 @@ public class mainGameView : MonoBehaviour
{
{
utilsTools
.
CreateDirectory
(
progresNameDir
);
utilsTools
.
CreateDirectory
(
progresNameDir
);
}
}
this
.
nowSelectInfos
=
selectIds
;
loadFileInfo
(
jsonUrl
,
runGameDatas
+
"/"
+
jsonLocalName
+
".json"
,
3
);
loadFileInfo
(
jsonUrl
,
runGameDatas
+
"/"
+
jsonLocalName
+
".json"
,
3
);
loadFileInfo
(
colorUrl
,
runGameDatas
+
"/"
+
colorLocalName
+
".png"
,
2
);
loadFileInfo
(
colorUrl
,
runGameDatas
+
"/"
+
colorLocalName
+
".png"
,
2
);
loadFileInfo
(
lineUrl
,
runGameDatas
+
"/"
+
lineLocalName
+
".png"
,
1
);
loadFileInfo
(
lineUrl
,
runGameDatas
+
"/"
+
lineLocalName
+
".png"
,
1
);
return
true
;
return
true
;
}
}
//恢复之前的已经显示进度
public
void
showAreaList
(
int
[]
areaids
,
OnAreaHandler
onAreaHandler
=
null
)
{
for
(
int
i
=
0
;
i
<
areaids
.
Count
();
i
++)
{
showArea
(
areaids
[
i
],
onAreaHandler
);
}
}
public
void
showArea
(
int
areaId
,
OnAreaHandler
onAreaHandler
=
null
)
public
void
showArea
(
int
areaId
,
OnAreaHandler
onAreaHandler
=
null
)
{
{
//
显示指定区域
//
显示指定区域
if
(
digitMatrix
!=
null
&&
lineTexture2d
!=
null
&&
gameidJsondata
!=
null
&&
areaId
>=
0
&&
areaId
<
gameidJsondata
.
center
s
.
Count
)
if
(
digitMatrix
!=
null
&&
lineTexture2d
!=
null
&&
gameidJsondata
!=
null
&&
areaId
>=
0
&&
areaId
<
gameidJsondata
.
roomData
s
.
Count
)
{
{
gameAreaItem
areaItem1
=
gameidJsondata
.
center
s
[
areaId
];
gameAreaItem
areaItem1
=
gameidJsondata
.
roomData
s
[
areaId
];
short
oldValue
=
digitMatrix
.
Data
[
areaItem1
.
x
,
areaItem1
.
y
];
short
oldValue
=
digitMatrix
.
Data
[
areaItem1
.
px
,
areaItem1
.
p
y
];
if
(
oldValue
==
-
2
)
if
(
oldValue
==
-
2
)
{
{
if
(
onAreaHandler
!=
null
)
if
(
onAreaHandler
!=
null
)
...
@@ -541,15 +540,16 @@ public class mainGameView : MonoBehaviour
...
@@ -541,15 +540,16 @@ public class mainGameView : MonoBehaviour
var
nowIdNode
=
areaIdBase
.
transform
.
Find
(
areaItem1
.
tempExKey
);
var
nowIdNode
=
areaIdBase
.
transform
.
Find
(
areaItem1
.
tempExKey
);
nowIdNode
.
SetParent
(
null
);
nowIdNode
.
SetParent
(
null
);
GameObject
.
Destroy
(
nowIdNode
.
gameObject
);
GameObject
.
Destroy
(
nowIdNode
.
gameObject
);
areaItem1
.
tempExKey
=
""
;
}
}
TaskManages
task
=
TaskManages
.
getInstance
();
TaskManages
task
=
TaskManages
.
getInstance
();
TaskItemBack
taskItemBack
=
(
System
.
Object
[]
param
)
=>
TaskItemBack
taskItemBack
=
(
System
.
Object
[]
param
)
=>
{
{
Color
color
=
new
Color
(
0
,
0
,
0
,
0
);
Color
color
=
new
Color
(
0
,
0
,
0
,
0
);
gameAreaItem
areaItem
=
(
gameAreaItem
)
param
[
0
];
gameAreaItem
areaItem
=
(
gameAreaItem
)
param
[
0
];
short
oldValue1
=
digitMatrix
.
Data
[
areaItem
.
x
,
areaItem
.
y
];
short
oldValue1
=
digitMatrix
.
Data
[
areaItem
.
px
,
areaItem
.
p
y
];
var
lowImgTexture2d
=
lowImgTexture2ds
[
0
];
var
lowImgTexture2d
=
lowImg
.
GetComponent
<
Image
>().
sprite
.
texture
;
// lowImg
Texture2ds[0];
digitMatrix
.
FloodFill8WithStack
(
areaItem
.
x
,
areaItem
.
y
,
-
2
,
oldValue1
,
(
short
x1
,
short
y1
,
short
v
)
=>
{
digitMatrix
.
FloodFill8WithStack
(
areaItem
.
px
,
areaItem
.
p
y
,
-
2
,
oldValue1
,
(
short
x1
,
short
y1
,
short
v
)
=>
{
color
=
lineTexture2d
.
GetPixel
(
x1
,
y1
);
color
=
lineTexture2d
.
GetPixel
(
x1
,
y1
);
color
.
a
=
0
;
color
.
a
=
0
;
lineTexture2d
.
SetPixel
(
x1
,
y1
,
color
);
lineTexture2d
.
SetPixel
(
x1
,
y1
,
color
);
...
@@ -568,7 +568,6 @@ public class mainGameView : MonoBehaviour
...
@@ -568,7 +568,6 @@ public class mainGameView : MonoBehaviour
utilsTools
.
saveByteToPath
(
lowImgTexture2d
.
EncodeToPNG
(),
groupPath
);
utilsTools
.
saveByteToPath
(
lowImgTexture2d
.
EncodeToPNG
(),
groupPath
);
};
};
task
.
addTask
(
this
,
taskItemBack
,
areaItem1
);
task
.
addTask
(
this
,
taskItemBack
,
areaItem1
);
}
}
else
if
(
onAreaHandler
!=
null
)
else
if
(
onAreaHandler
!=
null
)
{
{
...
@@ -581,8 +580,7 @@ public class mainGameView : MonoBehaviour
...
@@ -581,8 +580,7 @@ public class mainGameView : MonoBehaviour
if
(
gid
==
nowSelectgid
)
if
(
gid
==
nowSelectgid
)
{
{
if
(
onAreaHandler
!=
null
)
if
(
onAreaHandler
!=
null
)
onAreaHandler
(
gid
,
true
);
onAreaHandler
(
gid
,
true
);
return
true
;
return
true
;
}
}
if
(
lowImg
==
null
)
if
(
lowImg
==
null
)
...
@@ -591,7 +589,7 @@ public class mainGameView : MonoBehaviour
...
@@ -591,7 +589,7 @@ public class mainGameView : MonoBehaviour
onAreaHandler
(
gid
,
false
);
onAreaHandler
(
gid
,
false
);
return
false
;
return
false
;
}
}
if
(!(
digitMatrix
!=
null
&&
lineTexture2d
!=
null
&&
gameidJsondata
!=
null
&&
gid
>=
0
&&
gid
<
gameidJsondata
.
groups
.
Count
))
if
(!(
digitMatrix
!=
null
&&
lineTexture2d
!=
null
&&
gameidJsondata
!=
null
&&
gid
>=
0
&&
gid
<
gameidJsondata
.
roomGroupsData
.
Count
))
{
{
if
(
onAreaHandler
!=
null
)
if
(
onAreaHandler
!=
null
)
onAreaHandler
(
gid
,
false
);
onAreaHandler
(
gid
,
false
);
...
@@ -600,70 +598,414 @@ public class mainGameView : MonoBehaviour
...
@@ -600,70 +598,414 @@ public class mainGameView : MonoBehaviour
lowImg
.
SetActive
(
true
);
lowImg
.
SetActive
(
true
);
string
groupPath
=
getSelectPathByGid
(
gid
);
string
groupPath
=
getSelectPathByGid
(
gid
);
Image
image
=
lowImg
.
GetComponent
<
Image
>();
Image
image
=
lowImg
.
GetComponent
<
Image
>();
utilsTools
.
loadLocalImage
(
this
,
image
,
groupPath
,(
bool
isOk
)
=>
{
if
(
utilsTools
.
IsExistIO
(
groupPath
))
if
(
isOk
)
{
if
(
nowSelectgid
>=
0
)
{
for
(
int
i
=
0
;
i
<
gameidJsondata
.
roomGroupsData
[
nowSelectgid
-
1
].
roomIds
.
Count
();
i
++)
{
short
aid
=
gameidJsondata
.
roomGroupsData
[
nowSelectgid
-
1
].
roomIds
[
i
];
string
key
=
gameidJsondata
.
roomDatas
[
aid
].
tempExKey
;
if
(
key
.
Equals
(
""
)
==
false
)
{
areaIdBase
.
transform
.
Find
(
key
).
gameObject
.
SetActive
(
false
);
}
}
}
nowSelectgid
=
gid
;
utilsTools
.
loadLocalImage
(
this
,
image
,
groupPath
,
(
bool
isOk
)
=>
{
if
(
isOk
)
{
lowImgTexture2ds
[
0
]
=
image
.
sprite
.
texture
;
lowImgTexture2ds
[
0
].
Apply
();
for
(
int
i
=
0
;
i
<
gameidJsondata
.
roomGroupsData
[
nowSelectgid
-
1
].
roomIds
.
Count
();
i
++)
{
short
aid
=
gameidJsondata
.
roomGroupsData
[
nowSelectgid
-
1
].
roomIds
[
i
];
string
key
=
gameidJsondata
.
roomDatas
[
aid
].
tempExKey
;
if
(
key
.
Equals
(
""
)
==
false
)
{
var
node
=
areaIdBase
.
transform
.
Find
(
key
);
if
(
node
==
null
)
{
gameidJsondata
.
roomDatas
[
aid
].
tempExKey
=
""
;
continue
;
}
node
.
gameObject
.
SetActive
(
true
);
}
}
}
if
(
onAreaHandler
!=
null
)
onAreaHandler
(
gid
,
isOk
);
});
}
else
{
// 需要添加一个紧急插队的操作
var
group
=
gameidJsondata
.
roomGroupsData
[
nowSelectgid
-
1
];
var
tm
=
TaskManages
.
getInstance
();
Texture2D
texture2D
=
new
Texture2D
(
image
.
sprite
.
texture
.
width
,
image
.
sprite
.
texture
.
height
);
texture2D
.
LoadRawTextureData
(
image
.
sprite
.
texture
.
GetRawTextureData
());
TaskItemBack
taskItemBack
=
(
System
.
Object
[]
param
)
=>
{
gameAreaItem
item
=
(
gameAreaItem
)
param
[
0
];
bool
isShow
=
(
bool
)
param
[
1
];
if
(
item
.
tempExKey
.
Equals
(
""
)
==
false
)
{
this
.
areaIdBase
.
transform
.
Find
(
item
.
tempExKey
).
gameObject
.
SetActive
(
isShow
);
}
Color
color
=
new
Color
();
digitMatrix
.
PeekFloodFill8WithStack
(
item
.
px
,
item
.
py
,
(
short
)(
0
-
item
.
id
),
(
short
)
item
.
id
,
(
short
x
,
short
y
,
short
c
)
=>
{
color
=
texture2D
.
GetPixel
(
x
,
y
);
color
.
a
=
isShow
?
1
:
0
;
texture2D
.
SetPixel
(
x
,
y
,
color
);
return
false
;
});
};
//倒排列的顺序
tm
.
insertTask
(
this
,
(
System
.
Object
[]
param
)
=>
{
{
lowImgTexture2ds
[
0
]
=
image
.
sprite
.
texture
;
short
pgid
=
(
short
)
param
[
0
];
lowImgTexture2ds
[
0
].
Apply
();
Sprite
sprite
=
Sprite
.
Create
(
texture2D
,
new
Rect
(
0
,
0
,
texture2D
.
width
,
texture2D
.
height
),
new
Vector2
(
0.5f
,
0.5f
));
image
.
sprite
=
sprite
;
saveGroupTexture
(
pgid
,
texture2D
);
image
.
sprite
.
texture
.
Apply
();
OnAreaHandler
onAreaHandler1
=
(
OnAreaHandler
)
param
[
1
];
if
(
onAreaHandler1
!=
null
)
onAreaHandler1
(
pgid
,
true
);
},
gid
,
onAreaHandler
);
for
(
int
i
=
0
;
i
<
group
.
roomIds
.
Count
();
i
++)
{
var
area
=
gameidJsondata
.
roomDatas
[
group
.
roomIds
[
i
]];
if
(
area
.
isShow
==
false
)
{
tm
.
insertTask
(
this
,
taskItemBack
,
area
,
false
);
}
}
}
if
(
onAreaHandler
!=
null
)
var
group2
=
gameidJsondata
.
roomGroupsData
[
gid
];
onAreaHandler
(
gid
,
isOk
);
for
(
int
i
=
0
;
i
<
group2
.
roomIds
.
Count
();
i
++)
});
{
//var lowImgTexture2d = lowImgTexture2ds[gid];
var
area
=
gameidJsondata
.
roomDatas
[
group2
.
roomIds
[
i
]];
//var sprite = Sprite.Create(lowImgTexture2d, new Rect(0, 0, lowImgTexture2d.width, lowImgTexture2d.height), new Vector2(0.5f, 0.5f));
if
(
area
.
isShow
==
false
)
//lowImg.GetComponent<Image>().sprite = sprite;
{
//sprite.texture.Apply();
tm
.
insertTask
(
this
,
taskItemBack
,
area
,
true
);
}
}
nowSelectgid
=
gid
;
}
return
true
;
return
true
;
}
}
public
List
<
Color
>
getGroups
()
public
List
<
TempGroupInfos
>
getGroups
()
{
{
List
<
Color
>
colors
=
new
List
<
Color
>();
List
<
TempGroupInfos
>
ret
=
new
List
<
TempGroupInfos
>();
if
(
digitMatrix
!=
null
&&
lineTexture2d
!=
null
&&
gameidJsondata
!=
null
)
if
(
digitMatrix
!=
null
&&
lineTexture2d
!=
null
&&
gameidJsondata
!=
null
)
{
{
foreach
(
var
item
in
gameidJsondata
.
groups
)
foreach
(
var
item
in
gameidJsondata
.
roomGroupsData
)
{
{
Color
color
=
new
Color
();
TempGroupInfos
tempGroupInfos
=
new
TempGroupInfos
();
item
.
getRGB
(
out
color
);
item
.
getRGB
(
out
tempGroupInfos
.
rgb
);
colors
.
Add
(
color
);
tempGroupInfos
.
gid
=
item
.
id
;
if
(
item
.
isComplete
)
tempGroupInfos
.
jindu
=
1
;
else
{
short
cout
=
0
;
for
(
int
i
=
0
;
i
<
item
.
roomIds
.
Count
();
i
++)
{
if
(
gameidJsondata
.
roomDatas
[
item
.
roomIds
[
i
]].
isShow
)
{
cout
++;
}
}
//防止出现 整数 2/5 ==> 0
tempGroupInfos
.
jindu
=
(
float
)
cout
/
(
float
)
item
.
roomIds
.
Count
();
}
ret
.
Add
(
tempGroupInfos
);
}
}
}
}
return
colors
;
return
ret
;
}
}
int
getAreaByPos
(
int
x
,
int
y
)
int
getAreaByPos
(
int
x
,
int
y
)
{
{
if
(
digitMatrix
==
null
||
lineTexture2d
==
null
||
gameidJsondata
==
null
||
x
>=
digitMatrix
.
RowCount
||
y
>=
digitMatrix
.
ColumnCount
)
if
(
digitMatrix
==
null
||
lineTexture2d
==
null
||
gameidJsondata
==
null
||
x
>=
digitMatrix
.
RowCount
||
y
>=
digitMatrix
.
ColumnCount
)
return
-
1
;
return
-
1
;
short
oldValue
=
digitMatrix
.
Data
[
x
,
y
];
short
oldValue
=
digitMatrix
.
Data
[
x
,
y
];
if
(
oldValue
==
-
2
)
return
-
1
;
//
已经显示
if
(
oldValue
==
-
2
)
return
-
1
;
//
已经显示
if
(
oldValue
==
0
)
return
-
1
;
//
请稍后尚未初始化完成
if
(
oldValue
==
0
)
return
-
1
;
//
请稍后尚未初始化完成
if
(
oldValue
==
-
1
)
return
-
1
;
//
这是轮廓上
if
(
oldValue
==
-
1
)
return
-
1
;
//
这是轮廓上
return
oldValue
-
20
;
return
oldValue
-
20
;
}
}
public
bool
showAreaByPos
(
short
x
,
short
y
,
OnAreaHandler
showBack
)
{
if
(
x
>=
digitMatrix
.
RowCount
||
y
>=
digitMatrix
.
ColumnCount
||
this
.
nowSelectgid
<
0
||
x
<
0
||
y
<
0
)
{
if
(
showBack
!=
null
)
showBack
(-
1
,
false
);
return
false
;
}
short
oldValue
=
digitMatrix
.
Data
[
x
,
y
];
if
(
oldValue
<
20
)
{
if
(
showBack
!=
null
)
showBack
(-
1
,
false
);
return
false
;
}
short
aid
=
(
short
)(
oldValue
-
20
);
var
areaItem
=
gameidJsondata
.
roomDatas
[
aid
];
if
(
gameidJsondata
.
roomGroupsData
[
nowSelectgid
-
1
].
roomIds
.
IndexOf
(
aid
)
<
0
)
{
if
(
showBack
!=
null
)
showBack
(
aid
,
false
);
return
false
;
}
if
(
areaItem
.
isShow
)
{
if
(
showBack
!=
null
)
showBack
(-
1
,
false
);
return
false
;
}
areaItem
.
isShow
=
true
;
//showArea(aid);
if
(
areaItem
.
tempExKey
.
Equals
(
""
)
==
false
)
{
var
node
=
areaIdBase
.
transform
.
Find
(
areaItem
.
tempExKey
);
if
(
node
!=
null
)
{
node
.
SetParent
(
null
);
GameObject
.
Destroy
(
node
.
gameObject
);
}
areaItem
.
tempExKey
=
""
;
}
AreaAnimationDiffuse
areaAnimationDiffuse
=
new
AreaAnimationDiffuse
(
x
,
y
,
aid
);
areaAnimationDiffuse
.
m_fpsStart
=
0
;
showAreaAnimationDatas
.
Add
(
areaAnimationDiffuse
);
return
true
;
}
public
void
loadTest
()
public
void
loadTest
()
{
{
loadGameImgId
(
loadGameImgId
(
"http://192.168.124.160:8795/srcImgs/temp1/testImg
line.png"
,
"http://192.168.124.160:8795/srcImgs/colorFan/tu
line.png"
,
"http://192.168.124.160:8795/srcImgs/temp1/testImg
.png"
,
"http://192.168.124.160:8795/srcImgs/colorFan/tucolor
.png"
,
"http://192.168.124.160:8795/srcImgs/temp1/testImg.json"
"http://192.168.124.160:8795/srcImgs/colorFan/tu.json"
,
);
"tu"
);
}
}
// Start is called before the first frame update
// Start is called before the first frame update
void
Start
()
void
Start
()
{
{
//utilsTools.HideView(gameObject);
//Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None);
utilsTools
.
addTimer_Update
(
gameObject
,
"tempNext"
,
(
string
name
)
=>
{
//loadTest();
return
false
;
});
}
}
private
void
showColorByPos
(
int
x
,
int
y
,
short
aid
,
Texture2D
lowImgTexture2d
)
{
digitMatrix
.
Data
[(
short
)
x
,
(
short
)
y
]
=
-
2
;
Color
color
=
lineTexture2d
.
GetPixel
(
x
,
y
);
color
.
a
=
0
;
lineTexture2d
.
SetPixel
(
x
,
y
,
color
);
color
=
lowImgTexture2d
.
GetPixel
(
x
,
y
);
color
.
a
=
0
;
lowImgTexture2d
.
SetPixel
(
x
,
y
,
color
);
}
// Update is called once per frame
// Update is called once per frame
void
Update
()
void
Update
()
{
{
TaskManages
.
getInstance
().
updateTask
(
this
);
TaskManages
.
getInstance
().
updateTask
(
this
);
onShowAnimationHandler
();
}
//暂时不支持 不同组在同一帧率填充过程
void
onShowAnimationHandler
()
{
if
(
showAreaAnimationDatas
.
Count
>
0
)
{
int
cout
=
0
;
int
width
=
lineTexture2d
.
width
;
int
height
=
lineTexture2d
.
height
;
Texture2D
selectTexture
=
null
;
if
(
lowImg
!=
null
)
{
selectTexture
=
lowImg
.
GetComponent
<
Image
>().
sprite
.
texture
;
}
List
<
short
>
removeAids
=
new
List
<
short
>();
foreach
(
var
item
in
showAreaAnimationDatas
)
{
float
setp
=
0.35f
;
int
cout1
=
0
;
if
(
item
.
m_fpsStart
>
10
)
{
setp
=
1
/
(
item
.
m_fpsStart
/
5f
);
}
short
nowcheckAid
=
(
short
)(
item
.
m_aid
+
20
);
bool
isChange
=
nowSelectgid
.
Equals
(
gameidJsondata
.
roomDatas
[
item
.
m_aid
].
gid
);
for
(
float
angle
=
0
;
angle
<
360
;
angle
+=
setp
)
{
Vector2
direct
=
new
Vector2
(
Mathf
.
Sin
(
angle
),
Mathf
.
Cos
(
angle
));
for
(
short
r
=
item
.
m_fpsStart
;
r
<
item
.
m_fpsEnd
;
r
++)
{
//下标0就只需要一个点就可以了,不需要360都算一遍
if
(
r
==
0
&&
utilsTools
.
isEqualByValue
(
angle
,
0.0f
,
0.000003f
)
==
false
)
continue
;
Vector2
scale
=
direct
*
r
;
short
x
=
Convert
.
ToInt16
(
scale
.
x
+
item
.
m_x
);
short
y
=
Convert
.
ToInt16
(
scale
.
y
+
item
.
m_y
);
if
(
x
<
0
||
y
<
0
||
x
>=
width
||
y
>=
height
)
continue
;
short
nowDataValue
=
digitMatrix
.
Data
[
x
,
y
];
if
(
nowDataValue
.
Equals
(
nowcheckAid
)
==
false
)
{
continue
;
}
string
key
=
x
.
ToString
()
+
"_"
+
y
.
ToString
();
digitMatrix
.
Data
[
x
,
y
]
=
-
1
;
Color
color
=
lineTexture2d
.
GetPixel
(
x
,
y
);
color
.
a
=
0
;
lineTexture2d
.
SetPixel
(
x
,
y
,
color
);
cout
++;
cout1
++;
if
(
selectTexture
!=
null
)
{
color
=
selectTexture
.
GetPixel
(
x
,
y
);
color
.
a
=
0
;
selectTexture
.
SetPixel
(
x
,
y
,
color
);
}
}
}
if
(
cout1
==
0
)
{
//没有可渲染区域
removeAids
.
Add
(
item
.
m_aid
);
Debug
.
Log
(
"没有找到填充的颜色像素"
+
item
.
m_aid
.
ToString
());
}
else
{
short
diff
=
(
short
)(
item
.
m_fpsEnd
-
item
.
m_fpsStart
);
item
.
m_fpsStart
=
item
.
m_fpsEnd
;
item
.
m_fpsEnd
+=
diff
;
}
}
if
(
cout
==
0
)
{
showAreaAnimationDatas
.
Clear
();
return
;
}
if
(
selectTexture
!=
null
)
{
selectTexture
.
Apply
();
}
lineTexture2d
.
Apply
();
if
(
removeAids
.
Count
>
0
)
{
//移除已经播放完成
foreach
(
var
aid
in
removeAids
)
{
for
(
int
i
=
0
;
i
<
showAreaAnimationDatas
.
Count
;
i
++)
{
if
(
showAreaAnimationDatas
[
i
].
m_aid
.
Equals
(
aid
)
==
true
)
{
showAreaAnimationDatas
.
RemoveAt
(
i
);
break
;
}
}
}
}
}
}
void
testFunByMousePtShowYuanAnimation
()
{
if
(
Input
.
GetMouseButtonDown
(
0
))
{
RectTransform
rectTransform
=
lineImg
.
GetComponent
<
RectTransform
>();
Vector2
pos
=
utilsTools
.
ScreenToUILocalPos
(
rectTransform
,
Input
.
mousePosition
);
rvalue
=
1
;
if
(
lowImgTexture2ds
.
Count
==
0
)
{
Texture2D
texture2D
=
lineImg
.
GetComponent
<
Image
>().
sprite
.
texture
;
Texture2D
texture
=
new
Texture2D
(
texture2D
.
width
,
texture2D
.
height
,
texture2D
.
format
,
false
);
texture
.
LoadRawTextureData
(
texture
.
GetRawTextureData
());
lowImgTexture2ds
.
Add
(
texture
);
texture
=
new
Texture2D
(
texture2D
.
width
,
texture2D
.
height
,
texture2D
.
format
,
false
);
texture
.
LoadRawTextureData
(
texture
.
GetRawTextureData
());
lowImgTexture2ds
.
Add
(
texture
);
}
else
{
Texture2D
texture2D
=
lowImgTexture2ds
[
1
];
Texture2D
texture
=
new
Texture2D
(
texture2D
.
width
,
texture2D
.
height
,
texture2D
.
format
,
false
);
texture
.
LoadRawTextureData
(
texture
.
GetRawTextureData
());
GameObject
.
Destroy
(
lowImgTexture2ds
[
0
]);
lowImgTexture2ds
[
0
]
=
texture
;
}
Vector2
scaleVector
=
new
Vector2
(
1
,
1
);
scaleVector
.
x
=
lowImgTexture2ds
[
0
].
width
/
rectTransform
.
rect
.
width
;
scaleVector
.
y
=
lowImgTexture2ds
[
0
].
height
/
rectTransform
.
rect
.
height
;
pos1
=
pos
*
scaleVector
;
}
else
if
(
rvalue
>
0
)
{
Dictionary
<
String
,
bool
>
keyValues
=
new
Dictionary
<
string
,
bool
>();
mainGameView
gameView
=
this
;
Texture2D
texture2D
=
null
;
RectTransform
rectTransform
=
gameView
.
lineImg
.
GetComponent
<
RectTransform
>();
float
setp
=
5f
;
if
(
rvalue
>
5
)
{
setp
=
2
/
((
float
)
rvalue
/
8
);
}
for
(
float
angle
=
0
;
angle
<
360
;
angle
+=
setp
)
{
float
radians
=
angle
*
Mathf
.
Deg2Rad
;
Vector2
direction
=
new
Vector2
(
Mathf
.
Cos
(
radians
),
Mathf
.
Sin
(
radians
));
for
(
float
r
=
0
;
r
<
10
;
r
++)
{
if
(
r
+
rvalue
>
100
)
break
;
Vector2
temp
=
direction
*
(
r
+
rvalue
);
int
x
=
Convert
.
ToInt32
(
pos1
.
x
+
temp
.
x
);
int
y
=
Convert
.
ToInt32
(
pos1
.
y
+
temp
.
y
);
if
(
rectTransform
.
rect
.
Contains
(
new
Vector2
(
x
,
y
))
==
false
)
continue
;
string
key
=
x
.
ToString
()
+
"_"
+
y
.
ToString
();
if
(
keyValues
.
ContainsKey
(
key
))
continue
;
keyValues
.
Add
(
key
,
true
);
if
(
texture2D
==
null
)
{
texture2D
=
gameView
.
lowImgTexture2ds
[
0
];
}
//需要尺寸缩放
x
=
Convert
.
ToInt32
(
x
+
texture2D
.
width
/
2
);
//x + Convert.ToInt32(rectTransform.rect.width / 2);
y
=
Convert
.
ToInt32
(
y
+
texture2D
.
height
/
2
);
if
(
x
<
0
||
y
<
0
||
x
>
texture2D
.
width
||
y
>
texture2D
.
height
)
continue
;
Color
color
=
texture2D
.
GetPixel
(
x
,
y
);
color
.
a
=
0
;
texture2D
.
SetPixel
(
x
,
y
,
color
);
}
}
if
(
texture2D
==
null
)
{
rvalue
=
0
;
utilsTools
.
addTimer_Sec
(
gameObject
,
"tempTest_1"
,
(
string
name
)
=>
{
texture2D
=
gameView
.
lowImgTexture2ds
[
1
];
Sprite
sprite
=
Sprite
.
Create
(
texture2D
,
new
Rect
(
0
,
0
,
texture2D
.
width
,
texture2D
.
height
),
new
Vector2
(
0.5f
,
0.5f
));
gameView
.
lineImg
.
GetComponent
<
Image
>().
sprite
=
sprite
;
sprite
.
texture
.
Apply
();
return
false
;
},
3
);
}
else
{
Sprite
sprite
=
Sprite
.
Create
(
texture2D
,
new
Rect
(
0
,
0
,
texture2D
.
width
,
texture2D
.
height
),
new
Vector2
(
0.5f
,
0.5f
));
gameView
.
lineImg
.
GetComponent
<
Image
>().
sprite
=
sprite
;
sprite
.
texture
.
Apply
();
rvalue
+=
10
;
}
}
}
public
bool
getSize
(
out
int
width
,
out
int
height
)
{
width
=
-
1
;
height
=
-
1
;
if
(
lineTexture2d
==
null
)
return
false
;
width
=
lineTexture2d
.
width
;
height
=
lineTexture2d
.
height
;
return
true
;
}
public
void
debugPos
(
int
x
,
int
y
)
{
}
}
}
}
Assets/scripts/common/nodeNetProxy.cs
View file @
f3192eda
...
@@ -118,7 +118,7 @@ public class nodeNetProxy : MonoBehaviour
...
@@ -118,7 +118,7 @@ public class nodeNetProxy : MonoBehaviour
{
{
if
(
request
.
isNetworkError
||
request
.
isHttpError
)
//�����������ߵ�ַ����
if
(
request
.
isNetworkError
||
request
.
isHttpError
)
//�����������ߵ�ַ����
{
{
print
(
"error"
+
request
.
error
+
url
);
//����������
Debug
.
Log
(
"error"
+
request
.
error
+
url
);
//����������
back
(
""
,
wurl
,
false
,
null
);
back
(
""
,
wurl
,
false
,
null
);
}
}
else
//���û��
else
//���û��
...
@@ -138,16 +138,16 @@ public class nodeNetProxy : MonoBehaviour
...
@@ -138,16 +138,16 @@ public class nodeNetProxy : MonoBehaviour
//��������Ѿ����
//��������Ѿ����
if
(
request
.
isDone
)
if
(
request
.
isDone
)
{
{
print
(
"load end "
+
url
);
Debug
.
Log
(
"load end "
+
url
);
if
(
request
.
isNetworkError
||
request
.
isHttpError
)
//�����������ߵ�ַ����
if
(
request
.
isNetworkError
||
request
.
isHttpError
)
//�����������ߵ�ַ����
{
{
print
(
request
.
error
);
//����������
Debug
.
Log
(
request
.
error
);
//����������
back
(
""
,
wurl
,
false
,
null
);
back
(
""
,
wurl
,
false
,
null
);
}
}
else
//���û��
else
//���û��
{
{
print
(
"load end ok "
+
url
);
Debug
.
Log
(
"load end ok "
+
url
);
String
data1
=
DownloadHandlerBuffer
.
GetContent
(
request
);
String
data1
=
DownloadHandlerBuffer
.
GetContent
(
request
);
back
(
""
,
wurl
,
true
,
data1
);
back
(
""
,
wurl
,
true
,
data1
);
}
}
...
@@ -164,7 +164,7 @@ public class nodeNetProxy : MonoBehaviour
...
@@ -164,7 +164,7 @@ public class nodeNetProxy : MonoBehaviour
}
}
else
else
{
{
print
(
"jar:file://"
+
abspath
);
Debug
.
Log
(
"jar:file://"
+
abspath
);
StartCoroutine
(
loadLocalTextFileData
(
"jar:file://"
+
abspath
,
url
,
back
));
StartCoroutine
(
loadLocalTextFileData
(
"jar:file://"
+
abspath
,
url
,
back
));
}
}
...
@@ -204,7 +204,7 @@ public class nodeNetProxy : MonoBehaviour
...
@@ -204,7 +204,7 @@ public class nodeNetProxy : MonoBehaviour
StartCoroutine
(
loadLocalFileData
(
"file://"
+
abspath
,
url
,
back
));
StartCoroutine
(
loadLocalFileData
(
"file://"
+
abspath
,
url
,
back
));
else
else
{
{
print
(
"jar:file://"
+
abspath
);
Debug
.
Log
(
"jar:file://"
+
abspath
);
StartCoroutine
(
loadLocalFileData
(
"jar:file://"
+
abspath
,
url
,
back
));
StartCoroutine
(
loadLocalFileData
(
"jar:file://"
+
abspath
,
url
,
back
));
}
}
return
;
return
;
...
@@ -214,8 +214,8 @@ public class nodeNetProxy : MonoBehaviour
...
@@ -214,8 +214,8 @@ public class nodeNetProxy : MonoBehaviour
back
(
""
,
url
,
false
,
null
);
back
(
""
,
url
,
false
,
null
);
return
;
return
;
}
}
print
(
"no find path "
+
localpath
+
" >> "
+
abspath
);
Debug
.
Log
(
"no find path "
+
localpath
+
" >> "
+
abspath
);
print
(
url
);
Debug
.
Log
(
url
);
nodeNetProxyItem
newItem
=
new
nodeNetProxyItem
();
nodeNetProxyItem
newItem
=
new
nodeNetProxyItem
();
newItem
.
url
=
url
;
newItem
.
url
=
url
;
newItem
.
back
=
back
;
newItem
.
back
=
back
;
...
@@ -235,9 +235,9 @@ public class nodeNetProxy : MonoBehaviour
...
@@ -235,9 +235,9 @@ public class nodeNetProxy : MonoBehaviour
yield
return
unityWebRequest
.
SendWebRequest
();
yield
return
unityWebRequest
.
SendWebRequest
();
if
(
unityWebRequest
.
error
!=
null
)
if
(
unityWebRequest
.
error
!=
null
)
{
{
print
(
"DonLoadText error"
);
Debug
.
Log
(
"DonLoadText error"
);
print
(
unityWebRequest
.
error
);
Debug
.
Log
(
unityWebRequest
.
error
);
print
(
unityWebRequest
.
ToString
());
Debug
.
Log
(
unityWebRequest
.
ToString
());
item
.
back
(
""
,
url
,
false
,
null
);
item
.
back
(
""
,
url
,
false
,
null
);
yield
return
unityWebRequest
;
yield
return
unityWebRequest
;
}
}
...
@@ -288,8 +288,17 @@ public class nodeNetProxy : MonoBehaviour
...
@@ -288,8 +288,17 @@ public class nodeNetProxy : MonoBehaviour
string
path1
=
path
;
string
path1
=
path
;
string
expath
=
Path
.
GetExtension
(
path1
);
string
expath
=
Path
.
GetExtension
(
path1
);
path1
=
path1
.
Substring
(
0
,
path1
.
Length
-
expath
.
Length
);
path1
=
path1
.
Substring
(
0
,
path1
.
Length
-
expath
.
Length
);
print
(
path1
);
if
(
utilsTools
.
IsPhone
==
false
)
item
.
back
(
""
,
url
,
true
,
Resources
.
Load
<
Texture
>(
path1
));
StartCoroutine
(
loadLocalFileData
(
"file://"
+
path1
,
url
,
item
.
back
));
else
{
Debug
.
Log
(
"jar:file://"
+
path1
);
StartCoroutine
(
loadLocalFileData
(
"jar:file://"
+
path1
,
url
,
item
.
back
));
}
//Debug.Log(path1);
//var texture = Resources.Load<Texture>(path1);
//item.back("", url, true, texture);
}
}
yield
return
null
;
yield
return
null
;
...
...
Assets/scripts/test/MouseDragSelect.cs
View file @
f3192eda
...
@@ -59,8 +59,8 @@ public class MouseDragSelect : MonoBehaviour
...
@@ -59,8 +59,8 @@ public class MouseDragSelect : MonoBehaviour
if
(!
draggingMouse
)
if
(!
draggingMouse
)
{
{
mousePositions
[
0
]
=
Input
.
mousePosition
;
mousePositions
[
0
]
=
Input
.
mousePosition
;
print
(
"x start:"
+
mousePositions
[
0
].
x
);
Debug
.
Log
(
"x start:"
+
mousePositions
[
0
].
x
);
print
(
"y start:"
+
mousePositions
[
0
].
y
);
Debug
.
Log
(
"y start:"
+
mousePositions
[
0
].
y
);
}
}
draggingMouse
=
true
;
draggingMouse
=
true
;
}
}
...
@@ -73,12 +73,12 @@ public class MouseDragSelect : MonoBehaviour
...
@@ -73,12 +73,12 @@ public class MouseDragSelect : MonoBehaviour
float
height
=
Math
.
Abs
(
mousePositions
[
1
].
y
-
mousePositions
[
0
].
y
);
float
height
=
Math
.
Abs
(
mousePositions
[
1
].
y
-
mousePositions
[
0
].
y
);
float
x
=
mousePositions
[
0
].
x
;
float
x
=
mousePositions
[
0
].
x
;
float
y
=
mousePositions
[
0
].
y
;
float
y
=
mousePositions
[
0
].
y
;
//
print
("width:" + width);
//
Debug.Log
("width:" + width);
//
print
("height:" + height);
//
Debug.Log
("height:" + height);
print
(
"x end:"
+
mousePositions
[
1
].
x
);
Debug
.
Log
(
"x end:"
+
mousePositions
[
1
].
x
);
print
(
"y end:"
+
mousePositions
[
1
].
y
);
Debug
.
Log
(
"y end:"
+
mousePositions
[
1
].
y
);
position
=
new
Rect
(
x
,
y
,
width
,
height
);
position
=
new
Rect
(
x
,
y
,
width
,
height
);
//
print
("Got last mouse position!");
//
Debug.Log
("Got last mouse position!");
drawRect
=
true
;
drawRect
=
true
;
}
}
}
}
...
...
Assets/scripts/test/tempzhangs.cs
View file @
f3192eda
...
@@ -77,7 +77,7 @@ public class tempzhangs : MonoBehaviour
...
@@ -77,7 +77,7 @@ public class tempzhangs : MonoBehaviour
////void clearFlgs(int startx, int starty, int w, int h, short val)
////void clearFlgs(int startx, int starty, int w, int h, short val)
////{
////{
//// Color tempColor = new Color();
//// Color tempColor = new Color();
////
print
("开始尝试循环赋值");
////
Debug.Log
("开始尝试循环赋值");
//// int nobai = 0;
//// int nobai = 0;
//// for (int i = 0; i < clickTexture2D.width; i++)
//// for (int i = 0; i < clickTexture2D.width; i++)
//// {
//// {
...
@@ -104,7 +104,7 @@ public class tempzhangs : MonoBehaviour
...
@@ -104,7 +104,7 @@ public class tempzhangs : MonoBehaviour
//// setColor(i, j, tempColor);
//// setColor(i, j, tempColor);
//// }
//// }
//// }
//// }
////
print
("结束循环赋值 nobai = " + nobai);
////
Debug.Log
("结束循环赋值 nobai = " + nobai);
//// updateUIMask();
//// updateUIMask();
////}
////}
////void clearAllData()
////void clearAllData()
...
@@ -136,7 +136,7 @@ public class tempzhangs : MonoBehaviour
...
@@ -136,7 +136,7 @@ public class tempzhangs : MonoBehaviour
////private void CaculateVector2(int x, int y)
////private void CaculateVector2(int x, int y)
////{
////{
//// if (dm.Data[x, y] != 1) return;
//// if (dm.Data[x, y] != 1) return;
////
print
("开始绘制圆形");
////
Debug.Log
("开始绘制圆形");
//// operColorSize = 0;
//// operColorSize = 0;
//// lastOperX = -1;
//// lastOperX = -1;
//// dm.FloodFill8WithStack((short)x, (short)y, -100, 1, (short x1, short y1, short value) =>
//// dm.FloodFill8WithStack((short)x, (short)y, -100, 1, (short x1, short y1, short value) =>
...
@@ -154,7 +154,7 @@ public class tempzhangs : MonoBehaviour
...
@@ -154,7 +154,7 @@ public class tempzhangs : MonoBehaviour
////}
////}
////private void updateUIMask()
////private void updateUIMask()
////{
////{
////
print
("替换纹理");
////
Debug.Log
("替换纹理");
//// Sprite sprite = Sprite.Create(clickTexture2D, new Rect(0, 0, clickTexture2D.width, clickTexture2D.height), new Vector2(0.5f, 0.5f));
//// Sprite sprite = Sprite.Create(clickTexture2D, new Rect(0, 0, clickTexture2D.width, clickTexture2D.height), new Vector2(0.5f, 0.5f));
//// sprite.name = "rand__temp__text_localFile";
//// sprite.name = "rand__temp__text_localFile";
//// image0.sprite = sprite;
//// image0.sprite = sprite;
...
@@ -164,7 +164,7 @@ public class tempzhangs : MonoBehaviour
...
@@ -164,7 +164,7 @@ public class tempzhangs : MonoBehaviour
// Byte[] bytes1 = Encoding.UTF8.GetBytes("fileFormatVersion: 2\r\nguid: 54ac8b67ea1f6f14892bd14ea1caab62\r\nTextureImporter:\r\n internalIDToNameTable: []\r\n externalObjects: {}\r\n serializedVersion: 12\r\n mipmaps:\r\n mipMapMode: 0\r\n enableMipMap: 0\r\n sRGBTexture: 1\r\n linearTexture: 0\r\n fadeOut: 0\r\n borderMipMap: 0\r\n mipMapsPreserveCoverage: 0\r\n alphaTestReferenceValue: 0.5\r\n mipMapFadeDistanceStart: 1\r\n mipMapFadeDistanceEnd: 3\r\n bumpmap:\r\n convertToNormalMap: 0\r\n externalNormalMap: 0\r\n heightScale: 0.25\r\n normalMapFilter: 0\r\n flipGreenChannel: 0\r\n isReadable: 0\r\n streamingMipmaps: 0\r\n streamingMipmapsPriority: 0\r\n vTOnly: 0\r\n ignoreMipmapLimit: 0\r\n grayScaleToAlpha: 0\r\n generateCubemap: 6\r\n cubemapConvolution: 0\r\n seamlessCubemap: 0\r\n textureFormat: 1\r\n maxTextureSize: 2048\r\n textureSettings:\r\n serializedVersion: 2\r\n filterMode: 1\r\n aniso: 1\r\n mipBias: 0\r\n wrapU: 1\r\n wrapV: 1\r\n wrapW: 1\r\n nPOTScale: 0\r\n lightmap: 0\r\n compressionQuality: 50\r\n spriteMode: 1\r\n spriteExtrude: 1\r\n spriteMeshType: 1\r\n alignment: 0\r\n spritePivot: {x: 0.5, y: 0.5}\r\n spritePixelsToUnits: 1\r\n spriteBorder: {x: 0, y: 0, z: 0, w: 0}\r\n spriteGenerateFallbackPhysicsShape: 1\r\n alphaUsage: 1\r\n alphaIsTransparency: 1\r\n spriteTessellationDetail: -1\r\n textureType: 8\r\n textureShape: 1\r\n singleChannelComponent: 0\r\n flipbookRows: 1\r\n flipbookColumns: 1\r\n maxTextureSizeSet: 0\r\n compressionQualitySet: 0\r\n textureFormatSet: 0\r\n ignorePngGamma: 0\r\n applyGammaDecoding: 0\r\n swizzle: 50462976\r\n cookieLightType: 0\r\n platformSettings:\r\n - serializedVersion: 3\r\n buildTarget: DefaultTexturePlatform\r\n maxTextureSize: 2048\r\n resizeAlgorithm: 0\r\n textureFormat: -1\r\n textureCompression: 1\r\n compressionQuality: 50\r\n crunchedCompression: 0\r\n allowsAlphaSplitting: 0\r\n overridden: 0\r\n ignorePlatformSupport: 0\r\n androidETC2FallbackOverride: 0\r\n forceMaximumCompressionQuality_BC6H_BC7: 0\r\n - serializedVersion: 3\r\n buildTarget: Standalone\r\n maxTextureSize: 2048\r\n resizeAlgorithm: 0\r\n textureFormat: -1\r\n textureCompression: 1\r\n compressionQuality: 50\r\n crunchedCompression: 0\r\n allowsAlphaSplitting: 0\r\n overridden: 0\r\n ignorePlatformSupport: 0\r\n androidETC2FallbackOverride: 0\r\n forceMaximumCompressionQuality_BC6H_BC7: 0\r\n - serializedVersion: 3\r\n buildTarget: Server\r\n maxTextureSize: 2048\r\n resizeAlgorithm: 0\r\n textureFormat: -1\r\n textureCompression: 1\r\n compressionQuality: 50\r\n crunchedCompression: 0\r\n allowsAlphaSplitting: 0\r\n overridden: 0\r\n ignorePlatformSupport: 0\r\n androidETC2FallbackOverride: 0\r\n forceMaximumCompressionQuality_BC6H_BC7: 0\r\n - serializedVersion: 3\r\n buildTarget: Android\r\n maxTextureSize: 2048\r\n resizeAlgorithm: 0\r\n textureFormat: -1\r\n textureCompression: 1\r\n compressionQuality: 50\r\n crunchedCompression: 0\r\n allowsAlphaSplitting: 0\r\n overridden: 0\r\n ignorePlatformSupport: 0\r\n androidETC2FallbackOverride: 0\r\n forceMaximumCompressionQuality_BC6H_BC7: 0\r\n spriteSheet:\r\n serializedVersion: 2\r\n sprites: []\r\n outline: []\r\n physicsShape: []\r\n bones: []\r\n spriteID: 5e97eb03825dee720800000000000000\r\n internalID: 0\r\n vertices: []\r\n indices: \r\n edges: []\r\n weights: []\r\n secondaryTextures: []\r\n nameFileIdTable: {}\r\n mipmapLimitGroupName: \r\n pSDRemoveMatte: 0\r\n userData: \r\n assetBundleName: \r\n assetBundleVariant: \r\n");
// Byte[] bytes1 = Encoding.UTF8.GetBytes("fileFormatVersion: 2\r\nguid: 54ac8b67ea1f6f14892bd14ea1caab62\r\nTextureImporter:\r\n internalIDToNameTable: []\r\n externalObjects: {}\r\n serializedVersion: 12\r\n mipmaps:\r\n mipMapMode: 0\r\n enableMipMap: 0\r\n sRGBTexture: 1\r\n linearTexture: 0\r\n fadeOut: 0\r\n borderMipMap: 0\r\n mipMapsPreserveCoverage: 0\r\n alphaTestReferenceValue: 0.5\r\n mipMapFadeDistanceStart: 1\r\n mipMapFadeDistanceEnd: 3\r\n bumpmap:\r\n convertToNormalMap: 0\r\n externalNormalMap: 0\r\n heightScale: 0.25\r\n normalMapFilter: 0\r\n flipGreenChannel: 0\r\n isReadable: 0\r\n streamingMipmaps: 0\r\n streamingMipmapsPriority: 0\r\n vTOnly: 0\r\n ignoreMipmapLimit: 0\r\n grayScaleToAlpha: 0\r\n generateCubemap: 6\r\n cubemapConvolution: 0\r\n seamlessCubemap: 0\r\n textureFormat: 1\r\n maxTextureSize: 2048\r\n textureSettings:\r\n serializedVersion: 2\r\n filterMode: 1\r\n aniso: 1\r\n mipBias: 0\r\n wrapU: 1\r\n wrapV: 1\r\n wrapW: 1\r\n nPOTScale: 0\r\n lightmap: 0\r\n compressionQuality: 50\r\n spriteMode: 1\r\n spriteExtrude: 1\r\n spriteMeshType: 1\r\n alignment: 0\r\n spritePivot: {x: 0.5, y: 0.5}\r\n spritePixelsToUnits: 1\r\n spriteBorder: {x: 0, y: 0, z: 0, w: 0}\r\n spriteGenerateFallbackPhysicsShape: 1\r\n alphaUsage: 1\r\n alphaIsTransparency: 1\r\n spriteTessellationDetail: -1\r\n textureType: 8\r\n textureShape: 1\r\n singleChannelComponent: 0\r\n flipbookRows: 1\r\n flipbookColumns: 1\r\n maxTextureSizeSet: 0\r\n compressionQualitySet: 0\r\n textureFormatSet: 0\r\n ignorePngGamma: 0\r\n applyGammaDecoding: 0\r\n swizzle: 50462976\r\n cookieLightType: 0\r\n platformSettings:\r\n - serializedVersion: 3\r\n buildTarget: DefaultTexturePlatform\r\n maxTextureSize: 2048\r\n resizeAlgorithm: 0\r\n textureFormat: -1\r\n textureCompression: 1\r\n compressionQuality: 50\r\n crunchedCompression: 0\r\n allowsAlphaSplitting: 0\r\n overridden: 0\r\n ignorePlatformSupport: 0\r\n androidETC2FallbackOverride: 0\r\n forceMaximumCompressionQuality_BC6H_BC7: 0\r\n - serializedVersion: 3\r\n buildTarget: Standalone\r\n maxTextureSize: 2048\r\n resizeAlgorithm: 0\r\n textureFormat: -1\r\n textureCompression: 1\r\n compressionQuality: 50\r\n crunchedCompression: 0\r\n allowsAlphaSplitting: 0\r\n overridden: 0\r\n ignorePlatformSupport: 0\r\n androidETC2FallbackOverride: 0\r\n forceMaximumCompressionQuality_BC6H_BC7: 0\r\n - serializedVersion: 3\r\n buildTarget: Server\r\n maxTextureSize: 2048\r\n resizeAlgorithm: 0\r\n textureFormat: -1\r\n textureCompression: 1\r\n compressionQuality: 50\r\n crunchedCompression: 0\r\n allowsAlphaSplitting: 0\r\n overridden: 0\r\n ignorePlatformSupport: 0\r\n androidETC2FallbackOverride: 0\r\n forceMaximumCompressionQuality_BC6H_BC7: 0\r\n - serializedVersion: 3\r\n buildTarget: Android\r\n maxTextureSize: 2048\r\n resizeAlgorithm: 0\r\n textureFormat: -1\r\n textureCompression: 1\r\n compressionQuality: 50\r\n crunchedCompression: 0\r\n allowsAlphaSplitting: 0\r\n overridden: 0\r\n ignorePlatformSupport: 0\r\n androidETC2FallbackOverride: 0\r\n forceMaximumCompressionQuality_BC6H_BC7: 0\r\n spriteSheet:\r\n serializedVersion: 2\r\n sprites: []\r\n outline: []\r\n physicsShape: []\r\n bones: []\r\n spriteID: 5e97eb03825dee720800000000000000\r\n internalID: 0\r\n vertices: []\r\n indices: \r\n edges: []\r\n weights: []\r\n secondaryTextures: []\r\n nameFileIdTable: {}\r\n mipmapLimitGroupName: \r\n pSDRemoveMatte: 0\r\n userData: \r\n assetBundleName: \r\n assetBundleVariant: \r\n");
// utilsTools.saveByteToPath(bytes1, "Resources/rand__temp__text_localFile.png.meta");
// utilsTools.saveByteToPath(bytes1, "Resources/rand__temp__text_localFile.png.meta");
//// utilsTools.loadLocalImage(this, image0, "Resources/rand__temp__text_localFile.png");
//// utilsTools.loadLocalImage(this, image0, "Resources/rand__temp__text_localFile.png");
////
print
("替换纹理End");
////
Debug.Log
("替换纹理End");
////}
////}
////private Vector2 ScreenToUILocalPos(RectTransform transform, Vector2 mousePos, Camera canvasCam = null)
////private Vector2 ScreenToUILocalPos(RectTransform transform, Vector2 mousePos, Camera canvasCam = null)
////{
////{
...
...
Assets/scripts/utils/TaskManages.cs
View file @
f3192eda
...
@@ -2,6 +2,7 @@ using System;
...
@@ -2,6 +2,7 @@ using System;
using
System.Collections
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine
;
using
static
UnityEngine
.
ParticleSystem
;
public
class
TaskManages
public
class
TaskManages
{
{
...
@@ -14,6 +15,22 @@ public class TaskManages
...
@@ -14,6 +15,22 @@ public class TaskManages
{
{
return
instance
;
return
instance
;
}
}
//priorityStack
//内部是栈维护 当栈空的时候才会继续执行队列Queue中的任务
public
void
insertTask
(
MonoBehaviour
monoBehaviour
,
TaskItemBack
taskItemBack
,
System
.
Object
[]
allparams
)
{
Stack
<
Tuple
<
TaskItemBack
,
System
.
Object
[
]>
>
taskInfos
;
if
(
utilsTools
.
ContainsKey
(
monoBehaviour
.
gameObject
,
"PriorityStack"
)
==
false
)
utilsTools
.
getUserData
<
Stack
<
Tuple
<
TaskItemBack
,
System
.
Object
[
]>
>>(
monoBehaviour
.
gameObject
,
"PriorityStack"
,
out
taskInfos
,
new
Stack
<
Tuple
<
TaskItemBack
,
System
.
Object
[
]>
>());
else
utilsTools
.
getUserData
<
Stack
<
Tuple
<
TaskItemBack
,
System
.
Object
[
]>
>>(
monoBehaviour
.
gameObject
,
"PriorityStack"
,
out
taskInfos
,
null
);
utilsTools
.
setUserData
(
monoBehaviour
.
gameObject
,
"PriorityStack"
,
taskInfos
);
}
public
void
insertTask
(
MonoBehaviour
monoBehaviour
,
TaskItemBack
taskItemBack
,
System
.
Object
param1
=
null
,
System
.
Object
param2
=
null
)
{
System
.
Object
[]
allparams
=
{
param1
,
param2
};
insertTask
(
monoBehaviour
,
taskItemBack
,
allparams
);
}
public
void
addTask
(
MonoBehaviour
monoBehaviour
,
TaskItemBack
taskItemBack
,
System
.
Object
param
=
null
)
public
void
addTask
(
MonoBehaviour
monoBehaviour
,
TaskItemBack
taskItemBack
,
System
.
Object
param
=
null
)
{
{
System
.
Object
[]
allparams
=
{
param
};
System
.
Object
[]
allparams
=
{
param
};
...
@@ -29,17 +46,37 @@ public class TaskManages
...
@@ -29,17 +46,37 @@ public class TaskManages
taskInfos
.
Enqueue
(
new
Tuple
<
TaskItemBack
,
object
[
]>
(
taskItemBack
,
allparams
));
taskInfos
.
Enqueue
(
new
Tuple
<
TaskItemBack
,
object
[
]>
(
taskItemBack
,
allparams
));
utilsTools
.
setUserData
(
monoBehaviour
.
gameObject
,
"TaskList"
,
taskInfos
);
utilsTools
.
setUserData
(
monoBehaviour
.
gameObject
,
"TaskList"
,
taskInfos
);
}
}
private
Tuple
<
TaskItemBack
,
System
.
Object
[
]>
getTask
(
MonoBehaviour
monoBehaviour
)
{
Tuple
<
TaskItemBack
,
System
.
Object
[
]>
ret
=
null
;
if
(
utilsTools
.
ContainsKey
(
monoBehaviour
.
gameObject
,
"PriorityStack"
)
==
true
)
{
Stack
<
Tuple
<
TaskItemBack
,
System
.
Object
[
]>
>
taskStackInfos
=
null
;
utilsTools
.
getUserData
<
Stack
<
Tuple
<
TaskItemBack
,
System
.
Object
[
]>
>>(
monoBehaviour
.
gameObject
,
"PriorityStack"
,
out
taskStackInfos
,
null
);
if
(
taskStackInfos
.
Count
>
0
)
{
ret
=
taskStackInfos
.
Pop
();
utilsTools
.
setUserData
(
monoBehaviour
.
gameObject
,
"PriorityStack"
,
taskStackInfos
);
}
}
if
(
ret
==
null
)
{
Queue
<
Tuple
<
TaskItemBack
,
System
.
Object
[
]>
>
taskInfos
;
if
(
utilsTools
.
ContainsKey
(
monoBehaviour
.
gameObject
,
"TaskList"
)
==
false
)
return
null
;
else
utilsTools
.
getUserData
<
Queue
<
Tuple
<
TaskItemBack
,
System
.
Object
[
]>
>>(
monoBehaviour
.
gameObject
,
"TaskList"
,
out
taskInfos
,
null
);
if
(
taskInfos
.
Count
==
0
)
return
null
;
ret
=
taskInfos
.
Dequeue
();
utilsTools
.
setUserData
(
monoBehaviour
.
gameObject
,
"TaskList"
,
taskInfos
);
}
return
ret
;
}
public
bool
updateTask
(
MonoBehaviour
monoBehaviour
)
public
bool
updateTask
(
MonoBehaviour
monoBehaviour
)
{
{
Queue
<
Tuple
<
TaskItemBack
,
System
.
Object
[
]>
>
taskInfos
;
var
task
=
getTask
(
monoBehaviour
);
if
(
utilsTools
.
ContainsKey
(
monoBehaviour
.
gameObject
,
"TaskList"
)
==
false
)
if
(
task
==
null
)
return
false
;
return
false
;
task
.
Item1
(
task
.
Item2
);
else
utilsTools
.
getUserData
<
Queue
<
Tuple
<
TaskItemBack
,
System
.
Object
[
]>
>>(
monoBehaviour
.
gameObject
,
"TaskList"
,
out
taskInfos
,
null
);
if
(
taskInfos
.
Count
==
0
)
return
false
;
var
first
=
taskInfos
.
Dequeue
();
utilsTools
.
setUserData
(
monoBehaviour
.
gameObject
,
"TaskList"
,
taskInfos
);
first
.
Item1
(
first
.
Item2
);
return
true
;
return
true
;
}
}
public
int
taskSize
(
MonoBehaviour
monoBehaviour
)
public
int
taskSize
(
MonoBehaviour
monoBehaviour
)
...
...
Assets/scripts/utils/utilsTools.cs
View file @
f3192eda
...
@@ -477,7 +477,6 @@ public class utilsTools
...
@@ -477,7 +477,6 @@ public class utilsTools
{
{
Directory
.
CreateDirectory
(
path1
);
Directory
.
CreateDirectory
(
path1
);
}
}
}
}
}
}
Logs/shadercompiler-UnityShaderCompiler.exe0.log
View file @
f3192eda
Base path: 'C:/Program Files/Unity/Hub/Editor/2022.3.1f1c1/Editor/Data', plugins path 'C:/Program Files/Unity/Hub/Editor/2022.3.1f1c1/Editor/Data/PlaybackEngines'
Base path: 'C:/Program Files/Unity/Hub/Editor/2022.3.1f1c1/Editor/Data', plugins path 'C:/Program Files/Unity/Hub/Editor/2022.3.1f1c1/Editor/Data/PlaybackEngines'
Cmd: initializeCompiler
Cmd: initializeCompiler
Cmd: shutdown
Quitting shader compiler process
UserSettings/Layouts/default-2022.dwlt
View file @
f3192eda
...
@@ -15,11 +15,11 @@ MonoBehaviour:
...
@@ -15,11 +15,11 @@ MonoBehaviour:
m_PixelRect
:
m_PixelRect
:
serializedVersion
:
2
serializedVersion
:
2
x
:
7.2000003
x
:
7.2000003
y
:
50.4
y
:
104.8
width
:
2033.6
width
:
2033.6
height
:
10
54.4
height
:
10
00
m_ShowMode
:
4
m_ShowMode
:
4
m_Title
:
"
\u6E38\u620F
"
m_Title
:
Game
m_RootView
:
{
fileID
:
9
}
m_RootView
:
{
fileID
:
9
}
m_MinSize
:
{
x
:
875
,
y
:
300
}
m_MinSize
:
{
x
:
875
,
y
:
300
}
m_MaxSize
:
{
x
:
10000
,
y
:
10000
}
m_MaxSize
:
{
x
:
10000
,
y
:
10000
}
...
@@ -40,9 +40,9 @@ MonoBehaviour:
...
@@ -40,9 +40,9 @@ MonoBehaviour:
m_Position
:
m_Position
:
serializedVersion
:
2
serializedVersion
:
2
x
:
0
x
:
0
y
:
387
.2
y
:
619
.2
width
:
507.20007
width
:
317.6001
height
:
617.2
height
:
330.8
m_MinSize
:
{
x
:
232
,
y
:
271
}
m_MinSize
:
{
x
:
232
,
y
:
271
}
m_MaxSize
:
{
x
:
10002
,
y
:
10021
}
m_MaxSize
:
{
x
:
10002
,
y
:
10021
}
m_ActualView
:
{
fileID
:
13
}
m_ActualView
:
{
fileID
:
13
}
...
@@ -67,14 +67,14 @@ MonoBehaviour:
...
@@ -67,14 +67,14 @@ MonoBehaviour:
-
{
fileID
:
2
}
-
{
fileID
:
2
}
m_Position
:
m_Position
:
serializedVersion
:
2
serializedVersion
:
2
x
:
1
197.6
x
:
1
463.2
y
:
0
y
:
0
width
:
507.20007
width
:
317.6001
height
:
1004.4
height
:
950
m_MinSize
:
{
x
:
100
,
y
:
100
}
m_MinSize
:
{
x
:
100
,
y
:
100
}
m_MaxSize
:
{
x
:
8096
,
y
:
16192
}
m_MaxSize
:
{
x
:
8096
,
y
:
16192
}
vertical
:
1
vertical
:
1
controlID
:
142
controlID
:
63
---
!u!114
&4
---
!u!114
&4
MonoBehaviour
:
MonoBehaviour
:
m_ObjectHideFlags
:
52
m_ObjectHideFlags
:
52
...
@@ -85,23 +85,23 @@ MonoBehaviour:
...
@@ -85,23 +85,23 @@ MonoBehaviour:
m_Enabled
:
1
m_Enabled
:
1
m_EditorHideFlags
:
0
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
12006
,
guid
:
0000000000000000e000000000000000
,
type
:
0
}
m_Script
:
{
fileID
:
12006
,
guid
:
0000000000000000e000000000000000
,
type
:
0
}
m_Name
:
SceneHierarchy
Window
m_Name
:
Console
Window
m_EditorClassIdentifier
:
m_EditorClassIdentifier
:
m_Children
:
[]
m_Children
:
[]
m_Position
:
m_Position
:
serializedVersion
:
2
serializedVersion
:
2
x
:
0
x
:
0
y
:
0
y
:
0
width
:
507.20007
width
:
317.6001
height
:
387
.2
height
:
619
.2
m_MinSize
:
{
x
:
200
,
y
:
200
}
m_MinSize
:
{
x
:
102
,
y
:
121
}
m_MaxSize
:
{
x
:
400
0
,
y
:
4000
}
m_MaxSize
:
{
x
:
400
2
,
y
:
4021
}
m_ActualView
:
{
fileID
:
1
5
}
m_ActualView
:
{
fileID
:
1
7
}
m_Panes
:
m_Panes
:
-
{
fileID
:
15
}
-
{
fileID
:
15
}
-
{
fileID
:
17
}
-
{
fileID
:
17
}
m_Selected
:
0
m_Selected
:
1
m_LastSelected
:
1
m_LastSelected
:
0
---
!u!114
&5
---
!u!114
&5
MonoBehaviour
:
MonoBehaviour
:
m_ObjectHideFlags
:
52
m_ObjectHideFlags
:
52
...
@@ -117,10 +117,10 @@ MonoBehaviour:
...
@@ -117,10 +117,10 @@ MonoBehaviour:
m_Children
:
[]
m_Children
:
[]
m_Position
:
m_Position
:
serializedVersion
:
2
serializedVersion
:
2
x
:
711.2
x
:
569.6
y
:
0
y
:
0
width
:
486.3999
6
width
:
893.
6
height
:
1004.4
height
:
950
m_MinSize
:
{
x
:
202
,
y
:
221
}
m_MinSize
:
{
x
:
202
,
y
:
221
}
m_MaxSize
:
{
x
:
4002
,
y
:
4021
}
m_MaxSize
:
{
x
:
4002
,
y
:
4021
}
m_ActualView
:
{
fileID
:
16
}
m_ActualView
:
{
fileID
:
16
}
...
@@ -148,12 +148,12 @@ MonoBehaviour:
...
@@ -148,12 +148,12 @@ MonoBehaviour:
serializedVersion
:
2
serializedVersion
:
2
x
:
0
x
:
0
y
:
0
y
:
0
width
:
17
04
.8
width
:
17
80
.8
height
:
1004.4
height
:
950
m_MinSize
:
{
x
:
300
,
y
:
100
}
m_MinSize
:
{
x
:
300
,
y
:
100
}
m_MaxSize
:
{
x
:
24288
,
y
:
16192
}
m_MaxSize
:
{
x
:
24288
,
y
:
16192
}
vertical
:
0
vertical
:
0
controlID
:
45
controlID
:
62
---
!u!114
&7
---
!u!114
&7
MonoBehaviour
:
MonoBehaviour
:
m_ObjectHideFlags
:
52
m_ObjectHideFlags
:
52
...
@@ -174,11 +174,11 @@ MonoBehaviour:
...
@@ -174,11 +174,11 @@ MonoBehaviour:
x
:
0
x
:
0
y
:
30
y
:
30
width
:
2033.6
width
:
2033.6
height
:
1004.4
height
:
950
m_MinSize
:
{
x
:
400
,
y
:
100
}
m_MinSize
:
{
x
:
400
,
y
:
100
}
m_MaxSize
:
{
x
:
32384
,
y
:
16192
}
m_MaxSize
:
{
x
:
32384
,
y
:
16192
}
vertical
:
0
vertical
:
0
controlID
:
44
controlID
:
61
---
!u!114
&8
---
!u!114
&8
MonoBehaviour
:
MonoBehaviour
:
m_ObjectHideFlags
:
52
m_ObjectHideFlags
:
52
...
@@ -194,10 +194,10 @@ MonoBehaviour:
...
@@ -194,10 +194,10 @@ MonoBehaviour:
m_Children
:
[]
m_Children
:
[]
m_Position
:
m_Position
:
serializedVersion
:
2
serializedVersion
:
2
x
:
17
04
.8
x
:
17
80
.8
y
:
0
y
:
0
width
:
328
.79993
width
:
252
.79993
height
:
1004.4
height
:
950
m_MinSize
:
{
x
:
276
,
y
:
71
}
m_MinSize
:
{
x
:
276
,
y
:
71
}
m_MaxSize
:
{
x
:
4001
,
y
:
4021
}
m_MaxSize
:
{
x
:
4001
,
y
:
4021
}
m_ActualView
:
{
fileID
:
14
}
m_ActualView
:
{
fileID
:
14
}
...
@@ -226,7 +226,7 @@ MonoBehaviour:
...
@@ -226,7 +226,7 @@ MonoBehaviour:
x
:
0
x
:
0
y
:
0
y
:
0
width
:
2033.6
width
:
2033.6
height
:
10
54.4
height
:
10
00
m_MinSize
:
{
x
:
875
,
y
:
300
}
m_MinSize
:
{
x
:
875
,
y
:
300
}
m_MaxSize
:
{
x
:
10000
,
y
:
10000
}
m_MaxSize
:
{
x
:
10000
,
y
:
10000
}
m_UseTopView
:
1
m_UseTopView
:
1
...
@@ -271,7 +271,7 @@ MonoBehaviour:
...
@@ -271,7 +271,7 @@ MonoBehaviour:
m_Position
:
m_Position
:
serializedVersion
:
2
serializedVersion
:
2
x
:
0
x
:
0
y
:
1034.4
y
:
980
width
:
2033.6
width
:
2033.6
height
:
20
height
:
20
m_MinSize
:
{
x
:
0
,
y
:
0
}
m_MinSize
:
{
x
:
0
,
y
:
0
}
...
@@ -293,8 +293,8 @@ MonoBehaviour:
...
@@ -293,8 +293,8 @@ MonoBehaviour:
serializedVersion
:
2
serializedVersion
:
2
x
:
0
x
:
0
y
:
0
y
:
0
width
:
711.2
width
:
569.6
height
:
1004.4
height
:
950
m_MinSize
:
{
x
:
201
,
y
:
221
}
m_MinSize
:
{
x
:
201
,
y
:
221
}
m_MaxSize
:
{
x
:
4001
,
y
:
4021
}
m_MaxSize
:
{
x
:
4001
,
y
:
4021
}
m_ActualView
:
{
fileID
:
18
}
m_ActualView
:
{
fileID
:
18
}
...
@@ -317,15 +317,15 @@ MonoBehaviour:
...
@@ -317,15 +317,15 @@ MonoBehaviour:
m_MinSize
:
{
x
:
230
,
y
:
250
}
m_MinSize
:
{
x
:
230
,
y
:
250
}
m_MaxSize
:
{
x
:
10000
,
y
:
10000
}
m_MaxSize
:
{
x
:
10000
,
y
:
10000
}
m_TitleContent
:
m_TitleContent
:
m_Text
:
"
\u9879\u76EE
"
m_Text
:
Project
m_Image
:
{
fileID
:
-5179483145760003458
,
guid
:
0000000000000000d000000000000000
,
type
:
0
}
m_Image
:
{
fileID
:
-5179483145760003458
,
guid
:
0000000000000000d000000000000000
,
type
:
0
}
m_Tooltip
:
m_Tooltip
:
m_Pos
:
m_Pos
:
serializedVersion
:
2
serializedVersion
:
2
x
:
1
204.8
x
:
1
470.4
y
:
468
y
:
754.4
width
:
505.20007
width
:
315.6001
height
:
596.2
height
:
309.8
m_SerializedDataModeController
:
m_SerializedDataModeController
:
m_DataMode
:
0
m_DataMode
:
0
m_PreferredDataMode
:
0
m_PreferredDataMode
:
0
...
@@ -341,8 +341,6 @@ MonoBehaviour:
...
@@ -341,8 +341,6 @@ MonoBehaviour:
m_ClassNames
:
[]
m_ClassNames
:
[]
m_AssetLabels
:
[]
m_AssetLabels
:
[]
m_AssetBundleNames
:
[]
m_AssetBundleNames
:
[]
m_VersionControlStates
:
[]
m_SoftLockControlStates
:
[]
m_ReferencingInstanceIDs
:
m_ReferencingInstanceIDs
:
m_SceneHandles
:
m_SceneHandles
:
m_ShowAllHits
:
0
m_ShowAllHits
:
0
...
@@ -365,7 +363,7 @@ MonoBehaviour:
...
@@ -365,7 +363,7 @@ MonoBehaviour:
scrollPos
:
{
x
:
0
,
y
:
0
}
scrollPos
:
{
x
:
0
,
y
:
0
}
m_SelectedIDs
:
f0660000
m_SelectedIDs
:
f0660000
m_LastClickedID
:
26352
m_LastClickedID
:
26352
m_ExpandedIDs
:
00000000
386400003a6400003c6400003e6400004064000042640000446400004664000048
640000
m_ExpandedIDs
:
00000000
126300003263000030640000326400003464000036640000386400003a6400003c6400003e64000040640000426400004464000046640000486400004a
640000
m_RenameOverlay
:
m_RenameOverlay
:
m_UserAcceptedRename
:
0
m_UserAcceptedRename
:
0
m_Name
:
m_Name
:
...
@@ -390,10 +388,10 @@ MonoBehaviour:
...
@@ -390,10 +388,10 @@ MonoBehaviour:
m_Icon
:
{
fileID
:
0
}
m_Icon
:
{
fileID
:
0
}
m_ResourceFile
:
m_ResourceFile
:
m_AssetTreeState
:
m_AssetTreeState
:
scrollPos
:
{
x
:
0
,
y
:
0
}
scrollPos
:
{
x
:
0
,
y
:
1216.2
}
m_SelectedIDs
:
m_SelectedIDs
:
m_LastClickedID
:
0
m_LastClickedID
:
0
m_ExpandedIDs
:
ffffffff00000000
386400003a6400003c6400003e640000406400004264000044640000466400004864000088
640000
m_ExpandedIDs
:
ffffffff00000000
126300003263000030640000326400003464000036640000386400003a6400003c6400003e64000040640000426400004464000046640000486400004a
640000
m_RenameOverlay
:
m_RenameOverlay
:
m_UserAcceptedRename
:
0
m_UserAcceptedRename
:
0
m_Name
:
m_Name
:
...
@@ -464,15 +462,15 @@ MonoBehaviour:
...
@@ -464,15 +462,15 @@ MonoBehaviour:
m_MinSize
:
{
x
:
275
,
y
:
50
}
m_MinSize
:
{
x
:
275
,
y
:
50
}
m_MaxSize
:
{
x
:
4000
,
y
:
4000
}
m_MaxSize
:
{
x
:
4000
,
y
:
4000
}
m_TitleContent
:
m_TitleContent
:
m_Text
:
"
\u68C0\u67E5\u5668
"
m_Text
:
Inspector
m_Image
:
{
fileID
:
-440750813802333266
,
guid
:
0000000000000000d000000000000000
,
type
:
0
}
m_Image
:
{
fileID
:
-440750813802333266
,
guid
:
0000000000000000d000000000000000
,
type
:
0
}
m_Tooltip
:
m_Tooltip
:
m_Pos
:
m_Pos
:
serializedVersion
:
2
serializedVersion
:
2
x
:
17
12
x
:
17
88
y
:
80.8
y
:
135.2
width
:
327
.79993
width
:
251
.79993
height
:
9
83.4
height
:
9
29
m_SerializedDataModeController
:
m_SerializedDataModeController
:
m_DataMode
:
0
m_DataMode
:
0
m_PreferredDataMode
:
0
m_PreferredDataMode
:
0
...
@@ -511,15 +509,15 @@ MonoBehaviour:
...
@@ -511,15 +509,15 @@ MonoBehaviour:
m_MinSize
:
{
x
:
200
,
y
:
200
}
m_MinSize
:
{
x
:
200
,
y
:
200
}
m_MaxSize
:
{
x
:
4000
,
y
:
4000
}
m_MaxSize
:
{
x
:
4000
,
y
:
4000
}
m_TitleContent
:
m_TitleContent
:
m_Text
:
"
\u5C42\u7EA7
"
m_Text
:
Hierarchy
m_Image
:
{
fileID
:
-3734745235275155857
,
guid
:
0000000000000000d000000000000000
,
type
:
0
}
m_Image
:
{
fileID
:
-3734745235275155857
,
guid
:
0000000000000000d000000000000000
,
type
:
0
}
m_Tooltip
:
m_Tooltip
:
m_Pos
:
m_Pos
:
serializedVersion
:
2
serializedVersion
:
2
x
:
1
204.8
x
:
1
470.4
y
:
80.8
y
:
135.2
width
:
505.20007
width
:
315.6001
height
:
366
.2
height
:
598
.2
m_SerializedDataModeController
:
m_SerializedDataModeController
:
m_DataMode
:
0
m_DataMode
:
0
m_PreferredDataMode
:
0
m_PreferredDataMode
:
0
...
@@ -535,7 +533,7 @@ MonoBehaviour:
...
@@ -535,7 +533,7 @@ MonoBehaviour:
scrollPos
:
{
x
:
0
,
y
:
0
}
scrollPos
:
{
x
:
0
,
y
:
0
}
m_SelectedIDs
:
m_SelectedIDs
:
m_LastClickedID
:
0
m_LastClickedID
:
0
m_ExpandedIDs
:
78efffff7aefffff7cefffff84efffff86f5ffff8ef5ffff9cf5ffffb0f5fffff8f9ffff4c620000ba620000ce620000
m_ExpandedIDs
:
34dbfeff7cdbfeffe8ddfeff02defeff36defeff8adefeff92defeffa0defeffb2defeffe6f9ffff
m_RenameOverlay
:
m_RenameOverlay
:
m_UserAcceptedRename
:
0
m_UserAcceptedRename
:
0
m_Name
:
m_Name
:
...
@@ -574,15 +572,15 @@ MonoBehaviour:
...
@@ -574,15 +572,15 @@ MonoBehaviour:
m_MinSize
:
{
x
:
200
,
y
:
200
}
m_MinSize
:
{
x
:
200
,
y
:
200
}
m_MaxSize
:
{
x
:
4000
,
y
:
4000
}
m_MaxSize
:
{
x
:
4000
,
y
:
4000
}
m_TitleContent
:
m_TitleContent
:
m_Text
:
"
\u573A\u666F
"
m_Text
:
Scene
m_Image
:
{
fileID
:
8634526014445323508
,
guid
:
0000000000000000d000000000000000
,
type
:
0
}
m_Image
:
{
fileID
:
8634526014445323508
,
guid
:
0000000000000000d000000000000000
,
type
:
0
}
m_Tooltip
:
m_Tooltip
:
m_Pos
:
m_Pos
:
serializedVersion
:
2
serializedVersion
:
2
x
:
718.4
x
:
576.8
y
:
80.8
y
:
135.2
width
:
484.3999
6
width
:
891.
6
height
:
9
83.4
height
:
9
29
m_SerializedDataModeController
:
m_SerializedDataModeController
:
m_DataMode
:
0
m_DataMode
:
0
m_PreferredDataMode
:
0
m_PreferredDataMode
:
0
...
@@ -928,9 +926,9 @@ MonoBehaviour:
...
@@ -928,9 +926,9 @@ MonoBehaviour:
m_PlayAudio
:
0
m_PlayAudio
:
0
m_AudioPlay
:
0
m_AudioPlay
:
0
m_Position
:
m_Position
:
m_Target
:
{
x
:
4
34.2745
,
y
:
673.83057
,
z
:
-0.014899037
}
m_Target
:
{
x
:
4
58.518
,
y
:
1234.1746
,
z
:
-0.11622809
}
speed
:
2
speed
:
2
m_Value
:
{
x
:
4
34.2745
,
y
:
673.83057
,
z
:
-0.014899037
}
m_Value
:
{
x
:
4
58.518
,
y
:
1234.1746
,
z
:
-0.11622809
}
m_RenderMode
:
0
m_RenderMode
:
0
m_CameraMode
:
m_CameraMode
:
drawMode
:
0
drawMode
:
0
...
@@ -980,9 +978,9 @@ MonoBehaviour:
...
@@ -980,9 +978,9 @@ MonoBehaviour:
speed
:
2
speed
:
2
m_Value
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_Value
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_Size
:
m_Size
:
m_Target
:
5
51.7607
4
m_Target
:
5
76.7120
4
speed
:
2
speed
:
2
m_Value
:
5
51.7607
4
m_Value
:
5
76.7120
4
m_Ortho
:
m_Ortho
:
m_Target
:
1
m_Target
:
1
speed
:
2
speed
:
2
...
@@ -1022,15 +1020,15 @@ MonoBehaviour:
...
@@ -1022,15 +1020,15 @@ MonoBehaviour:
m_MinSize
:
{
x
:
100
,
y
:
100
}
m_MinSize
:
{
x
:
100
,
y
:
100
}
m_MaxSize
:
{
x
:
4000
,
y
:
4000
}
m_MaxSize
:
{
x
:
4000
,
y
:
4000
}
m_TitleContent
:
m_TitleContent
:
m_Text
:
"
\u63A7\u5236\u53F0
"
m_Text
:
Console
m_Image
:
{
fileID
:
-4950941429401207979
,
guid
:
0000000000000000d000000000000000
,
type
:
0
}
m_Image
:
{
fileID
:
-4950941429401207979
,
guid
:
0000000000000000d000000000000000
,
type
:
0
}
m_Tooltip
:
m_Tooltip
:
m_Pos
:
m_Pos
:
serializedVersion
:
2
serializedVersion
:
2
x
:
1
204.8
x
:
1
470.4
y
:
80.8
y
:
135.2
width
:
505.20007
width
:
315.6001
height
:
366
.2
height
:
598
.2
m_SerializedDataModeController
:
m_SerializedDataModeController
:
m_DataMode
:
0
m_DataMode
:
0
m_PreferredDataMode
:
0
m_PreferredDataMode
:
0
...
@@ -1056,15 +1054,15 @@ MonoBehaviour:
...
@@ -1056,15 +1054,15 @@ MonoBehaviour:
m_MinSize
:
{
x
:
200
,
y
:
200
}
m_MinSize
:
{
x
:
200
,
y
:
200
}
m_MaxSize
:
{
x
:
4000
,
y
:
4000
}
m_MaxSize
:
{
x
:
4000
,
y
:
4000
}
m_TitleContent
:
m_TitleContent
:
m_Text
:
"
\u6E38\u620F
"
m_Text
:
Game
m_Image
:
{
fileID
:
4621777727084837110
,
guid
:
0000000000000000d000000000000000
,
type
:
0
}
m_Image
:
{
fileID
:
4621777727084837110
,
guid
:
0000000000000000d000000000000000
,
type
:
0
}
m_Tooltip
:
m_Tooltip
:
m_Pos
:
m_Pos
:
serializedVersion
:
2
serializedVersion
:
2
x
:
7.2000003
x
:
7.2000003
y
:
80.8
y
:
135.2
width
:
710.2
width
:
568.6
height
:
9
83.4
height
:
9
29
m_SerializedDataModeController
:
m_SerializedDataModeController
:
m_DataMode
:
0
m_DataMode
:
0
m_PreferredDataMode
:
0
m_PreferredDataMode
:
0
...
@@ -1107,7 +1105,7 @@ MonoBehaviour:
...
@@ -1107,7 +1105,7 @@ MonoBehaviour:
m_VAllowExceedBaseRangeMin
:
1
m_VAllowExceedBaseRangeMin
:
1
m_VAllowExceedBaseRangeMax
:
1
m_VAllowExceedBaseRangeMax
:
1
m_ScaleWithWindow
:
0
m_ScaleWithWindow
:
0
m_HSlider
:
1
m_HSlider
:
0
m_VSlider
:
1
m_VSlider
:
1
m_IgnoreScrollWheelUntilClicked
:
0
m_IgnoreScrollWheelUntilClicked
:
0
m_EnableMouseInput
:
1
m_EnableMouseInput
:
1
...
@@ -1119,23 +1117,23 @@ MonoBehaviour:
...
@@ -1119,23 +1117,23 @@ MonoBehaviour:
serializedVersion
:
2
serializedVersion
:
2
x
:
0
x
:
0
y
:
21
y
:
21
width
:
710.2
width
:
568.6
height
:
9
62.4
height
:
9
08
m_Scale
:
{
x
:
1.2576778
,
y
:
1.2576778
}
m_Scale
:
{
x
:
0.525463
,
y
:
0.525463
}
m_Translation
:
{
x
:
331.5816
,
y
:
536.33826
}
m_Translation
:
{
x
:
284.3
,
y
:
453.99997
}
m_MarginLeft
:
0
m_MarginLeft
:
0
m_MarginRight
:
0
m_MarginRight
:
0
m_MarginTop
:
0
m_MarginTop
:
0
m_MarginBottom
:
0
m_MarginBottom
:
0
m_LastShownAreaInsideMargins
:
m_LastShownAreaInsideMargins
:
serializedVersion
:
2
serializedVersion
:
2
x
:
-
263.6459
x
:
-
541.04663
y
:
-
426.45123
y
:
-
863.9999
width
:
564.6915
width
:
1082.0933
height
:
765.21985
height
:
1727.9999
m_MinimalGUI
:
1
m_MinimalGUI
:
1
m_defaultScale
:
0.5
569444
3
m_defaultScale
:
0.5
2546
3
m_LastWindowPixelSize
:
{
x
:
887.75
,
y
:
1229
.25
}
m_LastWindowPixelSize
:
{
x
:
710.75
,
y
:
1161
.25
}
m_ClearInEditMode
:
1
m_ClearInEditMode
:
1
m_NoCameraWarning
:
1
m_NoCameraWarning
:
1
m_LowResolutionForAspectRatios
:
01000000000000000000
m_LowResolutionForAspectRatios
:
01000000000000000000
...
...
obj/Debug/Assembly-CSharp.csproj.AssemblyReference.cache
View file @
f3192eda
No preview for this file type
tsmi.db
View file @
f3192eda
No preview for this file type
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