Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Z
ZeusHub_Unity
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
潘梓豪
ZeusHub_Unity
Commits
c016dfb1
Commit
c016dfb1
authored
Dec 02, 2022
by
潘梓豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整启动方法 使用了参数启动
parent
4a32dfde
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
78 additions
and
11 deletions
+78
-11
ValManager.cs
Assets/Scripts/ValScript/ValManager.cs
+54
-1
ProgressUntily.cs
Assets/Scripts/unit/ProgressUntily.cs
+2
-1
WelBorews.cs
Assets/Scripts/unit/WelBorews.cs
+10
-5
ValScene.unity
Assets/_Scenes/ValScene.unity
+1
-1
验证.meta
Assets/_预设/UI/验证.meta
+8
-0
index.html
BrowserAssets/Appzia/dist/index.html
+1
-1
index2.html
BrowserAssets/Appzia/dist/index2.html
+1
-1
ReqData.json
ReqData.json
+1
-1
No files found.
Assets/Scripts/ValScript/ValManager.cs
View file @
c016dfb1
...
...
@@ -19,7 +19,7 @@ public class ValManager : MonoBehaviour
[
Tooltip
(
"软件可修改设置"
)]
public
ConfigSetting
Setting
;
IEnumerator
Start
()
/*
IEnumerator Start()
{
//string path = "C:\\Users\\Zeus_PC\\Desktop\\testval\\ReqData.json";
string path = "ReqData.json";
...
...
@@ -87,8 +87,61 @@ public class ValManager : MonoBehaviour
text.text = "丢失参数文件,请在ZeusHub中启动软件";
}
yield return null;
}*/
IEnumerator
Start
()
{
//string path = "C:\\Users\\Zeus_PC\\Desktop\\testval\\ReqData.json";
//string path = "ReqData.json";
string
[]
arg
=
Environment
.
GetCommandLineArgs
();
if
(
arg
!=
null
&&
arg
.
Length
>
1
)
{
//重定向项目路径
Directory
.
SetCurrentDirectory
(
arg
[
3
]);
ConfigSetting
saved_setting
=
ConfigSetting
.
Instant
;
if
(
saved_setting
==
null
)
{
saved_setting
=
ConfigSetting
.
Instant
=
Setting
;
}
Setting
=
saved_setting
;
//获取本机code
string
code
=
getMNum
();
//通过机器码code、产品id判读是否已校验
using
(
var
rq
=
UnityWebRequest
.
Get
(
arg
[
4
]
+
"/getRobotCode?productionid="
+
arg
[
2
]
+
"&code="
+
code
))
{
rq
.
SetRequestHeader
(
"Authorization"
,
arg
[
1
]);
yield
return
rq
.
SendWebRequest
();
if
(
string
.
IsNullOrEmpty
(
rq
.
error
))
{
Dictionary
<
string
,
object
>
jsonData
=
JsonMapper
.
ToObject
<
Dictionary
<
string
,
object
>>(
rq
.
downloadHandler
.
text
);
string
scene
=
(
string
)
jsonData
.
Where
(
S
=>
S
.
Key
==
"LoadScene"
).
Select
(
S
=>
S
.
Value
).
First
();
if
(
scene
!=
null
&&
!
scene
.
Equals
(
""
))
{
text
.
text
=
"验证成功,正在跳转。。。"
;
SceneManager
.
LoadScene
(
scene
);
//删除参数配置文件
//File.Delete(path);
}
else
{
text
.
text
=
"没有注册码,请先注册"
;
}
}
}
}
else
{
text
.
text
=
"丢失参数文件,请在ZeusHub中启动软件"
;
}
yield
return
null
;
}
//生成机器码
public
static
string
getMNum
()
{
...
...
Assets/Scripts/unit/ProgressUntily.cs
View file @
c016dfb1
...
...
@@ -8,12 +8,13 @@ using UnityEngine;
public
class
ProgressUntily
:
MonoBehaviour
{
Process
process
=
new
Process
();
public
void
CallProress
(
string
path
)
public
void
CallProress
(
string
path
,
string
arg
)
{
try
{
process
.
StartInfo
.
UseShellExecute
=
false
;
process
.
StartInfo
.
FileName
=
path
;
process
.
StartInfo
.
Arguments
=
arg
;
process
.
StartInfo
.
CreateNoWindow
=
true
;
process
.
StartInfo
.
RedirectStandardInput
=
true
;
process
.
StartInfo
.
RedirectStandardOutput
=
true
;
...
...
Assets/Scripts/unit/WelBorews.cs
View file @
c016dfb1
...
...
@@ -77,7 +77,7 @@ public class WelBorews : MonoBehaviour
}
private
IEnumerator
_getProcessStart
()
/*
private IEnumerator _getProcessStart()
{
string api = Setting.IP + "/zeus/es3cloud/getAutoSend";
...
...
@@ -111,13 +111,13 @@ public class WelBorews : MonoBehaviour
}
yield return new WaitForSeconds(1);
}
}
}
*/
public
void
InitData
()
{
browser
.
RegisterFunction
(
"startProgram"
,
(
JSONNode
jk
)
=>
{
startProcess
(
jk
[
0
].
Value
+
""
,
jk
[
1
].
Value
+
""
);
startProcess
(
jk
[
0
].
Value
+
""
,
jk
[
1
].
Value
+
""
,
jk
[
2
].
Value
+
""
);
});
browser
.
RegisterFunction
(
"downloadProgram"
,
(
JSONNode
jk
)
=>
{
...
...
@@ -147,7 +147,7 @@ public class WelBorews : MonoBehaviour
//启动程序
public
void
startProcess
(
string
id
,
string
path
)
public
void
startProcess
(
string
id
,
string
path
,
string
val_path
)
{
if
(
File
.
Exists
(
path
))
{
...
...
@@ -176,7 +176,12 @@ public class WelBorews : MonoBehaviour
if
(
System
.
IO
.
File
.
Exists
(
"ReqData.json"
))
{
ProgressUntily
progressUntily
=
new
ProgressUntily
();
progressUntily
.
CallProress
(
path
);
string
argument1
=
"\""
+
manager
.
token
+
"\""
;
string
argument2
=
"\""
+
id
+
"\""
;
string
argument3
=
"\""
+
path
.
Substring
(
0
,
path
.
LastIndexOf
(
"/"
))
+
"\""
;
string
argument4
=
"\""
+
val_path
+
"\""
;
progressUntily
.
CallProress
(
path
,
argument1
+
" "
+
argument2
+
" "
+
argument3
+
" "
+
argument4
);
}
}
}
else
...
...
Assets/_Scenes/ValScene.unity
View file @
c016dfb1
...
...
@@ -310,7 +310,7 @@ GameObject:
-
component
:
{
fileID
:
1121117389
}
-
component
:
{
fileID
:
1121117388
}
m_Layer
:
5
m_Name
:
Canvas
m_Name
:
"
\u672C\u5730\u9A8C\u8BC1
"
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
...
...
Assets/_预设/UI/验证.meta
0 → 100644
View file @
c016dfb1
fileFormatVersion: 2
guid: 179d30774b871b243b216cc702e1eed2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
BrowserAssets/Appzia/dist/index.html
View file @
c016dfb1
...
...
@@ -944,7 +944,7 @@
success
:
function
(
data
){
if
(
data
.
path
!=
null
&&
data
.
path
!=
""
){
//调用c#方法 启动软件
startProgram
(
$
(
that
).
attr
(
"data-id"
),
data
.
path
);
startProgram
(
$
(
that
).
attr
(
"data-id"
),
data
.
path
,
data
.
val_path
);
}
else
{
alert
(
"请先配置软件路径"
);
}
...
...
BrowserAssets/Appzia/dist/index2.html
View file @
c016dfb1
...
...
@@ -1053,7 +1053,7 @@
success
:
function
(
data
){
if
(
data
.
path
!=
null
&&
data
.
path
!=
""
){
//调用c#方法 启动软件
startProgram
(
$
(
that
).
attr
(
"data-id"
),
data
.
path
);
startProgram
(
$
(
that
).
attr
(
"data-id"
),
data
.
path
,
data
.
val_path
);
}
else
{
alert
(
"请先配置软件路径"
);
}
...
...
ReqData.json
View file @
c016dfb1
{
"token"
:
"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjQxZWQ1NTZlZjM2NzE4ZWQ2MjZkYjI1N2YzODJjNzVhNGQxZWZmYzk5ZmIxNmZlOWI1YzM3NGE1Y2Q2YzFhN2IxNDE1OTJmMWY2OWUxNDVhIn0.eyJhdWQiOiIyYmM1ZjE1Zi0wNzE3LTQ4ZjktYTc4Mi03NzQ5M2FjNDUwODQiLCJqdGkiOiI0MWVkNTU2ZWYzNjcxOGVkNjI2ZGIyNTdmMzgyYzc1YTRkMWVmZmM5OWZiMTZmZTliNWMzNzRhNWNkNmMxYTdiMTQx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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