6.18日上午提交

This commit is contained in:
taosuqi 2024-06-18 10:47:03 +08:00
parent d59c376ec8
commit cdd7bf0bfc
19 changed files with 10902 additions and 10188 deletions

View File

@ -0,0 +1,30 @@
using UnityEngine;
public class GenerateArea : MonoBehaviour
{
public bool playerInArea = false;
void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player"))
{
Debug.Log("OnTriggerEnter");
playerInArea = true;
}
}
void OnTriggerExit(Collider other)
{
if (other.CompareTag("Player"))
{
Debug.Log("OnTriggerExit");
playerInArea = false;
}
}
public bool IsPlayerInArea()
{
return playerInArea;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f1ea4a5b273534447af5438960064a8f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -30,6 +30,7 @@ public class Ladder : MonoBehaviour
{
weight += 1.8f;
smr.SetBlendShapeWeight(0, weight);
Debug.Log(show);
}
}
}

View File

@ -8,33 +8,41 @@ PrefabInstance:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: b3a82017d7338d04fa5b8d7a3932cb9d, type: 3}
propertyPath: m_LocalScale.x
value: 0.0010000004
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: b3a82017d7338d04fa5b8d7a3932cb9d, type: 3}
propertyPath: m_LocalScale.z
value: 0.0010000004
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: b3a82017d7338d04fa5b8d7a3932cb9d, type: 3}
propertyPath: m_LocalPosition.x
value: -1.4711838
value: 0.352
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: b3a82017d7338d04fa5b8d7a3932cb9d, type: 3}
propertyPath: m_LocalPosition.y
value: 0.07306337
value: -0.192
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: b3a82017d7338d04fa5b8d7a3932cb9d, type: 3}
propertyPath: m_LocalPosition.z
value: 0.13374138
value: 0.611
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: b3a82017d7338d04fa5b8d7a3932cb9d, type: 3}
propertyPath: m_LocalRotation.w
value: 0.7071068
value: 0.00004631281
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: b3a82017d7338d04fa5b8d7a3932cb9d, type: 3}
propertyPath: m_LocalRotation.x
value: -0.7071068
value: -0.000000059601884
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: b3a82017d7338d04fa5b8d7a3932cb9d, type: 3}
propertyPath: m_LocalRotation.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: b3a82017d7338d04fa5b8d7a3932cb9d, type: 3}
propertyPath: m_LocalRotation.z
value: -0
value: 0.000000059601884
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: b3a82017d7338d04fa5b8d7a3932cb9d, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
@ -42,16 +50,28 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: b3a82017d7338d04fa5b8d7a3932cb9d, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
value: 90
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: b3a82017d7338d04fa5b8d7a3932cb9d, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -3887185075125053422, guid: b3a82017d7338d04fa5b8d7a3932cb9d, type: 3}
propertyPath: m_UpdateWhenOffscreen
value: 1
objectReference: {fileID: 0}
- target: {fileID: -3887185075125053422, guid: b3a82017d7338d04fa5b8d7a3932cb9d, type: 3}
propertyPath: m_BlendShapeWeights.Array.data[0]
value: 100
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: b3a82017d7338d04fa5b8d7a3932cb9d, type: 3}
propertyPath: m_Name
value: "\u5265\u7EBF\u94B3"
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: b3a82017d7338d04fa5b8d7a3932cb9d, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2223639932434330405, guid: b3a82017d7338d04fa5b8d7a3932cb9d, type: 3}
propertyPath: m_Enabled
value: 0
@ -70,7 +90,18 @@ PrefabInstance:
- targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: b3a82017d7338d04fa5b8d7a3932cb9d, type: 3}
insertIndex: -1
addedObject: {fileID: 2686997889178815087}
- targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: b3a82017d7338d04fa5b8d7a3932cb9d, type: 3}
insertIndex: -1
addedObject: {fileID: 215567476133548564}
- targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: b3a82017d7338d04fa5b8d7a3932cb9d, type: 3}
insertIndex: -1
addedObject: {fileID: 174367584204299598}
m_SourcePrefab: {fileID: 100100000, guid: b3a82017d7338d04fa5b8d7a3932cb9d, type: 3}
--- !u!137 &887944540873686423 stripped
SkinnedMeshRenderer:
m_CorrespondingSourceObject: {fileID: -3887185075125053422, guid: b3a82017d7338d04fa5b8d7a3932cb9d, type: 3}
m_PrefabInstance: {fileID: 5070891681327179141}
m_PrefabAsset: {fileID: 0}
--- !u!1 &5376740296190089428 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: b3a82017d7338d04fa5b8d7a3932cb9d, type: 3}
@ -278,3 +309,39 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
_modelTypeEnum: 0
_toolsPackScene: 0
IsClick: 1
--- !u!114 &215567476133548564
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5376740296190089428}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b47ec41343fb25f4e81cbeceb223bc5a, type: 3}
m_Name:
m_EditorClassIdentifier:
PliersObj: {fileID: 5376740296190089428}
PliersSki: {fileID: 887944540873686423}
ElectricBoxSkinnedMeshRenderer: {fileID: 0}
RightSkinnedMeshRenderer: {fileID: 0}
LeftSkinnedMeshRenderer: {fileID: 0}
RconcentratorSMR: {fileID: 0}
LconcentratorSMR: {fileID: 0}
Doorlock: {fileID: 0}
DoorOfCabinet: {fileID: 0}
ElectricBoxTrans: {fileID: 0}
--- !u!114 &174367584204299598
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5376740296190089428}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8a2ec57d86080374dbadae4c9f35d207, type: 3}
m_Name:
m_EditorClassIdentifier:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 4c90b7b8da3aea8479291787df5f4576
guid: 8b993b62b75a2c8438fceaa4a463c01a
PrefabImporter:
externalObjects: {}
userData:

