Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
山
山西检定流水线数字孪生项目
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
杨泽宇
山西检定流水线数字孪生项目
Commits
aaed0372
Commit
aaed0372
authored
May 28, 2024
by
杨泽宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
7821a2a1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
9434 additions
and
2720 deletions
+9434
-2720
2号线.db
2号线.db
+0
-0
AGV1.prefab
Assets/Scripts/Components/AGV/AGV1.prefab
+2067
-0
AGV1.prefab.meta
Assets/Scripts/Components/AGV/AGV1.prefab.meta
+7
-0
AGV2.prefab
Assets/Scripts/Components/AGV/AGV2.prefab
+2067
-0
AGV2.prefab.meta
Assets/Scripts/Components/AGV/AGV2.prefab.meta
+7
-0
AGVDemoV2.cs
Assets/Scripts/Components/AGV/AGVDemoV2.cs
+1
-1
LoginManager.cs
Assets/Scripts/Components/AGV/LoginManager.cs
+3
-1
TouristModeController.cs
Assets/Scripts/Components/TouristModeController.cs
+34
-8
TouristModeInitializer.cs
Assets/Scripts/Components/TouristModeInitializer.cs
+35
-0
TouristModeInitializer.cs.meta
Assets/Scripts/Components/TouristModeInitializer.cs.meta
+11
-0
1_Main.unity
Assets/_Scenes/1_Main.unity
+5202
-2710
二号线.db
二号线.db
+0
-0
No files found.
2号线.db
0 → 100644
View file @
aaed0372
File added
Assets/Scripts/Components/AGV/AGV1.prefab
0 → 100644
View file @
aaed0372
This diff is collapsed.
Click to expand it.
Assets/Scripts/Components/AGV/AGV1.prefab.meta
0 → 100644
View file @
aaed0372
fileFormatVersion: 2
guid: 9af5804f030164640b1c3ca0a2a1323c
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/Scripts/Components/AGV/AGV2.prefab
0 → 100644
View file @
aaed0372
This diff is collapsed.
Click to expand it.
Assets/Scripts/Components/AGV/AGV2.prefab.meta
0 → 100644
View file @
aaed0372
fileFormatVersion: 2
guid: c7d0300a40be5b04f8144d136c74b967
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/Scripts/Components/AGV/AGVDemoV2.cs
View file @
aaed0372
...
@@ -16,6 +16,6 @@ public class AGVDemoV2 : MonoBehaviour
...
@@ -16,6 +16,6 @@ public class AGVDemoV2 : MonoBehaviour
private
void
UpdatePosition
()
private
void
UpdatePosition
()
{
{
AGVManager
.
AddMoveMsg
(
"AGV1"
,
manager
.
position
);
AGVManager
.
AddMoveMsg
(
"AGV1"
,
manager
.
position
,
manager
.
angle
);
}
}
}
}
Assets/Scripts/Components/AGV/LoginManager.cs
View file @
aaed0372
...
@@ -17,6 +17,7 @@ public class LoginManager : MonoBehaviour
...
@@ -17,6 +17,7 @@ public class LoginManager : MonoBehaviour
[
Space
]
[
Space
]
[
Header
(
"获取的信息"
)]
[
Header
(
"获取的信息"
)]
public
Vector3
position
;
public
Vector3
position
;
public
float
angle
;
private
void
Awake
()
private
void
Awake
()
{
{
OnReceiveMsg
.
AddListener
(
_getData
);
OnReceiveMsg
.
AddListener
(
_getData
);
...
@@ -38,7 +39,7 @@ public class LoginManager : MonoBehaviour
...
@@ -38,7 +39,7 @@ public class LoginManager : MonoBehaviour
{
{
RobotPositionData
robotPositionData
=
(
RobotPositionData
)
data
;
RobotPositionData
robotPositionData
=
(
RobotPositionData
)
data
;
position
=
new
Vector3
(
robotPositionData
.
data
.
x
,
robotPositionData
.
data
.
y
,
robotPositionData
.
data
.
h
);
position
=
new
Vector3
(
robotPositionData
.
data
.
x
,
robotPositionData
.
data
.
y
,
robotPositionData
.
data
.
h
);
Debug
.
Log
(
position
)
;
angle
=
robotPositionData
.
data
.
angle
*
Mathf
.
Rad2Deg
;
}
}
}
}
...
@@ -90,4 +91,5 @@ public class RobotPositionDataDetails
...
@@ -90,4 +91,5 @@ public class RobotPositionDataDetails
public
float
x
;
public
float
x
;
public
float
y
;
public
float
y
;
public
float
h
;
public
float
h
;
public
float
angle
;
}
}
\ No newline at end of file
Assets/Scripts/Components/TouristModeController.cs
View file @
aaed0372
...
@@ -34,7 +34,15 @@ public class TouristModeController : MonoBehaviour
...
@@ -34,7 +34,15 @@ public class TouristModeController : MonoBehaviour
[
Space
]
[
Space
]
[
Header
(
"机器巡检设置"
)]
[
Header
(
"机器巡检设置"
)]
public
GameObject
RobotInspection
;
public
GameObject
CameraInspection1
;
public
GameObject
CameraInspection2
;
public
GameObject
AGVInspection1
;
public
GameObject
AGVInspection2
;
private
bool
IsInspection1
=
true
;
public
GameObject
Inspection1
;
public
GameObject
Inspection2
;
private
float
speeds
=
1f
;
private
float
speeds
=
1f
;
private
bool
isPaused
=
true
;
private
bool
isPaused
=
true
;
...
@@ -43,9 +51,6 @@ public class TouristModeController : MonoBehaviour
...
@@ -43,9 +51,6 @@ public class TouristModeController : MonoBehaviour
private
AnimatorStateInfo
stateInfo
;
private
AnimatorStateInfo
stateInfo
;
private
Animator
planeAnimator
;
private
Animator
planeAnimator
;
public
bool
IsArtificial
=
false
;
private
void
Start
()
private
void
Start
()
{
{
ResetBtn
.
onClick
.
AddListener
(
Restart
);
ResetBtn
.
onClick
.
AddListener
(
Restart
);
...
@@ -62,6 +67,7 @@ public class TouristModeController : MonoBehaviour
...
@@ -62,6 +67,7 @@ public class TouristModeController : MonoBehaviour
planeAnimator
.
speed
=
0
;
planeAnimator
.
speed
=
0
;
}
}
private
void
OnDestroy
()
private
void
OnDestroy
()
{
{
slider
.
onValueChanged
.
RemoveAllListeners
();
slider
.
onValueChanged
.
RemoveAllListeners
();
...
@@ -85,14 +91,34 @@ public class TouristModeController : MonoBehaviour
...
@@ -85,14 +91,34 @@ public class TouristModeController : MonoBehaviour
}
}
}
}
public
void
LinhasComutadoras
()
{
if
(
IsInspection1
)
{
Inspection1
.
SetActive
(
false
);
AGVInspection1
.
SetActive
(
false
);
Inspection2
.
SetActive
(
true
);
AGVInspection2
.
SetActive
(
true
);
}
else
{
Inspection1
.
SetActive
(
true
);
AGVInspection1
.
SetActive
(
true
);
Inspection2
.
SetActive
(
false
);
AGVInspection2
.
SetActive
(
false
);
}
IsInspection1
=
!
IsInspection1
;
}
/// <summary>
/// <summary>
/// 设置机器巡检
/// 设置机器巡检
/// </summary>
/// </summary>
public
void
SetArtificial
()
public
void
SetArtificial
()
{
{
ExitObserve
();
ExitObserve
();
RobotInspection
.
SetActive
(
true
);
CameraInspection1
.
SetActive
(
true
);
IsArtificial
=
true
;
CameraInspection2
.
SetActive
(
true
)
;
CharacterModeUI
.
SetActive
(
false
);
CharacterModeUI
.
SetActive
(
false
);
ReturnUI
.
SetActive
(
true
);
ReturnUI
.
SetActive
(
true
);
}
}
...
@@ -213,8 +239,8 @@ public class TouristModeController : MonoBehaviour
...
@@ -213,8 +239,8 @@ public class TouristModeController : MonoBehaviour
Player
.
BackToInitPosition
();
Player
.
BackToInitPosition
();
Player
.
IsPause
=
false
;
Player
.
IsPause
=
false
;
Player
.
AutoRotate
=
false
;
Player
.
AutoRotate
=
false
;
RobotInspection
.
SetActive
(
false
);
CameraInspection1
.
SetActive
(
false
);
IsArtificial
=
false
;
CameraInspection2
.
SetActive
(
false
)
;
CharacterModeUI
.
SetActive
(
true
);
CharacterModeUI
.
SetActive
(
true
);
ReturnUI
.
SetActive
(
false
);
ReturnUI
.
SetActive
(
false
);
}
}
...
...
Assets/Scripts/Components/TouristModeInitializer.cs
0 → 100644
View file @
aaed0372
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
/// <summary>
/// 用来把生成的摄像头,赋值到控制器上
/// </summary>
public
class
TouristModeInitializer
:
MonoBehaviour
{
public
bool
IsRobotInspection1
;
public
GameObject
CameraInspection
;
// Start is called before the first frame update
void
Start
()
{
// 查找带有TouristModeController脚本的对象
TouristModeController
touristModeController
=
FindObjectOfType
<
TouristModeController
>();
// 检查是否找到该对象
if
(
touristModeController
!=
null
)
{
if
(
IsRobotInspection1
)
{
touristModeController
.
CameraInspection1
=
CameraInspection
;
touristModeController
.
AGVInspection1
=
this
.
gameObject
;
}
else
{
touristModeController
.
CameraInspection2
=
CameraInspection
;
touristModeController
.
AGVInspection2
=
this
.
gameObject
;
this
.
gameObject
.
SetActive
(
false
);
}
}
}
}
Assets/Scripts/Components/TouristModeInitializer.cs.meta
0 → 100644
View file @
aaed0372
fileFormatVersion: 2
guid: 195b7d9adb9c43143aa22d4e3ed051f7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/_Scenes/1_Main.unity
View file @
aaed0372
This diff is collapsed.
Click to expand it.
二号线.db
0 → 100644
View file @
aaed0372
File added
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