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
6c045fb5
Commit
6c045fb5
authored
Aug 04, 2023
by
shujianhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
dcfc56ba
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
17 deletions
+68
-17
NaivtDatas.cs
Assets/scripts/Datas/NaivtDatas.cs
+30
-0
Native.cs
Assets/scripts/Views/maingame/Native.cs
+12
-1
mainGameView.cs
Assets/scripts/common/mainGameView.cs
+26
-16
No files found.
Assets/scripts/Datas/NaivtDatas.cs
View file @
6c045fb5
...
@@ -13,4 +13,34 @@ namespace Assets.scripts.Datas
...
@@ -13,4 +13,34 @@ namespace Assets.scripts.Datas
public
string
name
;
public
string
name
;
public
string
path
=
""
;
//暂时空
public
string
path
=
""
;
//暂时空
}
}
public
class
SettnigToGame
{
//{"uid":"876511","highlightId":0,"coloredPictures":0,"autoSwitch":0,"fillAnimation":0,"vibration":0}
public
string
uid
;
public
int
highlightId
=
0
;
public
int
coloredPictures
=
0
;
public
int
autoSwitch
=
0
;
public
int
fillAnimation
=
0
;
public
int
vibration
=
0
;
public
string
getHighlightId
()
{
return
highlightId
.
ToString
();
}
public
string
getColoredPictures
()
{
return
coloredPictures
.
Equals
(
0
)
?
"false"
:
"true"
;
}
public
string
getAutoSwitch
()
{
return
autoSwitch
.
Equals
(
0
)
?
"false"
:
"true"
;
}
public
string
getFillAnimation
()
{
return
fillAnimation
.
Equals
(
0
)
?
"false"
:
"true"
;
}
public
string
getVibration
()
{
return
vibration
.
Equals
(
0
)
?
"false"
:
"true"
;
}
}
}
}
Assets/scripts/Views/maingame/Native.cs
View file @
6c045fb5
using
Assets.scripts.Datas
;
using
System
;
using
System
;
using
System.Collections
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -71,6 +72,16 @@ public class Native : MonoBehaviour
...
@@ -71,6 +72,16 @@ public class Native : MonoBehaviour
SceneManager
.
LoadScene
(
utilsTools
.
getGameSceneName
());
SceneManager
.
LoadScene
(
utilsTools
.
getGameSceneName
());
}
}
void
setSettings
(
String
json
)
{
SettnigToGame
settnigToGame
=
JsonUtility
.
FromJson
<
SettnigToGame
>(
json
);
utilsTools
.
setGDataByKey
(
"auto_switch"
,
settnigToGame
.
getAutoSwitch
());
utilsTools
.
setGDataByKey
(
"vibration"
,
settnigToGame
.
getVibration
());
utilsTools
.
setGDataByKey
(
"highlight_areas"
,
settnigToGame
.
getHighlightId
());
utilsTools
.
setGDataByKey
(
"uid"
,
settnigToGame
.
uid
);
utilsTools
.
setGDataByKey
(
"fillanimation"
,
settnigToGame
.
getFillAnimation
());
}
void
onNativeHashKeyValue
(
string
json
)
void
onNativeHashKeyValue
(
string
json
)
{
{
...
...
Assets/scripts/common/mainGameView.cs
View file @
6c045fb5
...
@@ -49,9 +49,9 @@ public class mainGameView : MonoBehaviour
...
@@ -49,9 +49,9 @@ public class mainGameView : MonoBehaviour
[
SerializeField
]
[
SerializeField
]
protected
int
selectTextureIdx
=
1
;
protected
int
selectTextureIdx
=
1
;
static
protected
string
[]
allSelectTexturePaths
=
{
static
protected
string
[]
allSelectTexturePaths
=
{
"scenes/game/cells/grayCell"
,
"scenes/game/cells/buleCell"
,
"scenes/game/cells/buleCell"
,
"scenes/game/cells/gray"
,
"scenes/game/cells/gray"
,
"scenes/game/cells/grayCell"
};
};
private
ColorIndexTables
nowSelectColors
=
null
;
private
ColorIndexTables
nowSelectColors
=
null
;
public
int
SelectTextureIdx
public
int
SelectTextureIdx
...
@@ -192,19 +192,19 @@ public class mainGameView : MonoBehaviour
...
@@ -192,19 +192,19 @@ public class mainGameView : MonoBehaviour
resetSize
();
resetSize
();
onInitEndHandler
();
onInitEndHandler
();
if
(
thumbnailTexture2d
!=
null
)
{
if
(
thumbnailTexture2d
!=
null
)
{
utilsTools
.
addTimer_Update
(
gameObject
,
"shouhuThumbnailIsChange"
,
(
String
_
)
=>
//
utilsTools.addTimer_Update(gameObject, "shouhuThumbnailIsChange", (String _) =>
{
//
{
if
(
thumbnailIsChange
==
true
)
//
if (thumbnailIsChange == true)
{
//
{
thumbnailIsChange
=
false
;
//
thumbnailIsChange = false;
thumbnailTexture2d
.
SetPixels
(
allColor
[
"thumbnail"
]);
//
thumbnailTexture2d.SetPixels(allColor["thumbnail"]);
string
path
=
gameScenUseInfo
.
getLocalThumbnailPath
();
//
string path = gameScenUseInfo.getLocalThumbnailPath();
var
sltTextureSize
=
utilsTools
.
getGDataByKey
<
Vector2
>(
"sltTextureSize"
,
Vector2
.
one
);
//
var sltTextureSize = utilsTools.getGDataByKey<Vector2>("sltTextureSize", Vector2.one);
//
utilsTools.saveByteToPath(utilsTools.ScaleTexture(thumbnailTexture2d, Convert.ToInt32(sltTextureSize.x), Convert.ToInt32(sltTextureSize.y)).EncodeToJPG(), path);
//
utilsTools.saveByteToPath(utilsTools.ScaleTexture(thumbnailTexture2d, Convert.ToInt32(sltTextureSize.x), Convert.ToInt32(sltTextureSize.y)).EncodeToJPG(), path);
//
utilsTools.saveByteToPath(thumbnailTexture2d.EncodeToJPG(), path);
//
utilsTools.saveByteToPath(thumbnailTexture2d.EncodeToJPG(), path);
}
//
}
return
true
;
//
return true;
},
120
,
0
);
//
}, 120, 0);
}
}
}
}
protected
string
getSelectPathByGid
(
int
gid
)
protected
string
getSelectPathByGid
(
int
gid
)
...
@@ -1235,7 +1235,7 @@ public class mainGameView : MonoBehaviour
...
@@ -1235,7 +1235,7 @@ public class mainGameView : MonoBehaviour
}
}
protected
virtual
void
drawThumbnailByAid
(
List
<
short
>
aids
)
protected
virtual
void
drawThumbnailByAid
(
List
<
short
>
aids
)
{
{
if
(
fals
e
)
if
(
tru
e
)
{
{
TaskItemBack
taskItemBack
=
(
System
.
Object
[]
parmass
)
=>
TaskItemBack
taskItemBack
=
(
System
.
Object
[]
parmass
)
=>
{
{
...
@@ -1316,8 +1316,18 @@ public class mainGameView : MonoBehaviour
...
@@ -1316,8 +1316,18 @@ public class mainGameView : MonoBehaviour
}
}
public
void
onClear
()
public
void
onClear
()
{
{
if
(
thumbnailTexture2d
!=
null
)
if
(
thumbnailTexture2d
!=
null
)
{
{
thumbnailTexture2d
.
SetPixels
(
allColor
[
"thumbnail"
]);
string
path
=
gameScenUseInfo
.
getLocalThumbnailPath
();
var
sltTextureSize
=
new
Vector2
(
400
,
400
);
// utilsTools.getGDataByKey<Vector2>("sltTextureSize", Vector2.one);
if
(
thumbnailTexture2d
.
width
.
Equals
(
thumbnailTexture2d
.
height
)
==
false
)
{
sltTextureSize
=
new
Vector2
(
200
,
400
);
}
utilsTools
.
saveByteToPath
(
utilsTools
.
ScaleTexture
(
thumbnailTexture2d
,
Convert
.
ToInt32
(
sltTextureSize
.
x
),
Convert
.
ToInt32
(
sltTextureSize
.
y
)).
EncodeToJPG
(),
path
);
utilsTools
.
saveByteToPath
(
thumbnailTexture2d
.
EncodeToJPG
(),
path
);
Destroy
(
thumbnailTexture2d
);
Destroy
(
thumbnailTexture2d
);
thumbnailTexture2d
=
null
;
thumbnailTexture2d
=
null
;
}
}
...
...
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