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
01c3aa50
Commit
01c3aa50
authored
Jul 24, 2023
by
shujianhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
关闭带参数
parent
d7386eda
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
12 deletions
+26
-12
gameSceneLogic.cs
Assets/scripts/Views/gameScene/gameSceneLogic.cs
+6
-1
Native.cs
Assets/scripts/Views/maingame/Native.cs
+20
-11
No files found.
Assets/scripts/Views/gameScene/gameSceneLogic.cs
View file @
01c3aa50
...
...
@@ -320,7 +320,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
image
.
sprite
=
sprite
;
image
.
color
=
Color
.
white
;
autoSwitchGroup
=
Boolean
.
Parse
(
utilsTools
.
getGDataByKey
<
string
>(
"auto-switch"
,
autoSwitchGroup
.
ToString
()));
//vibration = Boolean.Parse(utilsTools.getGDataByKey<string>("vibration", autoSwitchGroup.ToString()))
vibration
=
Boolean
.
Parse
(
utilsTools
.
getGDataByKey
<
string
>(
"vibration"
,
vibration
.
ToString
()));
gameShowView
.
GetComponent
<
mainGameView
>().
loadGameImgId
();
this
.
handlerLoadingPosition
(
image
);
}
...
...
@@ -518,6 +518,10 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
};
gridViewList
.
setDataNoGrid
(
groupInfos
.
Count
,
gradView
);
//震动
if
(
vibration
)
{
Handheld
.
Vibrate
();
}
if
(
nowidx
>=
0
)
{
if
(
autoSwitchGroup
==
false
)
...
...
@@ -542,6 +546,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
gameShowView
.
GetComponent
<
mainGameView
>().
onClear
();
//SceneManager.LoadScene("Scenes/MainHallGame");
utilsTools
.
setGDataByKey
(
"NativeTempData"
,
"main"
);
SceneManager
.
LoadScene
(
"Scenes/MainGame"
);
}
public
void
onTestTemp1
()
...
...
Assets/scripts/Views/maingame/Native.cs
View file @
01c3aa50
...
...
@@ -9,12 +9,10 @@ public class Native : MonoBehaviour
{
public
Text
text
;
void
appendToText
(
string
line
)
{
text
.
text
+=
line
+
"\n"
;
}
void
Start
()
{
// text.text = "test"
;
showHostMainWindow
();
string
param
=
utilsTools
.
getGDataByKey
<
string
>(
"NativeTempData"
,
"splash"
)
;
showHostMainWindow
(
param
);
Debug
.
Log
(
"UnityStart"
);
}
private
void
OnEnable
()
...
...
@@ -26,27 +24,38 @@ public class Native : MonoBehaviour
{
}
void
showHostMainWindow
(
)
public
void
showHostMainWindow
(
string
str
)
{
#if UNITY_ANDROID
try
{
AndroidJavaClass
jc
=
new
AndroidJavaClass
(
"com.company.product.OverrideUnityActivity"
);
AndroidJavaObject
overrideActivity
=
jc
.
GetStatic
<
AndroidJavaObject
>(
"instance"
);
overrideActivity
.
Call
(
"showMainActivity"
,
"red"
);
overrideActivity
.
Call
(
"showMainActivity"
,
str
);
}
catch
(
Exception
e
)
{
appendToText
(
"Exception during showHostMainWindow"
);
appendToText
(
e
.
Message
);
//
appendToText("Exception during showHostMainWindow");
//
appendToText(e.Message);
}
#endif
}
void
onNativeMessage
(
string
json
)
{
SceneManager
.
LoadScene
(
"Scenes/gameScene"
);
Debug
.
Log
(
"Android调用该方法"
+
json
);
Debug
.
Log
(
"Android调用该方法"
+
json
);
}
void
jumpGame
(
string
json
)
{
Debug
.
Log
(
"JSON:"
+
json
);
utilsTools
.
setGDataByKey
(
"NativeGameData"
,
JsonUtility
.
FromJson
<
netLableImageItem
>(
json
));
SceneManager
.
LoadScene
(
"Scenes/gameScene"
);
}
}
\ No newline at end of file
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