View File

@ -171,10 +171,182 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1704537153627828281, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0.8999939
objectReference: {fileID: 0}
- target: {fileID: 1749552120815238681, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_Pivot.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1749552120815238681, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_Pivot.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1749552120815238681, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1749552120815238681, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1749552120815238681, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchoredPosition.x
value: 46
objectReference: {fileID: 0}
- target: {fileID: 1749552120815238681, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchoredPosition.y
value: -165
objectReference: {fileID: 0}
- target: {fileID: 2206665272684405357, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchoredPosition.y
value: 1.9000015
objectReference: {fileID: 0}
- target: {fileID: 2264434391528534163, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_Pivot.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2264434391528534163, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_Pivot.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2264434391528534163, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2264434391528534163, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2264434391528534163, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchoredPosition.x
value: 46
objectReference: {fileID: 0}
- target: {fileID: 2264434391528534163, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchoredPosition.y
value: -289
objectReference: {fileID: 0}
- target: {fileID: 3097030627198115247, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_Pivot.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3097030627198115247, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_Pivot.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3097030627198115247, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3097030627198115247, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3097030627198115247, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchoredPosition.x
value: 46
objectReference: {fileID: 0}
- target: {fileID: 3097030627198115247, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchoredPosition.y
value: 195
objectReference: {fileID: 0}
- target: {fileID: 6026879024415736155, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_Name
value: APP
objectReference: {fileID: 0}
- target: {fileID: 6205274277508386708, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_Interactable
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6780964861112113625, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_Pivot.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6780964861112113625, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 6780964861112113625, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchorMax.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 6780964861112113625, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchorMin.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 6780964861112113625, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchoredPosition.x
value: 46
objectReference: {fileID: 0}
- target: {fileID: 6780964861112113625, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchoredPosition.y
value: -48
objectReference: {fileID: 0}
- target: {fileID: 7642526006322022173, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_Pivot.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7642526006322022173, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_Pivot.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7642526006322022173, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7642526006322022173, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7642526006322022173, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchoredPosition.x
value: 46
objectReference: {fileID: 0}
- target: {fileID: 7642526006322022173, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchoredPosition.y
value: 319
objectReference: {fileID: 0}
- target: {fileID: 7723637748511984179, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0.9000015
objectReference: {fileID: 0}
- target: {fileID: 8014322703218229613, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_Pivot.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8014322703218229613, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_Pivot.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8014322703218229613, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8014322703218229613, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8014322703218229613, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8014322703218229613, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8014322703218229613, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchoredPosition.x
value: 46
objectReference: {fileID: 0}
- target: {fileID: 8014322703218229613, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchoredPosition.y
value: -413
objectReference: {fileID: 0}
- target: {fileID: 8596559721611729123, guid: fa12b84946083d14cb4447029910be28, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0.9000015
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []

View File

@ -10960,6 +10960,10 @@ PrefabInstance:
propertyPath: IsClick
value: 1
objectReference: {fileID: 0}
- target: {fileID: 601239814988989792, guid: 7e42ad4821305374ba380adcf42bf09b, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 670462147742735335, guid: 7e42ad4821305374ba380adcf42bf09b, type: 3}
propertyPath: IsClick
value: 1
@ -10972,6 +10976,10 @@ PrefabInstance:
propertyPath: m_Name
value: "\u5DE5\u5177"
objectReference: {fileID: 0}
- target: {fileID: 1070283601469731040, guid: 7e42ad4821305374ba380adcf42bf09b, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1135580117868787308, guid: 7e42ad4821305374ba380adcf42bf09b, type: 3}
propertyPath: IsClick
value: 1
@ -10996,6 +11004,10 @@ PrefabInstance:
propertyPath: IsClick
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3025278994677100169, guid: 7e42ad4821305374ba380adcf42bf09b, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3767477368236412959, guid: 7e42ad4821305374ba380adcf42bf09b, type: 3}
propertyPath: IsClick
value: 1
@ -11052,6 +11064,10 @@ PrefabInstance:
propertyPath: IsClick
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6601399795821314724, guid: 7e42ad4821305374ba380adcf42bf09b, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6763588455289719455, guid: 7e42ad4821305374ba380adcf42bf09b, type: 3}
propertyPath: IsClick
value: 1
@ -27235,7 +27251,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -37.700195, y: -224.09998}
m_AnchoredPosition: {x: -67, y: -154}
m_SizeDelta: {x: 200, y: 46}
m_Pivot: {x: 0.99999964, y: 1.0000002}
--- !u!114 &1992983541

View File

@ -0,0 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SetToParent : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3ac993d98ca1c3d47b28cf2a9d81d94f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,122 @@
using MotionFramework;
using System.Collections;
using System.Collections.Generic;
using DefaultNamespace.ProcessMode;
using UnityEngine;
using UnityEngine.UI;
public class ToolManager : MonoBehaviour
{
//public GameObject toolPrefab; // 要生成的工具预制体
public Transform generateArea; // 生成区域的Transform
private GenerateArea generateAreaScript;
public GameObject ui;
public Button processBt;
/// <summary>
/// 放回背包按钮
/// </summary>
public Button PutBack;
public GameObject[] Tool;
bool inthis;
void Start()
{
//inthis = true;
generateAreaScript = generateArea.GetComponent<GenerateArea>();
MotionEngine.GetModule<AnimationProcessManager>().OnUIEvent += UIEvent;
PutBack.onClick.AddListener(() =>
{
if (Tool[0].activeInHierarchy)
{
Tool[0].gameObject.SetActive(false);
Ladder.instance.closed();
}
if (Tool[1].activeInHierarchy)
{
Tool[1].gameObject.SetActive(false);
}
if (Tool[2].activeInHierarchy)
{
Tool[2].gameObject.SetActive(false);
}
if (Tool[3].activeInHierarchy)
{
Tool[3].gameObject.SetActive(false);
}
if (Tool[4].activeInHierarchy)
{
Tool[4].gameObject.SetActive(false);
}
if (Tool[5].activeInHierarchy)
{
Tool[5].gameObject.SetActive(false);
}
if (Tool[6].activeInHierarchy)
{
Tool[6].gameObject.SetActive(false);
}
});
processBt.onClick.AddListener(delegate
{
ui.SetActive(false);
});
MotionEngine.GetModule<ToolsPackManager>().OnStringEvent += HandleStringEvent;
}
private void UIEvent()
{
ui.SetActive(true);
}
private void HandleStringEvent(string message)
{
if (generateAreaScript.IsPlayerInArea())
{
if (message == "梯子")
{
Tool[0].gameObject.SetActive(true);
Ladder.instance.Init();
//Ladder.instance.smr.SetBlendShapeWeight(0, 0);
}
if (message == "工作证")
{
Tool[1].gameObject.SetActive(true);
}
if (message == "剥线钳")
{
Tool[2].gameObject.SetActive(true);
}
if (message == "验电笔")
{
Tool[3].gameObject.SetActive(true);
}
if (message == "螺丝刀")
{
Tool[4].gameObject.SetActive(true);
}
if (message == "绝缘胶带")
{
Tool[5].gameObject.SetActive(true);
}
if (message == "l型集中器")
{
Tool[6].gameObject.SetActive(true);
}
if (message == "盒装封印")
{
Tool[7].gameObject.SetActive(true);
}
Debug.Log("Received message: " + message);
}
} }

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: dd2f757ccba35a84ab306bc7e7d2923d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -36,8 +36,20 @@ public class LadderTrigger : MonoBehaviour
/// ÌÝ×ÓÎïÌå
/// </summary>
public GameObject LadderObj;
public static LadderTrigger instance;
/// <summary>
/// 梯子动画
/// </summary>
public SkinnedMeshRenderer ladderski;
public void Awake()
{
instance = this;
}
void Start()
{
//GameObject CameraPlayer = GameObject.FindWithTag("MainCamera");
//ÉÏÌÝ×Ó°´Å¥
UpladderBtn.onClick.AddListener(() =>
{
@ -50,6 +62,7 @@ public class LadderTrigger : MonoBehaviour
RoleMove.instance.MouseScrollWheel();
RoleMove.instance.isup = true;
});
//下梯子按钮
DownladderBtn.onClick.AddListener(() =>
{
RoleMove.instance.isup = false;
@ -60,12 +73,15 @@ public class LadderTrigger : MonoBehaviour
DownladderBtn.gameObject.SetActive(false);
TakeBackBtn.gameObject.SetActive(true);
CameraPlayer.GetComponent<Rigidbody>().useGravity = true;
CameraPlayer.GetComponentInChildren<Camera>().fieldOfView = 60;
});
//收回梯子按钮
TakeBackBtn.onClick.AddListener(() =>
{
UpladderBtn.gameObject.SetActive(false);
Destroy(LadderObj);
LadderObj.gameObject.SetActive (false);
CameraPlayer.GetComponentInChildren<Camera>().fieldOfView = 60;
});
}

View File

@ -60,23 +60,48 @@ public class Pliers : MonoBehaviour
/// </summary>
bool Onladder ;
/// <summary>
/// 斜口钳钳开柜门封印位置
/// </summary>
public Transform ElectricBoxTrans;
/// <summary>
/// 工具解绑的父物体
/// </summary>
public GameObject PlayerCamera;
/// <summary>
/// 斜口钳的原始位置
/// </summary>
private Vector3 originalPosition;
/// <summary>
/// 工具的原始旋转
/// </summary>
private Quaternion originalRotation;
void Start()
{
Init();
}
/// <summary>
/// 初始化
/// </summary>
void Init()
{
PliersSki.SetBlendShapeWeight(0, 0);
//PliersAni.Play("Ïßǯ");
originalPosition = PliersObj.transform.position;
}
void Update()
{
//判断在梯子上
if (!Onladder)
{
if (Input.GetMouseButtonDown(0))
{//Camera.transform.forward
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
bool raycast = Physics.Raycast(ray, out hit);
@ -84,6 +109,7 @@ public class Pliers : MonoBehaviour
{
if (hit.collider.gameObject.name == "¹ñÃÅ_·âÓ¡")
{
PliersObj.gameObject.transform.SetParent(null);
StartCoroutine(PliersIE());
Debug.Log(hit.collider.gameObject.name);
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject);
@ -125,7 +151,7 @@ public class Pliers : MonoBehaviour
/// <returns></returns>
IEnumerator PliersIE()
{
PliersObj.gameObject.transform.DOLocalMove(new Vector3(3.33844f, 2.033f, -1.043f),1f);
PliersObj.gameObject.transform.position = ElectricBoxTrans.gameObject.transform.position;
yield return new WaitForSeconds(1f);
//PliersObj.gameObject.transform.DOLocalRotate(new Vector3(-90,90,0),1.5f);
//yield return new WaitForSeconds(2f);
@ -135,6 +161,7 @@ public class Pliers : MonoBehaviour
PliersSki.SetBlendShapeWeight(0, i);
}
yield return new WaitForSeconds(0.1f);
//PliersObj.gameObject.transform.SetParent(PlayerCamera.transform);
StartCoroutine(OpenLock());
}
@ -153,6 +180,7 @@ public class Pliers : MonoBehaviour
ElectricBoxSkinnedMeshRenderer.gameObject.transform.DOLocalMove(new Vector3(0.637f, 0.12f, -0.015f), 0.5f);
yield return new WaitForSeconds(1f);
ElectricBoxSkinnedMeshRenderer.gameObject.SetActive(false);
gameObject.transform.Find("变电箱_门").GetComponent<BoxCollider>().enabled = false;
StartCoroutine(OpenDoor());
}
@ -175,7 +203,11 @@ public class Pliers : MonoBehaviour
/// <returns></returns>
IEnumerator PliersBack()
{
PliersObj.gameObject.transform.DOMove(new Vector3(303.05f, 2.386f, 163.028f),1f);
PliersObj.gameObject.transform.SetParent(PlayerCamera.transform);
yield return new WaitForSeconds(0.5f);
PliersObj.gameObject.transform.position = originalPosition;
PliersObj.gameObject.transform.rotation = originalRotation;
//PliersObj.gameObject.transform.DOLocalMove(new Vector3(303.05f, 2.386f, 163.028f),1f);
PliersObj.gameObject.transform.DORotate(new Vector3(0,90,0),1f);
yield return new WaitForSeconds(1.5f);
//PliersObj.gameObject.SetActive(false);

View File

@ -6,6 +6,7 @@ using System.Threading.Tasks;
using DefaultNamespace.ProcessMode;
using MotionFramework;
using UnityEngine;
using Unity.VisualScripting;
/// <summary>
/// Ñéµç±Ê
@ -26,6 +27,16 @@ public class ElectricCheckPen : MonoBehaviour
/// ÊÇ·ñÔÚÊÖÉÏ
/// </summary>
bool issocket;
/// <summary>
/// 验电笔插座验电处
/// </summary>
public Transform ElectricalInspectionOfficeTrans;
/// <summary>
/// 需要解绑的父物体
/// </summary>
//public GameObject PlayerCamera;
void Start()
{
@ -43,14 +54,16 @@ public class ElectricCheckPen : MonoBehaviour
if (raycast)
{
if (hit.collider.gameObject.name == "±äµçÏä_ÃÅ")
if (hit.collider.gameObject.name == "箱体")
{
ElectricCheckPenOBJ.gameObject.transform.DOMove(new Vector3(303.038f, 2.655f, 163.822f), 2f);
ElectricCheckPenOBJ.gameObject.transform.SetParent(null);
ElectricCheckPenOBJ.gameObject.transform.DOLocalMove(new Vector3(303.038f, 2.655f, 163.822f), 2f);
Debug.Log(hit.collider.gameObject.name);
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject);
}
if (hit.collider.gameObject.name == "²å×ù")
{
ElectricCheckPenOBJ.gameObject.transform.SetParent(null);
StartCoroutine(socket());
//Warninglight();
Debug.Log(hit.collider.gameObject.name);
@ -72,9 +85,8 @@ public class ElectricCheckPen : MonoBehaviour
/// <returns></returns>
IEnumerator socket()
{
ElectricCheckPenOBJ.gameObject.transform.DOLocalMove(new Vector3(3.334f, 0.489f, 0.107f), 1f).OnComplete(() =>
{
ElectricCheckPenOBJ.gameObject.transform.DOLocalMove(ElectricalInspectionOfficeTrans.gameObject.transform.localPosition, 1f).OnComplete(() =>
{
ElectricCheckPenOBJ.gameObject.transform.DOLocalRotate(new Vector3(20.78f, 72.47f, 171.503f), 1.5f).OnComplete(() =>
{
Debug.Log("123");
@ -91,11 +103,11 @@ public class ElectricCheckPen : MonoBehaviour
async void Warninglight()
{
ElectricCheckPenSpr.color = new Color(255, 0, 0);
await Task.Delay(TimeSpan.FromSeconds(1));
await Task.Delay(TimeSpan.FromSeconds(0.5f));
ElectricCheckPenSpr.color = new Color(166, 183, 213);
await Task.Delay(TimeSpan.FromSeconds(1));
await Task.Delay(TimeSpan.FromSeconds(0.5f));
ElectricCheckPenSpr.color = new Color(255, 0, 0);
await Task.Delay(TimeSpan.FromSeconds(1));
await Task.Delay(TimeSpan.FromSeconds(0.5f));
ElectricCheckPenSpr.color = new Color(166, 183, 213);
}
}

View File

@ -80,6 +80,7 @@ public class Fieldobservation : MonoBehaviour
//public HighlightEffect _highlight;
void Start()
{
}
void Update()

View File

@ -2,25 +2,23 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// 上梯子后才能使用鼠标滑轮控制视角
/// </summary>
public class RoleMove : MonoBehaviour
{
public static RoleMove instance;
public bool isup;
//上梯子后停止移动
//private void Start()
//{
// FirstPersonController.instance.playerCanMove = false;
//}
void Update()
public void Awake()
{
instance = this;
}
void Update()
{
MouseScrollWheel();
}
/// <summary>
/// 上梯子后才能使用鼠标滑轮控制视角
/// </summary>
public void MouseScrollWheel()
{
if (isup)
@ -31,7 +29,7 @@ public class RoleMove : MonoBehaviour
//放大视角 往前滑
if (Input.GetAxis("Mouse ScrollWheel") < 0)
{
if (Camera.main.fieldOfView <= 70) //小于一个放大范围后就不继续放大了
if (Camera.main.fieldOfView <= 90) //小于一个放大范围后就不继续放大了
{
Camera.main.fieldOfView += 5;
}