Commit 1e0ae469 authored by 杨泽宇's avatar 杨泽宇

更新

parent ee0e12f0
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;
}
}
fileFormatVersion: 2
guid: f62f0e2e22a8d3843a7dcc6cfaaa58c8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -91,6 +91,7 @@ public class TouristModeController : MonoBehaviour
}
}
public void LinhasComutadoras()
{
if (IsInspection1)
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Cinemachine;
/// <summary>
/// 用来把生成的摄像头,赋值到控制器上
......@@ -10,6 +11,12 @@ public class TouristModeInitializer : MonoBehaviour
public bool IsRobotInspection1;
public GameObject CameraInspection;
public Vector3 area1;
public Vector3 area2;
public Vector3 area3;
public Vector3 area4;
// Start is called before the first frame update
void Start()
{
......@@ -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;
}
}
}
This diff is collapsed.
......@@ -1413,6 +1413,7 @@ GameObject:
- component: {fileID: 810334352363839792}
- component: {fileID: 2505216687764973061}
- component: {fileID: 407846654731933670}
- component: {fileID: 8413326341674218567}
m_Layer: 0
m_Name: AGV1
m_TagString: Untagged
......@@ -1567,6 +1568,31 @@ MonoBehaviour:
m_EditorClassIdentifier:
IsRobotInspection1: 1
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
GameObject:
m_ObjectHideFlags: 0
......
......@@ -446,6 +446,7 @@ GameObject:
- component: {fileID: 6034790007004104862}
- component: {fileID: 5061384484626961406}
- component: {fileID: 3891877822528981785}
- component: {fileID: -447616435929325467}
m_Layer: 0
m_Name: AGV2
m_TagString: Untagged
......@@ -600,6 +601,31 @@ MonoBehaviour:
m_EditorClassIdentifier:
IsRobotInspection1: 0
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
GameObject:
m_ObjectHideFlags: 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment