Commit 3b9bd348 authored by 杨泽宇's avatar 杨泽宇

更新

parent e5558e24
fileFormatVersion: 2
guid: 4dd4231508771e040b4975a906d4c9f4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 0d28d0909a8cb9f499a52c7b2b805e75
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: b5e531011f6291949a8f78351b84c083
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &8596543029379164022
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1622100324105774952, guid: dfaf1babc5b5dee4185e81b645b5b948,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1622100324105774952, guid: dfaf1babc5b5dee4185e81b645b5b948,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1622100324105774952, guid: dfaf1babc5b5dee4185e81b645b5b948,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1622100324105774952, guid: dfaf1babc5b5dee4185e81b645b5b948,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1622100324105774952, guid: dfaf1babc5b5dee4185e81b645b5b948,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1622100324105774952, guid: dfaf1babc5b5dee4185e81b645b5b948,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1622100324105774952, guid: dfaf1babc5b5dee4185e81b645b5b948,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1622100324105774952, guid: dfaf1babc5b5dee4185e81b645b5b948,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1622100324105774952, guid: dfaf1babc5b5dee4185e81b645b5b948,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1622100324105774952, guid: dfaf1babc5b5dee4185e81b645b5b948,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8479452100449772129, guid: dfaf1babc5b5dee4185e81b645b5b948,
type: 3}
propertyPath: m_Name
value: "\u573A\u666F\u6D4F\u89C8\u4EBA\u7269\u529F\u80FD\u96C6\u5408"
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: dfaf1babc5b5dee4185e81b645b5b948, type: 3}
fileFormatVersion: 2
guid: e525963e80d07df418ccdd194c29ff2a
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
public class CameraController : MonoBehaviour
{
public float rotationSpeed = 5.0f;
private void Update()
{
// 检测鼠标右键是否按下
if (Input.GetMouseButton(1))
{
// 获取鼠标水平和垂直移动
float mouseX = Input.GetAxis("Mouse X");
float mouseY = Input.GetAxis("Mouse Y");
// 根据鼠标移动旋转摄像机
RotateCamera(mouseX, mouseY);
}
}
void RotateCamera(float mouseX, float mouseY)
{
// 获取摄像机当前的欧拉角
Vector3 currentRotation = transform.eulerAngles;
// 在垂直方向上旋转摄像机
currentRotation.x -= mouseY * rotationSpeed;
// 在水平方向上旋转摄像机
currentRotation.y += mouseX * rotationSpeed;
// 限制垂直旋转角度在 -90 到 90 度之间
//currentRotation.x = Mathf.Clamp(currentRotation.x, -90f, 90f);
// 应用新的欧拉角到摄像机
transform.eulerAngles = currentRotation;
}
}
fileFormatVersion: 2
guid: bea379df01a89ca4799c8c7b9f89d198
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
public class FollowTarget : MonoBehaviour
{
public Transform target; // 要跟随的目标物体
void Update()
{
if (target != null)
{
// 设置物体的位置为目标物体的位置
transform.position = target.position;
}
}
public void Follow()
{
if (target != null)
{
// 设置物体的位置为目标物体的位置
transform.position = target.position;
// 设置物体的旋转为目标物体的旋转
transform.rotation = target.rotation;
}
}
}
fileFormatVersion: 2
guid: d9ac30e3788b1e54bb3979453a12eb10
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEngine.UI;
using TMPro;
using UnityEngine.EventSystems;
using Zeus.UIS;
public class TouristModeController : MonoBehaviour
{
[Space]
[Header("全局视角设置")]
public UIS_CharacterController_Ob Player;
[Space]
[Header("巡检视角设置")]
[Tooltip("固定摄像头")]
public GameObject FixCamera;
[Tooltip("自由摄像头")]
public GameObject FreeCamera;
[Tooltip("固定摄像头中动画的名字")]
public string animName;
[Tooltip("导览模式UI")]
public GameObject VisitUI;
[Tooltip("复位按钮")]
public Button ResetBtn;
[Tooltip("播/放按钮")]
public Button IsPlayBtn;
[Tooltip("进度条")]
public Slider slider;
[Tooltip("选择播放倍速")]
public TMP_Dropdown speedDropdown;
[Space]
[Header("机器巡检设置")]
public GameObject RobotInspection;
private float speeds = 1f;
private bool isPaused = true;
private float pauseTime;
private bool isChangingSlider = false;
private AnimatorStateInfo stateInfo;
private Animator planeAnimator;
public bool IsArtificial = false;
private void Start()
{
ResetBtn.onClick.AddListener(Restart);
IsPlayBtn.onClick.AddListener(PauseOrResumeAnimator);
speedDropdown.onValueChanged.AddListener(OnSpeedDropdownChanged);
slider.onValueChanged.AddListener(OnSliderValueChanged);
planeAnimator = FixCamera.GetComponent<Animator>();
if (planeAnimator == null)
{
Debug.Log("固定摄像头中没有添加行走路线(Animator)");
return;
}
stateInfo = planeAnimator.GetCurrentAnimatorStateInfo(0);
planeAnimator.speed = 0;
}
private void OnDestroy()
{
slider.onValueChanged.RemoveAllListeners();
speedDropdown.onValueChanged.RemoveAllListeners();
ResetBtn.onClick.RemoveAllListeners();
IsPlayBtn.onClick.RemoveAllListeners();
}
private void Update()
{
if (!isChangingSlider && !isPaused)
{
// 将Animator的播放位置转换为Slider的数值
float value = planeAnimator.GetCurrentAnimatorStateInfo(0).normalizedTime;
slider.value = value;
}
}
/// <summary>
/// 设置机器巡检
/// </summary>
public void SetArtificial()
{
ExitObserve();
RobotInspection.SetActive(true);
IsArtificial = true;
//if (manager.isShow)
//{
// line1.SetActive(true);
//}
//else
//{
// line1.SetActive(false);
//}
//if (manager1.isShow)
//{
// line2.SetActive(true);
//}
//else
//{
// line2.SetActive(false);
//}
}
/// <summary>
/// 设置环绕视角
/// </summary>
/// <param name="IsEncircle"></param>
public void SetEncircle()
{
ExitObserve();
Player.AutoRotationSpeed = 0.2f;
}
/// <summary>
/// 进入导览模式
/// </summary>
public void EnterObserve()
{
ExitObserve();
FixCamera.SetActive(true);
VisitUI.SetActive(true);
Player.BackToInitPosition();
Player.IsPause = true;
}
/// <summary>
/// 当滑动条值改变时,根据新值重新播放动画。
/// </summary>
/// <param name="value"></param>
private void OnSliderValueChanged(float value)
{
planeAnimator.Play(stateInfo.fullPathHash, 0, value);
}
/// <summary>
/// 更改播放倍速
/// </summary>
/// <param name="value"></param>
private void OnSpeedDropdownChanged(int value)
{
float speed = 1f;
switch (value)
{
case 0:
speed = 3f; // 一倍速
break;
case 1:
speed = 2f; // 0.5倍速
break;
case 2:
speed = 1f; // 2倍速
break;
case 3:
speed = 0.5f; // 3倍速
break;
default:
speed = 1f; // 默认为一倍速
break;
}
if (!isPaused)
{
speeds = speed;
planeAnimator.speed = speed;
}
else
{
speeds = speed;
}
}
/// <summary>
/// 暂停或继续播放
/// </summary>
private void PauseOrResumeAnimator()
{
if (!isPaused)
{
isPaused = true;
pauseTime = planeAnimator.GetCurrentAnimatorStateInfo(0).normalizedTime;
planeAnimator.speed = 0f; // 暂停
planeAnimator.Play(animName, 0, pauseTime);
//FreeCamera.SetActive(true);
}
else
{
isPaused = false;
planeAnimator.speed = speeds;
//FreeCamera.SetActive(false);
}
var follow = FreeCamera.GetComponent<FollowTarget>();
if (follow == null)
{
Debug.Log("自由摄像头中没有添加FollowTarget");
return;
}
follow.Follow();
}
/// <summary>
/// 退出游览模式,重置状态并切换到固定摄像头。
/// </summary>
public void ExitObserve()
{
Restart();
isPaused = false;
PauseOrResumeAnimator();
//FreeCamera.SetActive(false);
FixCamera.SetActive(false);
VisitUI.SetActive(false);
Player.BackToInitPosition();
Player.IsPause = false;
Player.AutoRotationSpeed = 0f;
RobotInspection.SetActive(false);
IsArtificial = false;
}
/// <summary>
/// 停止并重新播放动画,用于重新开始游览。
/// </summary>
private void Restart()
{
// 停止动画
planeAnimator.StopPlayback();
// 在下一帧重新播放动画,因为在同一帧调用Play,可能会冲突,所以等一帧
StartCoroutine(PlayAnimationNextFrame());
}
/// <summary>
/// 在重新播放前将滑动条的值重置为0。
/// </summary>
/// <returns></returns>
private System.Collections.IEnumerator PlayAnimationNextFrame()
{
yield return null;
// 重置Slider的值为初始值
slider.value = 0f;
planeAnimator.Play(animName, 0, 0); // 将Animator的播放位置设置为0
}
/// <summary>
/// 当开始或结束拖动滑动条时调用,用于标记当前是否正在改变滑动条的值。
/// </summary>
public void OnSliderDragStart()
{
// 开始拖动Slider时调用
isChangingSlider = true;
}
public void OnSliderDragEnd()
{
// 结束拖动Slider时调用
isChangingSlider = false;
}
}
fileFormatVersion: 2
guid: 568fb7c6b64c20744b4bbd8affbe040c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Subproject commit 92b24908aa0f950d45d98a7d7ca9bfa79b66fd65
Subproject commit a4e00e6ce5c623541b258b7c5662a8e2ccf8af8e
Subproject commit 24bd708f4fafb31d1352690ead5643f510c98096
Subproject commit 3b449ef867bbff2570f48bbb0a586eaba17b85dc
Subproject commit ddb7939048277859e4978376a1383d7102046ae5
Subproject commit 921bf6dd3658a157696d6dc9d5faa65dcea90d27
This diff is collapsed.
fileFormatVersion: 2
guid: a1193329f89803b4f8a14f6c0b15d2c1
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: b7fe39a04f3fd9b48a2ea5d3eb630343
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: "\u4EBA\u5DE5\u5DE1\u68C0"
serializedVersion: 7
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: -666.41473, y: 1341.3174, z: 1675.2805}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.6666667
value: {x: -664.09, y: 1336.64, z: 1669.44}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path:
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 1
script: {fileID: 0}
typeID: 4
customType: 0
isPPtrCurve: 0
isIntCurve: 0
isSerializeReferenceCurve: 0
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.6666667
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: -666.41473
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.6666667
value: -664.09
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.x
path:
classID: 4
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1341.3174
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.6666667
value: 1336.64
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.y
path:
classID: 4
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1675.2805
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.6666667
value: 1669.44
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.z
path:
classID: 4
script: {fileID: 0}
flags: 0
m_EulerEditorCurves: []
m_HasGenericRootTransform: 1
m_HasMotionFloatCurves: 0
m_Events: []
fileFormatVersion: 2
guid: d2d8b52319139aa4f818ca7a313efaf3
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1107 &-2259469971735534422
AnimatorStateMachine:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 8361141948799143229}
m_Position: {x: 320, y: 80, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 8361141948799143229}
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: "\u56FA\u5B9A\u6E38\u89C8\u6444\u50CF\u673A"
serializedVersion: 5
m_AnimatorParameters: []
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: -2259469971735534422}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1102 &8361141948799143229
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: "\u4EBA\u5DE5\u5DE1\u68C0"
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: d2d8b52319139aa4f818ca7a313efaf3, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
fileFormatVersion: 2
guid: 9e9f5258dd283594bb186ab03a2e50fc
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 25746cf253214d8409a24c03eec2af6e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 72c6cc24197ee2747bcb13d5cf8e28c3
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 2053c0b92bb66c24a8ec8315a5641ff7
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -679,7 +679,7 @@ PlayerSettings:
Stadia: PLAYMAKER;PLAYMAKER_1_9;PLAYMAKER_1_9_0;PLAYMAKER_1_8_OR_NEWER;PLAYMAKER_1_8_5_OR_NEWER;PLAYMAKER_1_9_OR_NEWER;UNITY_POST_PROCESSING_STACK_V2
Standalone: CT_RTV;UNITY_POST_PROCESSING_STACK_V2;UIS;BAKERY_INCLUDED;ZeusMQTT
VisionOS: PLAYMAKER;PLAYMAKER_1_9;PLAYMAKER_1_9_0;PLAYMAKER_1_8_OR_NEWER;PLAYMAKER_1_8_5_OR_NEWER;PLAYMAKER_1_9_OR_NEWER;UNITY_POST_PROCESSING_STACK_V2
WebGL: PLAYMAKER;PLAYMAKER_1_9;PLAYMAKER_1_9_0;PLAYMAKER_1_8_OR_NEWER;PLAYMAKER_1_8_5_OR_NEWER;PLAYMAKER_1_9_OR_NEWER;UNITY_POST_PROCESSING_STACK_V2
WebGL: PLAYMAKER;PLAYMAKER_1_9;PLAYMAKER_1_9_0;PLAYMAKER_1_8_OR_NEWER;PLAYMAKER_1_8_5_OR_NEWER;PLAYMAKER_1_9_OR_NEWER;UNITY_POST_PROCESSING_STACK_V2;BAKERY_INCLUDED;UIS;ZeusMQTT
Windows Store Apps: PLAYMAKER;PLAYMAKER_1_9;PLAYMAKER_1_9_0;PLAYMAKER_1_8_OR_NEWER;PLAYMAKER_1_8_5_OR_NEWER;PLAYMAKER_1_9_OR_NEWER;UNITY_POST_PROCESSING_STACK_V2
XboxOne: PLAYMAKER;PLAYMAKER_1_9;PLAYMAKER_1_9_0;PLAYMAKER_1_8_OR_NEWER;PLAYMAKER_1_8_5_OR_NEWER;PLAYMAKER_1_9_OR_NEWER;UNITY_POST_PROCESSING_STACK_V2
iPhone: PLAYMAKER;PLAYMAKER_1_9;PLAYMAKER_1_9_0;PLAYMAKER_1_8_OR_NEWER;PLAYMAKER_1_8_5_OR_NEWER;PLAYMAKER_1_9_OR_NEWER
......
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