This commit is contained in:
taosuqi 2024-08-29 18:39:36 +08:00
commit 69a8bf6b68
6 changed files with 23 additions and 18 deletions

View File

@ -137,6 +137,9 @@ public class StepState_1002 : StepState
//»¹Ô­¹ñ×Ó
SiteManager.instance.measuringCabinet.Init();
//还原npc对话
GameObject.FindObjectsOfType<NPCController>().ToList().ForEach(a => { a.speackIndex = 0; });
}
else if (num == 3008)
{
@ -145,6 +148,9 @@ public class StepState_1002 : StepState
else if (num == 3009)
{
//½ÓÏß¼ì²é
//还原npc负责人
GameObject.FindObjectsOfType<NPCController>().ToList().Find(a => a.triggerName == "NPC负责人").speackIndex = 1;
}
else if(num == 3010)
{

View File

@ -18,11 +18,16 @@ public class Tool_Base : PermanentTriggerBase
/// trigger´¥·¢Ê¼þ
/// </summary>
public Func<string, bool, int> triggerAction;
/// <summary>
/// 是否再移动
/// </summary>
public bool isMoving;
private Vector3 head_LocalPos;
private Vector3 head_LocalEulerAnglesl;
protected override void OnAwake()
{
if (GameManager.RunModelMgr.SceneType == E_SceneType.Site)
@ -77,12 +82,14 @@ public class Tool_Base : PermanentTriggerBase
/// </summary>
public void ReBackHead()
{
isMoving = true;
transform.parent = Camera.main.transform;
transform.DOLocalRotate(head_LocalEulerAnglesl, 0.5f);
transform.DOLocalMove(head_LocalPos, 1).OnComplete(() =>
transform.DOLocalRotate(head_LocalEulerAnglesl, 0.3f);
transform.DOLocalMove(head_LocalPos, 0.8f).OnComplete(() =>
{
transform.localPosition = head_LocalPos;
transform.localEulerAngles = head_LocalEulerAnglesl;
isMoving = false;
});
}
}

View File

@ -85,7 +85,7 @@ public class Tool_Screw : Tool_Base
isMoving = false;
installAction?.Invoke(true);
screwdriver.ReBackHead();
screwdriver.isUseing = false;
screwdriver.isMoving = false;
CallScoreAction(true);
});
});
@ -122,7 +122,7 @@ public class Tool_Screw : Tool_Base
isMoving = false;
installAction?.Invoke(false);
screwdriver.ReBackHead();
screwdriver.isUseing = false;
screwdriver.isMoving = false;
CallScoreAction(false);
});
});

View File

@ -8,12 +8,6 @@ using UnityEngine;
/// </summary>
public class Tool_Screwdriver : Tool_Base
{
/// <summary>
/// 正在使用
/// </summary>
[HideInInspector]
public bool isUseing;
/// <summary>
/// 开始安装螺丝
/// </summary>
@ -22,7 +16,7 @@ public class Tool_Screwdriver : Tool_Base
{
if (!screw.isInstall)
{
isUseing = true;
isMoving = true;
screw.BeInstalled(this);
}
}
@ -35,14 +29,14 @@ public class Tool_Screwdriver : Tool_Base
{
if (screw.isInstall)
{
isUseing = true;
isMoving = true;
screw.BeUnInstalled(this);
}
}
private void Update()
{
if (Input.GetMouseButtonDown(0) && !isUseing)
if (Input.GetMouseButtonDown(0) && !base.isMoving)
{
//点击螺丝验电
Ray tmpray = Camera.main.ScreenPointToRay(Input.mousePosition);

View File

@ -1,7 +1,6 @@
using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
/// <summary>

View File

@ -9,14 +9,13 @@ using static Unity.Burst.Intrinsics.X86.Avx;
/// </summary>
public class Tool_WireStripper : Tool_Base
{
private bool isCuning;
/// <summary>
/// 开始剪封印
/// </summary>
/// <param name="device_Seal"></param>
public void CutOpen(Device_Seal device_Seal)
{
isCuning = true;
isMoving = true;
transform.parent = null;
transform.DORotate(device_Seal.testPosAndRot.eulerAngles, 0.5f);
transform.DOMove(device_Seal.testPosAndRot.position, 1).OnComplete(() =>
@ -51,14 +50,14 @@ public class Tool_WireStripper : Tool_Base
}
//剪断
device_Seal.Cut();
isCuning = false;
isMoving = false;
ReBackHead();
int result = (triggerAction == null ? 0 : triggerAction.Invoke(device_Seal.triggerName, true));
}
private void Update()
{
if (Input.GetMouseButtonDown(0) && !isCuning)
if (Input.GetMouseButtonDown(0) && !isMoving)
{
//点击螺丝验电
Ray tmpray = Camera.main.ScreenPointToRay(Input.mousePosition);