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
4794eb71
Commit
4794eb71
authored
Aug 18, 2023
by
Ever
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
主逻辑
parent
8be22438
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
19 additions
and
11 deletions
+19
-11
GameEditor.cs
Assets/Editor/GameEditor.cs
+11
-0
MainData.cs
Assets/GameMgr/MainData.cs
+5
-1
jpg.jpg
Assets/Resources/cc2D9Z2w9k0evqUiCQ/jpg.jpg
+0
-0
jpg.jpg.meta
Assets/Resources/cc2D9Z2w9k0evqUiCQ/jpg.jpg.meta
+0
-0
png.png
Assets/Resources/cc2D9Z2w9k0evqUiCQ/png.png
+0
-0
png.png.meta
Assets/Resources/cc2D9Z2w9k0evqUiCQ/png.png.meta
+0
-0
gameScene.unity
Assets/Scenes/gameScene.unity
+1
-0
mainGameView.cs
Assets/scripts/common/mainGameView.cs
+2
-10
No files found.
Assets/Editor/GameEditor.cs
View file @
4794eb71
...
...
@@ -3,6 +3,7 @@ using NUnit.Framework;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Net.NetworkInformation
;
using
System.Runtime.Serialization.Formatters.Binary
;
using
UnityEditor
;
...
...
@@ -45,6 +46,16 @@ public class GameEditor
fs
.
Close
();
}
}
Color
[]
list
=
rd
.
png
.
GetPixels
(
0
);
for
(
int
i
=
0
;
i
<
list
.
Length
;
i
++)
{
if
(
list
[
i
].
a
<=
0.35f
)
{
list
[
i
]
=
Color
.
white
;
}
}
rd
.
png
.
SetPixels
(
list
);
rd
.
png
.
Apply
();
string
savePath
=
AssetDatabase
.
GetAssetPath
(
Selection
.
activeInstanceID
)
+
"/"
+
rd
.
name
+
".bin"
;
FileStream
saveFs
=
File
.
Open
(
savePath
,
FileMode
.
Create
);
...
...
Assets/GameMgr/MainData.cs
View file @
4794eb71
...
...
@@ -36,6 +36,10 @@ public class MainData : MonoBehaviour, IDragHandler, IEndDragHandler, IBeginDrag
png
=
_png
;
jpg
=
_jpg
;
json
=
_json
;
imgpng
.
sprite
=
Sprite
.
Create
(
png
,
new
Rect
(
0
,
0
,
png
.
width
,
png
.
height
),
new
Vector2
(
0.5f
,
0.5f
));
imgpng
.
GetComponent
<
RectTransform
>().
sizeDelta
=
new
Vector2
(
png
.
width
,
png
.
height
);
imgjpg
.
sprite
=
jpg
;
imgjpg
.
GetComponent
<
RectTransform
>().
sizeDelta
=
new
Vector2
(
png
.
width
,
png
.
height
);
GoOn
();
}
public
void
GoOn
()
...
...
@@ -226,7 +230,7 @@ public class MainData : MonoBehaviour, IDragHandler, IEndDragHandler, IBeginDrag
for
(
int
i
=
0
;
i
<
d
.
Length
;
i
++)
{
v_2
=
v_1
+
d
[
i
];
if
(
v_2
.
x
>=
0
&&
v_2
.
x
<
png
.
width
&&
v_2
.
y
>=
0
&&
v_2
.
y
<
png
.
height
&&
png
.
GetPixel
((
int
)
v_2
.
x
,
(
int
)
v_2
.
y
)
.
a
<=
0.35f
)
if
(
v_2
.
x
>=
0
&&
v_2
.
x
<
png
.
width
&&
v_2
.
y
>=
0
&&
v_2
.
y
<
png
.
height
&&
png
.
GetPixel
((
int
)
v_2
.
x
,
(
int
)
v_2
.
y
)
==
Color
.
white
)
{
stackVector2
.
Push
(
v_2
);
}
...
...
Assets/Resources/cc2D9Z2w9k0evqUiCQ/
cc2D9Z2w9k0evqUiCQ
.jpg
→
Assets/Resources/cc2D9Z2w9k0evqUiCQ/
jpg
.jpg
View file @
4794eb71
File moved
Assets/Resources/cc2D9Z2w9k0evqUiCQ/
cc2D9Z2w9k0evqUiCQ
.jpg.meta
→
Assets/Resources/cc2D9Z2w9k0evqUiCQ/
jpg
.jpg.meta
View file @
4794eb71
File moved
Assets/Resources/cc2D9Z2w9k0evqUiCQ/
cc2D9Z2w9k0evqUiCQ
.png
→
Assets/Resources/cc2D9Z2w9k0evqUiCQ/
png
.png
View file @
4794eb71
File moved
Assets/Resources/cc2D9Z2w9k0evqUiCQ/
cc2D9Z2w9k0evqUiCQ
.png.meta
→
Assets/Resources/cc2D9Z2w9k0evqUiCQ/
png
.png.meta
View file @
4794eb71
File moved
Assets/Scenes/gameScene.unity
View file @
4794eb71
...
...
@@ -8927,6 +8927,7 @@ MonoBehaviour:
showFontSizeMax
:
25
clickPosEff
:
{
fileID
:
5397047662947055783
,
guid
:
1765abab6384f17448d404269ec52238
,
type
:
3
}
selectTextureIdx
:
0
MrgParent
:
{
fileID
:
7418061516327095409
}
---
!u!114
&8094727572906316438
MonoBehaviour
:
m_ObjectHideFlags
:
0
...
...
Assets/scripts/common/mainGameView.cs
View file @
4794eb71
...
...
@@ -59,7 +59,6 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
private
ColorIndexTables
nowSelectColors
=
null
;
public
Transform
MrgParent
;
public
Transform
LoadingPanel
;
public
int
SelectTextureIdx
{
get
{
return
selectTextureIdx
;
}
...
...
@@ -1718,15 +1717,13 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
item
.
localRotation
=
Quaternion
.
Euler
(
0
,
0
,
0
);
item
.
localScale
=
Vector3
.
one
;
var
png
=
Resources
.
Load
<
Texture2D
>(
"cc2D9Z2w9k0evqUiCQ/
cc2D9Z2w9k0evqUiCQ
"
);
var
jpg_texture
=
Resources
.
Load
<
Texture2D
>(
"cc2D9Z2w9k0evqUiCQ/
cc2D9Z2w9k0evqUiCQ
"
);
var
png
=
Resources
.
Load
<
Texture2D
>(
"cc2D9Z2w9k0evqUiCQ/
png
"
);
var
jpg_texture
=
Resources
.
Load
<
Texture2D
>(
"cc2D9Z2w9k0evqUiCQ/
jpg
"
);
var
jpg
=
Sprite
.
Create
(
jpg_texture
,
new
Rect
(
0
,
0
,
jpg_texture
.
width
,
jpg_texture
.
height
),
new
Vector2
(
0.5f
,
0.5f
));
var
jsondata
=
getdata
();
item
.
GetComponent
<
GameMgr
>().
Init
(
png
,
jpg
,
jsondata
);
CloseLoadingPanel
();
}
...
...
@@ -1739,9 +1736,4 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
readFs
.
Close
();
return
rjd
;
}
private
void
CloseLoadingPanel
()
{
LoadingPanel
.
gameObject
.
SetActive
(
false
);
}
}
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