6.21晚提交
This commit is contained in:
parent
39c7139c68
commit
878d6cd25b
|
|
@ -114,12 +114,12 @@ Material:
|
||||||
- _UVSec: 0
|
- _UVSec: 0
|
||||||
- _ZWrite: 1
|
- _ZWrite: 1
|
||||||
- __dirty: 0
|
- __dirty: 0
|
||||||
- _step_p1: 1
|
- _step_p1: 0
|
||||||
- _step_p2: 1
|
- _step_p2: 0
|
||||||
- _step_p3: 1
|
- _step_p3: 0
|
||||||
- _step_p4: 1
|
- _step_p4: 0
|
||||||
- _step_p5: 1
|
- _step_p5: 0
|
||||||
- _step_p6: 1
|
- _step_p6: 0
|
||||||
m_Colors:
|
m_Colors:
|
||||||
- _BaseCol: {r: 0.23429155, g: 0.28497556, b: 0.3679245, a: 0}
|
- _BaseCol: {r: 0.23429155, g: 0.28497556, b: 0.3679245, a: 0}
|
||||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
|
|
||||||
|
|
@ -25827,7 +25827,7 @@ PrefabInstance:
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 7587649942819475418, guid: 87ec8db29445cbe4b81cdbb1df57859f, type: 3}
|
- target: {fileID: 7587649942819475418, guid: 87ec8db29445cbe4b81cdbb1df57859f, type: 3}
|
||||||
propertyPath: m_IsActive
|
propertyPath: m_IsActive
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 8555740474756033510, guid: 87ec8db29445cbe4b81cdbb1df57859f, type: 3}
|
- target: {fileID: 8555740474756033510, guid: 87ec8db29445cbe4b81cdbb1df57859f, type: 3}
|
||||||
propertyPath: m_Enabled
|
propertyPath: m_Enabled
|
||||||
|
|
@ -26759,7 +26759,6 @@ GameObject:
|
||||||
serializedVersion: 6
|
serializedVersion: 6
|
||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 1505150131}
|
- component: {fileID: 1505150131}
|
||||||
- component: {fileID: 1505150132}
|
|
||||||
- component: {fileID: 1505150133}
|
- component: {fileID: 1505150133}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Mangner
|
m_Name: Mangner
|
||||||
|
|
@ -26783,31 +26782,6 @@ Transform:
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!114 &1505150132
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 1505150129}
|
|
||||||
m_Enabled: 0
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: e33923dee0d2a0f4f81ca859f6fc70d5, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
Tool:
|
|
||||||
- {fileID: 1422411946}
|
|
||||||
- {fileID: 895989071}
|
|
||||||
- {fileID: 0}
|
|
||||||
- {fileID: 0}
|
|
||||||
- {fileID: 1112936940}
|
|
||||||
- {fileID: 588400109}
|
|
||||||
- {fileID: 1485260145}
|
|
||||||
- {fileID: 2018635915}
|
|
||||||
ui: {fileID: 1393670468}
|
|
||||||
processBt: {fileID: 1290596210}
|
|
||||||
PutBack: {fileID: 506401300}
|
|
||||||
RetractToolBtn: []
|
|
||||||
--- !u!114 &1505150133
|
--- !u!114 &1505150133
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -26845,7 +26819,14 @@ MonoBehaviour:
|
||||||
returnButton: {fileID: 587729411}
|
returnButton: {fileID: 587729411}
|
||||||
originalPosition: {x: 0, y: 0, z: 0}
|
originalPosition: {x: 0, y: 0, z: 0}
|
||||||
originalRotation: {x: 0, y: 0, z: 0, w: 0}
|
originalRotation: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
onladderTools:
|
||||||
|
- {fileID: 4441233656616589336}
|
||||||
|
- {fileID: 1112936940}
|
||||||
|
- {fileID: 588400109}
|
||||||
|
- {fileID: 1485260145}
|
||||||
|
- {fileID: 2018635915}
|
||||||
PlayercameraTrans: {fileID: 6121626523118833240}
|
PlayercameraTrans: {fileID: 6121626523118833240}
|
||||||
|
Fieldobservation: {fileID: 6121626523908351180}
|
||||||
--- !u!1 &1511629609
|
--- !u!1 &1511629609
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -33307,6 +33288,7 @@ MonoBehaviour:
|
||||||
- {fileID: 1869768458}
|
- {fileID: 1869768458}
|
||||||
- {fileID: 156402808}
|
- {fileID: 156402808}
|
||||||
- {fileID: 587729411}
|
- {fileID: 587729411}
|
||||||
|
inthis: 0
|
||||||
--- !u!114 &1810323354
|
--- !u!114 &1810323354
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -33339,8 +33321,8 @@ BoxCollider:
|
||||||
m_ProvidesContacts: 0
|
m_ProvidesContacts: 0
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_Size: {x: 1, y: 1, z: 1}
|
m_Size: {x: 1, y: 0.27271962, z: 1}
|
||||||
m_Center: {x: 0, y: 0, z: 0}
|
m_Center: {x: 0, y: -0.3636381, z: 0}
|
||||||
--- !u!23 &1810323356
|
--- !u!23 &1810323356
|
||||||
MeshRenderer:
|
MeshRenderer:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -35920,6 +35902,7 @@ GameObject:
|
||||||
serializedVersion: 6
|
serializedVersion: 6
|
||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 1987581050}
|
- component: {fileID: 1987581050}
|
||||||
|
- component: {fileID: 1987581051}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: UptheladderPos
|
m_Name: UptheladderPos
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
|
@ -35942,6 +35925,27 @@ Transform:
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
|
||||||
|
--- !u!65 &1987581051
|
||||||
|
BoxCollider:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1987581049}
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_IncludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_ExcludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_LayerOverridePriority: 0
|
||||||
|
m_IsTrigger: 1
|
||||||
|
m_ProvidesContacts: 0
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 3
|
||||||
|
m_Size: {x: 0.64779663, y: 0.311777, z: 0.7752075}
|
||||||
|
m_Center: {x: 0.08128357, y: -0.17483073, z: 0.044403076}
|
||||||
--- !u!1 &1994043557
|
--- !u!1 &1994043557
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -229959,6 +229963,10 @@ PrefabInstance:
|
||||||
propertyPath: m_LocalEulerAnglesHint.z
|
propertyPath: m_LocalEulerAnglesHint.z
|
||||||
value: 0
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3250306475833635928, guid: 8b993b62b75a2c8438fceaa4a463c01a, type: 3}
|
||||||
|
propertyPath: m_BlendShapeWeights.Array.data[0]
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4466956671881593809, guid: 8b993b62b75a2c8438fceaa4a463c01a, type: 3}
|
- target: {fileID: 4466956671881593809, guid: 8b993b62b75a2c8438fceaa4a463c01a, type: 3}
|
||||||
propertyPath: m_Text
|
propertyPath: m_Text
|
||||||
value: "\u6536\u56DE\u68AF\u5B50"
|
value: "\u6536\u56DE\u68AF\u5B50"
|
||||||
|
|
@ -230512,6 +230520,7 @@ MonoBehaviour:
|
||||||
mensuo01: {fileID: 601364445}
|
mensuo01: {fileID: 601364445}
|
||||||
guimenbox: {fileID: 522830941}
|
guimenbox: {fileID: 522830941}
|
||||||
fengy: {fileID: 1143738318}
|
fengy: {fileID: 1143738318}
|
||||||
|
isPlayerOnLadder: 0
|
||||||
--- !u!114 &6121626523908351181
|
--- !u!114 &6121626523908351181
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
|
|
@ -28,11 +28,17 @@ public class ToolManager : MonoBehaviour
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Button[] RetractBtn;
|
public Button[] RetractBtn;
|
||||||
|
|
||||||
bool inthis;
|
public bool inthis = false;
|
||||||
|
|
||||||
|
public static ToolManager instans;
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
instans = this;
|
||||||
|
}
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
|
|
||||||
//inthis = true;
|
//inthis = true;
|
||||||
generateAreaScript = generateArea.GetComponent<GenerateArea>();
|
generateAreaScript = generateArea.GetComponent<GenerateArea>();
|
||||||
MotionEngine.GetModule<AnimationProcessManager>().OnUIEvent += UIEvent;
|
MotionEngine.GetModule<AnimationProcessManager>().OnUIEvent += UIEvent;
|
||||||
|
|
@ -73,63 +79,146 @@ public class ToolManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
ui.SetActive(false);
|
ui.SetActive(false);
|
||||||
});
|
});
|
||||||
MotionEngine.GetModule<ToolsPackManager>().OnStringEvent += HandleStringEvent;
|
MotionEngine.GetModule<ToolsPackManager>().OnStringEvent += HandleStringEvents;
|
||||||
|
|
||||||
|
//MotionEngine.GetModule<ToolsPackManager>().OnStringEvent += HandleStringEvent;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
//if (RoleMove.instance.isup)
|
||||||
|
//{
|
||||||
|
// MotionEngine.GetModule<ToolsPackManager>().OnStringEvent += HandleStringEvent;
|
||||||
|
// Debug.Log("在梯子上:");
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// MotionEngine.GetModule<ToolsPackManager>().OnStringEvent -= HandleStringEvent;
|
||||||
|
// Debug.Log("不在梯子上:");
|
||||||
|
//}
|
||||||
|
Debug.Log("是否在梯子上:" + RoleMove.instance.isup);
|
||||||
|
}
|
||||||
private void UIEvent()
|
private void UIEvent()
|
||||||
{
|
{
|
||||||
ui.SetActive(true);
|
ui.SetActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void HandleStringEvent(string message)
|
public void HandleTiZiEvent(string message)
|
||||||
{
|
|
||||||
if (generateAreaScript.IsPlayerInArea())
|
|
||||||
{
|
{
|
||||||
if (message == "炅綾")
|
if (generateAreaScript.IsPlayerInArea())
|
||||||
{
|
{
|
||||||
Tool[0].gameObject.SetActive(true);
|
if (message == "梯子")
|
||||||
Ladder.instance.Init();
|
{
|
||||||
//Ladder.instance.smr.SetBlendShapeWeight(0, 0);
|
Tool[0].gameObject.SetActive(true);
|
||||||
|
Ladder.instance.Init();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (message == "묏鱗聯")
|
}
|
||||||
|
public void HandleStringEvent(string message)
|
||||||
|
{
|
||||||
|
if (generateAreaScript.IsPlayerInArea())
|
||||||
{
|
{
|
||||||
Tool[1].gameObject.SetActive(true);
|
if (message == "梯子")
|
||||||
}
|
{
|
||||||
if (message == "괆窟풂")
|
Tool[0].gameObject.SetActive(true);
|
||||||
{
|
Ladder.instance.Init();
|
||||||
Tool[2].gameObject.SetActive(true);
|
}
|
||||||
|
if (message == "工作证")
|
||||||
|
{
|
||||||
|
Tool[1].gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
if (message == "剥线钳")
|
||||||
|
{
|
||||||
|
Tool[2].gameObject.SetActive(true);
|
||||||
RetractBtn[0].gameObject.SetActive(true);
|
RetractBtn[0].gameObject.SetActive(true);
|
||||||
}
|
}
|
||||||
if (message == "駱든궝")
|
if (message == "验电笔")
|
||||||
{
|
{
|
||||||
Tool[3].gameObject.SetActive(true);
|
Tool[3].gameObject.SetActive(true);
|
||||||
RetractBtn[1].gameObject.SetActive(true);
|
RetractBtn[1].gameObject.SetActive(true);
|
||||||
}
|
}
|
||||||
if (message == "쭁介독")
|
if (message == "螺丝刀")
|
||||||
{
|
{
|
||||||
Tool[4].gameObject.SetActive(true);
|
Tool[4].gameObject.SetActive(true);
|
||||||
RetractBtn[2].gameObject.SetActive(true);
|
RetractBtn[2].gameObject.SetActive(true);
|
||||||
}
|
}
|
||||||
if (message == "없鍍스던")
|
if (message == "绝缘胶带")
|
||||||
{
|
{
|
||||||
Tool[5].gameObject.SetActive(true);
|
Tool[5].gameObject.SetActive(true);
|
||||||
RetractBtn[3].gameObject.SetActive(true);
|
RetractBtn[3].gameObject.SetActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message == "l謹섞櫓포")
|
if (message == "l型集中器")
|
||||||
{
|
{
|
||||||
Tool[6].gameObject.SetActive(true);
|
Tool[6].gameObject.SetActive(true);
|
||||||
RetractBtn[4].gameObject.SetActive(true);
|
RetractBtn[4].gameObject.SetActive(true);
|
||||||
}
|
}
|
||||||
if (message == "분陋룐丹")
|
if (message == "盒装封印")
|
||||||
{
|
{
|
||||||
Tool[7].gameObject.SetActive(true);
|
Tool[7].gameObject.SetActive(true);
|
||||||
RetractBtn[5].gameObject.SetActive(true);
|
RetractBtn[5].gameObject.SetActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.Log("Received message: " + message);
|
Debug.Log("Received message: " + message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} }
|
public void HandleStringEvents(string message)
|
||||||
|
{
|
||||||
|
if (generateAreaScript.IsPlayerInArea())
|
||||||
|
{
|
||||||
|
if (message == "梯子")
|
||||||
|
{
|
||||||
|
Tool[0].gameObject.SetActive(true);
|
||||||
|
Ladder.instance.Init();
|
||||||
|
}
|
||||||
|
if (message == "验电笔")
|
||||||
|
{
|
||||||
|
Tool[3].gameObject.SetActive(true);
|
||||||
|
RetractBtn[1].gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (RoleMove.instance.isup)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (generateAreaScript.IsPlayerInArea())
|
||||||
|
{
|
||||||
|
if (message == "工作证")
|
||||||
|
{
|
||||||
|
Tool[1].gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
if (message == "剥线钳")
|
||||||
|
{
|
||||||
|
Tool[2].gameObject.SetActive(true);
|
||||||
|
RetractBtn[0].gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (message == "螺丝刀")
|
||||||
|
{
|
||||||
|
Tool[4].gameObject.SetActive(true);
|
||||||
|
RetractBtn[2].gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
if (message == "绝缘胶带")
|
||||||
|
{
|
||||||
|
Tool[5].gameObject.SetActive(true);
|
||||||
|
RetractBtn[3].gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (message == "l型集中器")
|
||||||
|
{
|
||||||
|
Tool[6].gameObject.SetActive(true);
|
||||||
|
RetractBtn[4].gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
if (message == "盒装封印")
|
||||||
|
{
|
||||||
|
Tool[7].gameObject.SetActive(true);
|
||||||
|
RetractBtn[5].gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Log("Received message: " + message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,45 +0,0 @@
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.UI;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
public class ToolsManager : MonoBehaviour
|
|
||||||
{
|
|
||||||
[System.Serializable]
|
|
||||||
public class Tool
|
|
||||||
{
|
|
||||||
public GameObject toolObject;
|
|
||||||
public Button returnButton;
|
|
||||||
[HideInInspector]
|
|
||||||
public Vector3 originalPosition;
|
|
||||||
[HideInInspector]
|
|
||||||
public Quaternion originalRotation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Tool> tools;
|
|
||||||
|
|
||||||
void Start()
|
|
||||||
{
|
|
||||||
foreach (var tool in tools)
|
|
||||||
{
|
|
||||||
// 保存每个工具的原始位置和旋转
|
|
||||||
tool.originalPosition = tool.toolObject.transform.localPosition;
|
|
||||||
tool.originalRotation = tool.toolObject.transform.localRotation;
|
|
||||||
|
|
||||||
// 为每个按钮添加点击事件
|
|
||||||
tool.returnButton.onClick.AddListener(ResetAllTools);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 返回所有工具到原始位置并隐藏
|
|
||||||
public void ResetAllTools()
|
|
||||||
{
|
|
||||||
foreach (var tool in tools)
|
|
||||||
{
|
|
||||||
tool.toolObject.transform.localPosition = tool.originalPosition;
|
|
||||||
tool.toolObject.transform.localRotation = tool.originalRotation;
|
|
||||||
tool.toolObject.SetActive(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 91bb429240832294496ccae011ddc438
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
using MotionFramework;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using ToolsPack;
|
using ToolsPack;
|
||||||
|
|
@ -6,7 +7,6 @@ using UnityEngine.UI;
|
||||||
|
|
||||||
public class LadderTrigger : MonoBehaviour
|
public class LadderTrigger : MonoBehaviour
|
||||||
{
|
{
|
||||||
//public ToolsPackGameObjectComponent ladder;
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 玩家相机
|
/// 玩家相机
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -41,8 +41,12 @@ public class LadderTrigger : MonoBehaviour
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 梯子动画
|
/// 梯子动画
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public SkinnedMeshRenderer ladderski;
|
public SkinnedMeshRenderer ladderski;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 判断是否在梯子上
|
||||||
|
/// </summary>
|
||||||
|
public bool isPlayerOnLadder = false;
|
||||||
public void Awake()
|
public void Awake()
|
||||||
{
|
{
|
||||||
instance = this;
|
instance = this;
|
||||||
|
|
@ -63,8 +67,8 @@ public class LadderTrigger : MonoBehaviour
|
||||||
RoleMove.instance.isup = true;
|
RoleMove.instance.isup = true;
|
||||||
});
|
});
|
||||||
//下梯子按钮
|
//下梯子按钮
|
||||||
DownladderBtn.onClick.AddListener(() =>
|
DownladderBtn.onClick.AddListener(() =>
|
||||||
{
|
{
|
||||||
RoleMove.instance.isup = false;
|
RoleMove.instance.isup = false;
|
||||||
FirstPersonController.instance.playerCanMove = true;
|
FirstPersonController.instance.playerCanMove = true;
|
||||||
CameraPlayer.GetComponent<CapsuleCollider>().enabled = true;
|
CameraPlayer.GetComponent<CapsuleCollider>().enabled = true;
|
||||||
|
|
@ -74,14 +78,15 @@ public class LadderTrigger : MonoBehaviour
|
||||||
TakeBackBtn.gameObject.SetActive(true);
|
TakeBackBtn.gameObject.SetActive(true);
|
||||||
CameraPlayer.GetComponent<Rigidbody>().useGravity = true;
|
CameraPlayer.GetComponent<Rigidbody>().useGravity = true;
|
||||||
CameraPlayer.GetComponentInChildren<Camera>().fieldOfView = 60;
|
CameraPlayer.GetComponentInChildren<Camera>().fieldOfView = 60;
|
||||||
|
TooslManager.instance.ResetAllTools();
|
||||||
});
|
});
|
||||||
//收回梯子按钮
|
//收回梯子按钮
|
||||||
TakeBackBtn.onClick.AddListener(() =>
|
TakeBackBtn.onClick.AddListener(() =>
|
||||||
{
|
{
|
||||||
UpladderBtn.gameObject.SetActive(false);
|
UpladderBtn.gameObject.SetActive(false);
|
||||||
LadderObj.gameObject.SetActive (false);
|
LadderObj.gameObject.SetActive(false);
|
||||||
CameraPlayer.GetComponentInChildren<Camera>().fieldOfView = 60;
|
CameraPlayer.GetComponentInChildren<Camera>().fieldOfView = 60;
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -93,8 +98,10 @@ public class LadderTrigger : MonoBehaviour
|
||||||
TakeBackBtn.gameObject.SetActive(true);
|
TakeBackBtn.gameObject.SetActive(true);
|
||||||
//FirstPersonController.instance.playerCanMove = false;
|
//FirstPersonController.instance.playerCanMove = false;
|
||||||
Debug.Log(other.name);
|
Debug.Log(other.name);
|
||||||
|
// isPlayerOnLadder = true;
|
||||||
//ladder.OnPersonClose();
|
//ladder.OnPersonClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
private void OnTriggerExit(Collider other)
|
private void OnTriggerExit(Collider other)
|
||||||
{
|
{
|
||||||
|
|
@ -103,7 +110,7 @@ public class LadderTrigger : MonoBehaviour
|
||||||
UpladderBtn.gameObject.SetActive(false);
|
UpladderBtn.gameObject.SetActive(false);
|
||||||
TakeBackBtn.gameObject.SetActive(false);
|
TakeBackBtn.gameObject.SetActive(false);
|
||||||
Debug.Log(other.name);
|
Debug.Log(other.name);
|
||||||
//ladder.OnPersonAway();
|
//isPlayerOnLadder = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ using HighlightPlus;
|
||||||
|
|
||||||
public class Fieldobservation : MonoBehaviour
|
public class Fieldobservation : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
public static Fieldobservation Instance;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 玩家相机
|
/// 玩家相机
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -77,6 +78,15 @@ public class Fieldobservation : MonoBehaviour
|
||||||
public BoxCollider guimenbox;
|
public BoxCollider guimenbox;
|
||||||
|
|
||||||
public GameObject fengy;
|
public GameObject fengy;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 判断是否在梯子上
|
||||||
|
/// </summary>
|
||||||
|
public bool isPlayerOnLadder = false;
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
Instance = this;
|
||||||
|
}
|
||||||
//public HighlightEffect _highlight;
|
//public HighlightEffect _highlight;
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
|
|
@ -95,10 +105,10 @@ public class Fieldobservation : MonoBehaviour
|
||||||
if (hit.collider.gameObject.name == "盖_透明外壳")
|
if (hit.collider.gameObject.name == "盖_透明外壳")
|
||||||
{
|
{
|
||||||
StartCoroutine(IEparentoverSeal());
|
StartCoroutine(IEparentoverSeal());
|
||||||
|
|
||||||
BOXseal[0].enabled = true;
|
BOXseal[0].enabled = true;
|
||||||
BOXseal[1].enabled = true;
|
BOXseal[1].enabled = true;
|
||||||
//isbox = false;
|
//isbox = false;
|
||||||
|
|
||||||
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
||||||
|
|
||||||
|
|
@ -109,7 +119,7 @@ public class Fieldobservation : MonoBehaviour
|
||||||
if (isbox)
|
if (isbox)
|
||||||
{
|
{
|
||||||
parentoverSeal[0].gameObject.SetActive(true);
|
parentoverSeal[0].gameObject.SetActive(true);
|
||||||
isbox = false;
|
isbox = false;
|
||||||
}
|
}
|
||||||
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
||||||
}
|
}
|
||||||
|
|
@ -118,7 +128,7 @@ public class Fieldobservation : MonoBehaviour
|
||||||
if (isbox)
|
if (isbox)
|
||||||
{
|
{
|
||||||
parentoverSeal[1].gameObject.SetActive(true);
|
parentoverSeal[1].gameObject.SetActive(true);
|
||||||
guimenkashuan.enabled = true;
|
guimenkashuan.enabled = true;
|
||||||
isbox = false;
|
isbox = false;
|
||||||
}
|
}
|
||||||
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
||||||
|
|
@ -128,9 +138,9 @@ public class Fieldobservation : MonoBehaviour
|
||||||
StartCoroutine(IEguimenkashuan());
|
StartCoroutine(IEguimenkashuan());
|
||||||
//if (isbox)
|
//if (isbox)
|
||||||
//{
|
//{
|
||||||
guimenbox.GetComponent<BoxCollider>().enabled = true;
|
guimenbox.GetComponent<BoxCollider>().enabled = true;
|
||||||
isbox = false;
|
isbox = false;
|
||||||
// }
|
// }
|
||||||
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
||||||
}
|
}
|
||||||
if (hit.collider.gameObject.name == "电柜门封印box碰撞")
|
if (hit.collider.gameObject.name == "电柜门封印box碰撞")
|
||||||
|
|
@ -143,6 +153,22 @@ public class Fieldobservation : MonoBehaviour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnTriggerEnter(Collider other)
|
||||||
|
{
|
||||||
|
if (other.gameObject.name == "UptheladderPos")
|
||||||
|
{
|
||||||
|
isPlayerOnLadder = true;
|
||||||
|
Debug.Log(other.name);
|
||||||
|
//ladder.OnPersonClose();
|
||||||
|
}
|
||||||
|
if (other.gameObject.name == "检测是否到达场景后拿取工具碰撞")
|
||||||
|
{
|
||||||
|
isPlayerOnLadder = false;
|
||||||
|
Debug.Log(other.name);
|
||||||
|
//ladder.OnPersonClose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户离开npc警告按钮消失
|
/// 用户离开npc警告按钮消失
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -153,22 +179,27 @@ public class Fieldobservation : MonoBehaviour
|
||||||
{
|
{
|
||||||
ExclamationPointBtn.gameObject.SetActive(false);
|
ExclamationPointBtn.gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsPlayerOnLadder()
|
||||||
|
{
|
||||||
|
return isPlayerOnLadder;
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 透明外盖上的封印
|
/// 透明外盖上的封印
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
IEnumerator IEparentoverSeal()
|
IEnumerator IEparentoverSeal()
|
||||||
{
|
{
|
||||||
Transparentover.transform.localPosition=new Vector3(0, 0, 0);
|
Transparentover.transform.localPosition = new Vector3(0, 0, 0);
|
||||||
yield return new WaitForSeconds(1f);
|
yield return new WaitForSeconds(1f);
|
||||||
screw[0].gameObject.SetActive(true);
|
screw[0].gameObject.SetActive(true);
|
||||||
yield return new WaitForSeconds(0.5f);
|
yield return new WaitForSeconds(0.5f);
|
||||||
screw[0].transform.localPosition = new Vector3(-0.07357633f, -0.01137948f, 0.003414989f);
|
screw[0].transform.localPosition = new Vector3(-0.07357633f, -0.01137948f, 0.003414989f);
|
||||||
screw[1].gameObject.SetActive(true);
|
screw[1].gameObject.SetActive(true);
|
||||||
yield return new WaitForSeconds(1.5f);
|
yield return new WaitForSeconds(1.5f);
|
||||||
screw[1].transform.localPosition = new Vector3(0.07394123f, 0.013731f, 0.003414989f);
|
screw[1].transform.localPosition = new Vector3(0.07394123f, 0.013731f, 0.003414989f);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,21 @@ public class TooslManager : MonoBehaviour
|
||||||
|
|
||||||
public List<Tool> tools;
|
public List<Tool> tools;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 在梯子上使用的工具
|
||||||
|
/// </summary>
|
||||||
|
public GameObject[] onladderTools;
|
||||||
|
|
||||||
public Transform PlayercameraTrans;
|
public Transform PlayercameraTrans;
|
||||||
|
|
||||||
public static TooslManager instance;
|
public static TooslManager instance;
|
||||||
|
|
||||||
public void Awake()
|
/// <summary>
|
||||||
|
/// 引用Ladder脚本
|
||||||
|
/// </summary>
|
||||||
|
public Fieldobservation Fieldobservation;
|
||||||
|
|
||||||
|
public void Awake()
|
||||||
{
|
{
|
||||||
instance = this;
|
instance = this;
|
||||||
}
|
}
|
||||||
|
|
@ -41,12 +51,15 @@ public class TooslManager : MonoBehaviour
|
||||||
// 保存每个工具的原始位置和旋转
|
// 保存每个工具的原始位置和旋转
|
||||||
tool.originalPosition = tool.toolObject.transform.localPosition;
|
tool.originalPosition = tool.toolObject.transform.localPosition;
|
||||||
tool.originalRotation = tool.toolObject.transform.localRotation;
|
tool.originalRotation = tool.toolObject.transform.localRotation;
|
||||||
Debug.Log("第一个位置:"+ tool.originalPosition);
|
Debug.Log("第一个位置:" + tool.originalPosition);
|
||||||
// 为每个按钮添加点击事件
|
// 为每个按钮添加点击事件
|
||||||
tool.returnButton.onClick.AddListener(ResetAllTools);
|
tool.returnButton.onClick.AddListener(ResetAllTools);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
// 返回所有工具到原始位置并隐藏
|
// 返回所有工具到原始位置并隐藏
|
||||||
public void ResetAllTools()
|
public void ResetAllTools()
|
||||||
{
|
{
|
||||||
|
|
@ -59,4 +72,35 @@ public class TooslManager : MonoBehaviour
|
||||||
Debug.Log("第二个位置:" + tool.originalPosition);
|
Debug.Log("第二个位置:" + tool.originalPosition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 梯子上禁用
|
||||||
|
///// </summary>
|
||||||
|
//void DisableTools()
|
||||||
|
//{
|
||||||
|
// foreach (GameObject tool in onladderTools)
|
||||||
|
// {
|
||||||
|
// // 禁用工具
|
||||||
|
// tool.SetActive(false);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 梯子上可以使用
|
||||||
|
///// </summary>
|
||||||
|
//void UseTools()
|
||||||
|
//{
|
||||||
|
// foreach (GameObject tool in onladderTools)
|
||||||
|
// {
|
||||||
|
// // 启用工具,模拟使用工具的效果
|
||||||
|
// tool.SetActive(true);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
void ToggleTools(bool activate)
|
||||||
|
{
|
||||||
|
foreach (GameObject tool in onladderTools)
|
||||||
|
{
|
||||||
|
tool.SetActive(activate);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue