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
1e0ae469
Commit
1e0ae469
authored
Jun 26, 2024
by
杨泽宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
ee0e12f0
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
839 additions
and
22 deletions
+839
-22
RotateOnEnter.cs
Assets/Scripts/Components/AGV/RotateOnEnter.cs
+24
-0
RotateOnEnter.cs.meta
Assets/Scripts/Components/AGV/RotateOnEnter.cs.meta
+11
-0
TouristModeController.cs
Assets/Scripts/Components/TouristModeController.cs
+1
-0
TouristModeInitializer.cs
Assets/Scripts/Components/TouristModeInitializer.cs
+33
-2
1_Main.unity
Assets/_Scenes/1_Main.unity
+718
-20
AGV1.prefab
Assets/_预设/设备/AGV1.prefab
+26
-0
AGV2.prefab
Assets/_预设/设备/AGV2.prefab
+26
-0
No files found.
Assets/Scripts/Components/AGV/RotateOnEnter.cs
0 → 100644
View file @
1e0ae469
using
UnityEngine
;
using
UnityEngine.Events
;
public
class
RotateOnEnter
:
MonoBehaviour
{
public
GameObject
Camera
;
[
Tooltip
(
"目标旋转角度"
)]
public
Vector3
targetRotation
;
[
Tooltip
(
"物体进入触发器区域时调用的事件"
)]
public
UnityEvent
onEnterTrigger
;
private
void
OnTriggerEnter
(
Collider
other
)
{
onEnterTrigger
.
Invoke
();
}
private
void
RotateObject
(
Vector3
targetRotation
)
{
// 旋转物体到目标角度
Camera
.
transform
.
eulerAngles
=
targetRotation
;
}
}
Assets/Scripts/Components/AGV/RotateOnEnter.cs.meta
0 → 100644
View file @
1e0ae469
fileFormatVersion: 2
guid: f62f0e2e22a8d3843a7dcc6cfaaa58c8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Scripts/Components/TouristModeController.cs
View file @
1e0ae469
...
@@ -91,6 +91,7 @@ public class TouristModeController : MonoBehaviour
...
@@ -91,6 +91,7 @@ public class TouristModeController : MonoBehaviour
}
}
}
}
public
void
LinhasComutadoras
()
public
void
LinhasComutadoras
()
{
{
if
(
IsInspection1
)
if
(
IsInspection1
)
...
...
Assets/Scripts/Components/TouristModeInitializer.cs
View file @
1e0ae469
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine
;
using
Cinemachine
;
/// <summary>
/// <summary>
/// 用来把生成的摄像头,赋值到控制器上
/// 用来把生成的摄像头,赋值到控制器上
...
@@ -10,6 +11,12 @@ public class TouristModeInitializer : MonoBehaviour
...
@@ -10,6 +11,12 @@ public class TouristModeInitializer : MonoBehaviour
public
bool
IsRobotInspection1
;
public
bool
IsRobotInspection1
;
public
GameObject
CameraInspection
;
public
GameObject
CameraInspection
;
public
Vector3
area1
;
public
Vector3
area2
;
public
Vector3
area3
;
public
Vector3
area4
;
// Start is called before the first frame update
// Start is called before the first frame update
void
Start
()
void
Start
()
{
{
...
@@ -32,4 +39,28 @@ public class TouristModeInitializer : MonoBehaviour
...
@@ -32,4 +39,28 @@ public class TouristModeInitializer : MonoBehaviour
}
}
}
}
private
void
OnTriggerEnter
(
Collider
other
)
{
if
(
other
.
name
==
"台体区域1"
)
{
Debug
.
Log
(
"1"
);
CameraInspection
.
transform
.
eulerAngles
=
area1
;
}
if
(
other
.
name
==
"台体区域2"
)
{
Debug
.
Log
(
"1"
);
CameraInspection
.
transform
.
eulerAngles
=
area2
;
}
if
(
other
.
name
==
"检定区域1"
)
{
Debug
.
Log
(
"1"
);
CameraInspection
.
transform
.
eulerAngles
=
area3
;
}
if
(
other
.
name
==
"检定区域2"
)
{
Debug
.
Log
(
"1"
);
CameraInspection
.
transform
.
eulerAngles
=
area4
;
}
}
}
}
Assets/_Scenes/1_Main.unity
View file @
1e0ae469
This diff is collapsed.
Click to expand it.
Assets/_预设/设备/AGV1.prefab
View file @
1e0ae469
...
@@ -1413,6 +1413,7 @@ GameObject:
...
@@ -1413,6 +1413,7 @@ GameObject:
-
component
:
{
fileID
:
810334352363839792
}
-
component
:
{
fileID
:
810334352363839792
}
-
component
:
{
fileID
:
2505216687764973061
}
-
component
:
{
fileID
:
2505216687764973061
}
-
component
:
{
fileID
:
407846654731933670
}
-
component
:
{
fileID
:
407846654731933670
}
-
component
:
{
fileID
:
8413326341674218567
}
m_Layer
:
0
m_Layer
:
0
m_Name
:
AGV1
m_Name
:
AGV1
m_TagString
:
Untagged
m_TagString
:
Untagged
...
@@ -1567,6 +1568,31 @@ MonoBehaviour:
...
@@ -1567,6 +1568,31 @@ MonoBehaviour:
m_EditorClassIdentifier
:
m_EditorClassIdentifier
:
IsRobotInspection1
:
1
IsRobotInspection1
:
1
CameraInspection
:
{
fileID
:
2831112200708131673
}
CameraInspection
:
{
fileID
:
2831112200708131673
}
area1
:
{
x
:
0
,
y
:
0
,
z
:
0
}
area2
:
{
x
:
0
,
y
:
180
,
z
:
0
}
area3
:
{
x
:
0
,
y
:
-90
,
z
:
0
}
area4
:
{
x
:
0
,
y
:
90
,
z
:
0
}
---
!u!65
&8413326341674218567
BoxCollider
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
6957876910622364424
}
m_Material
:
{
fileID
:
0
}
m_IncludeLayers
:
serializedVersion
:
2
m_Bits
:
0
m_ExcludeLayers
:
serializedVersion
:
2
m_Bits
:
0
m_LayerOverridePriority
:
0
m_IsTrigger
:
0
m_ProvidesContacts
:
0
m_Enabled
:
1
serializedVersion
:
3
m_Size
:
{
x
:
1
,
y
:
0.8937867
,
z
:
1
}
m_Center
:
{
x
:
0
,
y
:
0.4231551
,
z
:
0
}
---
!u!1
&7170830256568294656
---
!u!1
&7170830256568294656
GameObject
:
GameObject
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
...
Assets/_预设/设备/AGV2.prefab
View file @
1e0ae469
...
@@ -446,6 +446,7 @@ GameObject:
...
@@ -446,6 +446,7 @@ GameObject:
-
component
:
{
fileID
:
6034790007004104862
}
-
component
:
{
fileID
:
6034790007004104862
}
-
component
:
{
fileID
:
5061384484626961406
}
-
component
:
{
fileID
:
5061384484626961406
}
-
component
:
{
fileID
:
3891877822528981785
}
-
component
:
{
fileID
:
3891877822528981785
}
-
component
:
{
fileID
:
-447616435929325467
}
m_Layer
:
0
m_Layer
:
0
m_Name
:
AGV2
m_Name
:
AGV2
m_TagString
:
Untagged
m_TagString
:
Untagged
...
@@ -600,6 +601,31 @@ MonoBehaviour:
...
@@ -600,6 +601,31 @@ MonoBehaviour:
m_EditorClassIdentifier
:
m_EditorClassIdentifier
:
IsRobotInspection1
:
0
IsRobotInspection1
:
0
CameraInspection
:
{
fileID
:
7301166422595926751
}
CameraInspection
:
{
fileID
:
7301166422595926751
}
area1
:
{
x
:
0
,
y
:
180
,
z
:
0
}
area2
:
{
x
:
0
,
y
:
0
,
z
:
0
}
area3
:
{
x
:
0
,
y
:
-90
,
z
:
0
}
area4
:
{
x
:
0
,
y
:
90
,
z
:
0
}
---
!u!65
&-447616435929325467
BoxCollider
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
2385283153731355844
}
m_Material
:
{
fileID
:
0
}
m_IncludeLayers
:
serializedVersion
:
2
m_Bits
:
0
m_ExcludeLayers
:
serializedVersion
:
2
m_Bits
:
0
m_LayerOverridePriority
:
0
m_IsTrigger
:
0
m_ProvidesContacts
:
0
m_Enabled
:
1
serializedVersion
:
3
m_Size
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Center
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!1
&2640166797373785073
---
!u!1
&2640166797373785073
GameObject
:
GameObject
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
...
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