带电逻辑完善,修复工具bug,拆卸安装电能表流程完善
This commit is contained in:
parent
ebf4a433ba
commit
5339727bcf
|
@ -123,8 +123,8 @@ CapsuleCollider:
|
|||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
m_Radius: 0.5
|
||||
m_Height: 2
|
||||
m_Radius: 0.2
|
||||
m_Height: 1.7
|
||||
m_Direction: 1
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &7005868485670428847
|
||||
|
|
|
@ -1168,7 +1168,7 @@ GameObject:
|
|||
- component: {fileID: 4658103605771657434}
|
||||
- component: {fileID: 2797656432174285614}
|
||||
m_Layer: 0
|
||||
m_Name: "\u4E09\u76F8\u56DB\u7EBF\u7535\u80FD\u8868"
|
||||
m_Name: "\u4E09\u76F8\u56DB\u7EBF\u7535\u80FD\u8868_xxx"
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0ea8c75644dbff14bacec41ed2dc6efc
|
||||
DefaultImporter:
|
||||
guid: 10f4454f32eb20e4298912d896f6020e
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a39ba73cc2686bf42b78647875bb8a23
|
||||
guid: b89569af6fe931647be081fff26b1b94
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -53,8 +53,8 @@ public class Device_Cover : Device_Base
|
|||
{
|
||||
Debug.Log("打开盖子");
|
||||
isOpen = true;
|
||||
transform.DOLocalMoveY(transform.localPosition.y - 0.15f, 2);
|
||||
transform.DOLocalMoveZ(transform.localPosition.z - 0.15f, 2);
|
||||
transform.DOLocalMoveY(-0.1388763f, 2);
|
||||
transform.DOLocalMoveZ(-0.2485413f, 2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -64,7 +64,7 @@ public class Device_Cover : Device_Base
|
|||
{
|
||||
Debug.Log("盖上盖子");
|
||||
isOpen = false;
|
||||
transform.DOLocalMoveY(transform.localPosition.y + 0.15f, 2);
|
||||
transform.DOLocalMoveZ(transform.localPosition.z + 0.15f, 2);
|
||||
transform.DOLocalMoveY(0.01112366f, 2);
|
||||
transform.DOLocalMoveZ(-0.09854126f, 2);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using DG.Tweening;
|
||||
using Sirenix.Utilities;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
|
@ -9,11 +9,6 @@ using UnityEngine;
|
|||
/// </summary>
|
||||
public class Device_DirectAccessElectricEnergyMeteringDevice : Device_Base
|
||||
{
|
||||
public static Device_DirectAccessElectricEnergyMeteringDevice instance;
|
||||
/// <summary>
|
||||
/// 是否已被拆除
|
||||
/// </summary>
|
||||
public bool isRemove;
|
||||
/// <summary>
|
||||
/// 铭牌
|
||||
/// </summary>
|
||||
|
@ -24,13 +19,6 @@ public class Device_DirectAccessElectricEnergyMeteringDevice : Device_Base
|
|||
/// </summary>
|
||||
public Device_Cover cover;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 电能表接线
|
||||
/// </summary>
|
||||
[Tooltip("接线")]
|
||||
public List<Tool_Line> jieXian_lines;
|
||||
|
||||
/// <summary>
|
||||
/// 电能表固定螺丝左
|
||||
/// </summary>
|
||||
|
@ -39,14 +27,61 @@ public class Device_DirectAccessElectricEnergyMeteringDevice : Device_Base
|
|||
/// 电能表固定螺丝右
|
||||
/// </summary>
|
||||
public Tool_Screw fix_screw_right;
|
||||
/// <summary>
|
||||
/// 电能表接线螺丝
|
||||
/// </summary>
|
||||
public List<Tool_Screw> jieXian_screws;
|
||||
|
||||
|
||||
private BoxCollider boxCollider;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
instance = this;
|
||||
boxCollider = GetComponent<BoxCollider>();
|
||||
if(UnityEngine.SceneManagement.SceneManager.GetActiveScene().name== "05_LiveScene")
|
||||
{
|
||||
boxCollider.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 初始化电能表状态(默认是装好的状态不用设置)
|
||||
/// </summary>
|
||||
/// <param name="isIntsalledState"></param>
|
||||
public void Init(bool isIntsalledState)
|
||||
{
|
||||
if(!isIntsalledState)
|
||||
{
|
||||
Debug.Log("电能表设置为拆下状态");
|
||||
//盖子拆除
|
||||
cover.isOpen = true;
|
||||
cover.transform.localPosition = new Vector3(0.0001220703f, -0.1388763f, -0.2485413f);
|
||||
//左螺丝拧下
|
||||
cover.cover_screw_Left.isInstall = false;
|
||||
cover.cover_screw_Left.transform.localPosition = new Vector3(0.06128693f, -0.03405334f, -0.1012321f);
|
||||
//右螺丝拧下
|
||||
cover.cover_screw_Right.isInstall = false;
|
||||
cover.cover_screw_Right.transform.localPosition = new Vector3(-0.06129074f, -0.03405334f, -0.1012321f);
|
||||
//左封印被剪开
|
||||
cover.cover_seal_Left.isCut = true;
|
||||
cover.cover_seal_Left.gameObject.SetActive(false);
|
||||
//右封印被剪开
|
||||
cover.cover_seal_Right.isCut = true;
|
||||
cover.cover_seal_Right.gameObject.SetActive(false);
|
||||
//左固定螺丝拧下
|
||||
fix_screw_left.isInstall = false;
|
||||
fix_screw_left.transform.localPosition = new Vector3(0.06592941f, 0.03107117f, -0.1094047f);
|
||||
//右固定螺丝拧下
|
||||
fix_screw_right.isInstall = false;
|
||||
fix_screw_right.transform.localPosition = new Vector3(-0.06737137f, 0.03107117f, -0.1094047f);
|
||||
//接线螺丝全部拧下
|
||||
jieXian_screws.ForEach(a =>
|
||||
{
|
||||
a.isInstall = false;
|
||||
a.transform.localPosition = new Vector3(a.transform.localPosition.x, 0.005695801f, a.transform.localPosition.z);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -54,18 +89,15 @@ public class Device_DirectAccessElectricEnergyMeteringDevice : Device_Base
|
|||
/// </summary>
|
||||
public void Remove()
|
||||
{
|
||||
if (!isRemove)
|
||||
//拆下电能表
|
||||
if (!fix_screw_left.isInstall && !fix_screw_right.isInstall)
|
||||
{
|
||||
//拆下电能表
|
||||
if (!fix_screw_left.isInstall && !fix_screw_right.isInstall)
|
||||
SiteManager.instance.measuringCabinet.meteringDevice = null;
|
||||
Debug.Log("电能表已拆除");
|
||||
transform.DOLocalMove(transform.localPosition - new Vector3(0, 0.2f, 0.2f), 2).OnComplete(() =>
|
||||
{
|
||||
isRemove = true;
|
||||
Debug.Log("电能表已拆除");
|
||||
transform.DOLocalMove(transform.localPosition - new Vector3(0, 0.2f, 0.2f), 2).OnComplete(() =>
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
});
|
||||
}
|
||||
gameObject.SetActive(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,16 +106,17 @@ public class Device_DirectAccessElectricEnergyMeteringDevice : Device_Base
|
|||
/// </summary>
|
||||
public void Add()
|
||||
{
|
||||
if(isRemove)
|
||||
transform.parent = SiteManager.instance.measuringCabinet.transform;
|
||||
//默认是拆除的状态
|
||||
Init(false);
|
||||
transform.DOLocalMove(new Vector3(0.1469002f, -0.1793365f, 0.5191498f), 2).OnStart(() =>
|
||||
{
|
||||
gameObject.SetActive(true);
|
||||
transform.DOLocalMove(transform.localPosition + new Vector3(0, 0.2f, 0.2f), 2).OnComplete(() =>
|
||||
{
|
||||
isRemove = false;
|
||||
Debug.Log("电能表已安装");
|
||||
});
|
||||
}
|
||||
|
||||
transform.localEulerAngles = Vector3.zero;
|
||||
}).OnComplete(() =>
|
||||
{
|
||||
SiteManager.instance.measuringCabinet.meteringDevice = this;
|
||||
LiveSceneManager.Instance.currentTool = null;
|
||||
Debug.Log("电能表已安装");
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
@ -6,6 +7,19 @@ public class Device_Switch : Device_Base
|
|||
{
|
||||
public bool isOpen;
|
||||
|
||||
/// <summary>
|
||||
/// 操作开关事件
|
||||
/// </summary>
|
||||
private Action<bool> actionBack;
|
||||
|
||||
/// <summary>
|
||||
/// 添加开关操作回调
|
||||
/// </summary>
|
||||
/// <param name="actionBack"></param>
|
||||
public void AddAction(Action<bool> actionBack)
|
||||
{
|
||||
this.actionBack= actionBack;
|
||||
}
|
||||
|
||||
private void OnMouseDown()
|
||||
{
|
||||
|
@ -19,5 +33,11 @@ public class Device_Switch : Device_Base
|
|||
isOpen = true;
|
||||
transform.localEulerAngles = new Vector3(0, 0, 0);
|
||||
}
|
||||
|
||||
//调用自定义事件
|
||||
if (actionBack != null)
|
||||
{
|
||||
actionBack.Invoke(isOpen);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.VisualScripting;
|
||||
using Unity.VisualScripting.Antlr3.Runtime;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
|
@ -8,7 +10,7 @@ using UnityEngine;
|
|||
public class Device_MeasuringCabinet : Device_Base
|
||||
{
|
||||
/// <summary>
|
||||
/// 直接接入式电能计量装置
|
||||
/// 当前机柜中安装的三相四线电能表
|
||||
/// </summary>
|
||||
public Device_DirectAccessElectricEnergyMeteringDevice meteringDevice;
|
||||
/// <summary>
|
||||
|
@ -23,4 +25,86 @@ public class Device_MeasuringCabinet : Device_Base
|
|||
/// ½øµç¿ª¹Ø
|
||||
/// </summary>
|
||||
public Device_Switch inSwitch;
|
||||
/// <summary>
|
||||
/// 电能表接线
|
||||
/// </summary>
|
||||
public List<Tool_Line> jieXian_screws;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
//添加开关切换回调
|
||||
inSwitch.AddAction(isOpen =>
|
||||
{
|
||||
//刷新带电状态
|
||||
CheckHasElectricity();
|
||||
});
|
||||
|
||||
//添加螺丝拆装回调
|
||||
meteringDevice.jieXian_screws.ForEach(screw =>
|
||||
{
|
||||
screw.AddAction(isinstalled =>
|
||||
{
|
||||
//刷新带电状态
|
||||
CheckHasElectricity();
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 清空接线的螺丝参数
|
||||
/// </summary>
|
||||
public void ClearLineScrew()
|
||||
{
|
||||
Debug.Log("清除接线关联的螺丝");
|
||||
jieXian_screws.ForEach(a =>
|
||||
{
|
||||
a.screws.Clear();
|
||||
});
|
||||
}
|
||||
/// <summary>
|
||||
/// 设置接线的螺丝参数
|
||||
/// </summary>
|
||||
public void SetLineScrew()
|
||||
{
|
||||
Debug.Log("接线重新关联螺丝");
|
||||
jieXian_screws.ForEach(a =>
|
||||
{
|
||||
a.screws = meteringDevice.jieXian_screws.FindAll(b => b.gameObject.name.StartsWith(a.gameObject.name));
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 刷新电能表螺丝带电状态
|
||||
/// </summary>
|
||||
private void CheckHasElectricity()
|
||||
{
|
||||
Debug.Log("带电状态刷新");
|
||||
//进线螺丝是否带电
|
||||
jieXian_screws.ForEach(a =>
|
||||
{
|
||||
if (!inSwitch.isOpen)
|
||||
{
|
||||
//开关关闭不带电
|
||||
a.screws.ForEach(b => b.hasElectricity = false);
|
||||
}
|
||||
else
|
||||
{
|
||||
//开关打开--线接上--螺丝拧上带电
|
||||
if (!a.isConnected)
|
||||
{
|
||||
a.screws.ForEach(b => b.hasElectricity = false);
|
||||
}
|
||||
else
|
||||
{
|
||||
a.screws.ForEach(b =>
|
||||
{
|
||||
//安装了则带电
|
||||
b.hasElectricity = b.isInstall;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
using Cysharp.Threading.Tasks.Triggers;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
@ -7,6 +8,8 @@ using UnityEngine;
|
|||
/// </summary>
|
||||
public class SiteManager : MonoBehaviour
|
||||
{
|
||||
|
||||
public static SiteManager instance;
|
||||
/// <summary>
|
||||
/// 机柜
|
||||
/// </summary>
|
||||
|
@ -15,23 +18,28 @@ public class SiteManager : MonoBehaviour
|
|||
/// 电能表碰撞
|
||||
/// </summary>
|
||||
public BoxCollider dianCollider;
|
||||
private void Awake()
|
||||
{
|
||||
instance = this;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
//使能电能表碰撞
|
||||
if (measuringCabinet.meteringDevice.isRemove)
|
||||
if (measuringCabinet.meteringDevice == null)
|
||||
{
|
||||
dianCollider.enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!measuringCabinet.meteringDevice.fix_screw_left.isInstall && !measuringCabinet.meteringDevice.fix_screw_right.isInstall)
|
||||
//电能表固定螺丝拆掉了,线拆掉了
|
||||
if (!measuringCabinet.meteringDevice.fix_screw_left.isInstall && !measuringCabinet.meteringDevice.fix_screw_right.isInstall && measuringCabinet.jieXian_screws.TrueForAll(a=>!a.isConnected))
|
||||
{
|
||||
dianCollider.enabled = false;
|
||||
dianCollider.enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
dianCollider.enabled = true;
|
||||
dianCollider.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,14 +49,23 @@ public class SiteManager : MonoBehaviour
|
|||
{
|
||||
if(hit.collider== dianCollider)
|
||||
{
|
||||
if (measuringCabinet.meteringDevice.isRemove)
|
||||
if (measuringCabinet.meteringDevice==null)
|
||||
{
|
||||
//²ðÏÂ
|
||||
measuringCabinet.meteringDevice.Remove();
|
||||
//安装电能表
|
||||
if(LiveSceneManager.Instance.currentTool!=null && LiveSceneManager.Instance.currentTool.GetComponent<Device_DirectAccessElectricEnergyMeteringDevice>()!=null)
|
||||
{
|
||||
measuringCabinet.meteringDevice = LiveSceneManager.Instance.currentTool.GetComponent<Device_DirectAccessElectricEnergyMeteringDevice>();
|
||||
measuringCabinet.meteringDevice.Add();
|
||||
//接线关联螺丝
|
||||
measuringCabinet.SetLineScrew();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//°²×°
|
||||
//拆下电能表
|
||||
measuringCabinet.meteringDevice.Remove();
|
||||
//情况接线关联螺丝
|
||||
measuringCabinet.ClearLineScrew();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,12 @@ public class Tool_Line: Tool_Base
|
|||
/// </summary>
|
||||
public List<Tool_Screw> screws=new List<Tool_Screw>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 安装状态时Y的local值
|
||||
/// </summary>
|
||||
public float InstallPosY;
|
||||
|
||||
protected override void OnAwake()
|
||||
{
|
||||
base.OnAwake();
|
||||
|
@ -36,8 +42,10 @@ public class Tool_Line: Tool_Base
|
|||
//取下接线
|
||||
if(screws.TrueForAll(a=>!a.isInstall))
|
||||
{
|
||||
isConnected = false;
|
||||
transform.DOLocalMoveY(transform.localPosition.y - 2, 1);
|
||||
transform.DOLocalMoveY(InstallPosY - 2, 1).OnComplete(()=>
|
||||
{
|
||||
isConnected = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -45,7 +53,7 @@ public class Tool_Line: Tool_Base
|
|||
//装上接线
|
||||
if (screws.TrueForAll(a => !a.isInstall))
|
||||
{
|
||||
transform.DOLocalMoveY(transform.localPosition.y + 2, 1).OnComplete(() =>
|
||||
transform.DOLocalMoveY(InstallPosY, 1).OnComplete(() =>
|
||||
{
|
||||
isConnected = true;
|
||||
});
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using DG.Tweening;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
@ -31,16 +32,16 @@ public class Tool_Screw : Tool_Base
|
|||
/// </summary>
|
||||
private bool isMoving;
|
||||
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// 螺丝拧紧时的位置
|
||||
///// </summary>
|
||||
//private float localYInstallValue;
|
||||
///// <summary>
|
||||
///// 螺丝拧松时的位置
|
||||
///// </summary>
|
||||
//private float localYUnInstallValue;
|
||||
/// <summary>
|
||||
/// 安装状态时Y的local值
|
||||
/// </summary>
|
||||
public float initPostionY;
|
||||
|
||||
/// <summary>
|
||||
/// 螺丝拆装事件回调
|
||||
/// </summary>
|
||||
private Action<bool> installAction;
|
||||
|
||||
|
||||
protected override void OnAwake()
|
||||
|
@ -49,6 +50,10 @@ public class Tool_Screw : Tool_Base
|
|||
id = gameObject.name;
|
||||
}
|
||||
|
||||
public void AddAction(Action<bool> action)
|
||||
{
|
||||
this.installAction=action;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 被拧紧
|
||||
|
@ -64,7 +69,7 @@ public class Tool_Screw : Tool_Base
|
|||
screwdriver.transform.position = installPos.position;
|
||||
screwdriver.transform.localEulerAngles = installPos.localEulerAngles;
|
||||
//动画
|
||||
transform.DOLocalMoveY(transform.localPosition.y + 0.02f, 1)
|
||||
transform.DOLocalMoveY(initPostionY, 1)
|
||||
.OnUpdate(() =>
|
||||
{
|
||||
transform.RotateAroundLocal(Vector3.up, 1);
|
||||
|
@ -76,6 +81,7 @@ public class Tool_Screw : Tool_Base
|
|||
Debug.Log("螺丝已拧紧");
|
||||
isInstall = true;
|
||||
isMoving = false;
|
||||
installAction?.Invoke(true);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -94,7 +100,7 @@ public class Tool_Screw : Tool_Base
|
|||
screwdriver.transform.position = installPos.position;
|
||||
screwdriver.transform.localEulerAngles = installPos.localEulerAngles;
|
||||
//动画
|
||||
transform.DOLocalMoveY(transform.localPosition.y - 0.02f, 1)
|
||||
transform.DOLocalMoveY(initPostionY - 0.02f, 1)
|
||||
.OnUpdate(() =>
|
||||
{
|
||||
transform.RotateAroundLocal(Vector3.up, 1);
|
||||
|
@ -106,6 +112,7 @@ public class Tool_Screw : Tool_Base
|
|||
Debug.Log("螺丝已拧松");
|
||||
isInstall = false;
|
||||
isMoving = false;
|
||||
installAction?.Invoke(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,13 +44,13 @@ public class Tool_Screwdriver : Tool_Base
|
|||
Tool_Screw ts = hit.transform.GetComponent<Tool_Screw>();
|
||||
if (ts != null)
|
||||
{
|
||||
if(ts.id== "电能表盖子固定螺丝1" && !Device_DirectAccessElectricEnergyMeteringDevice.instance.cover.cover_seal_Left.isCut)
|
||||
if(ts.id== "电能表盖子固定螺丝1" && !SiteManager.instance.measuringCabinet.meteringDevice.cover.cover_seal_Left.isCut)
|
||||
{
|
||||
Debug.Log("·âӡδ¼ô¶Ï");
|
||||
return;
|
||||
}
|
||||
|
||||
if (ts.id == "电能表盖子固定螺丝2" && !Device_DirectAccessElectricEnergyMeteringDevice.instance.cover.cover_seal_Right.isCut)
|
||||
if (ts.id == "电能表盖子固定螺丝2" && !SiteManager.instance.measuringCabinet.meteringDevice.cover.cover_seal_Right.isCut)
|
||||
{
|
||||
Debug.Log("·âӡδ¼ô¶Ï");
|
||||
return;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using static Unity.Burst.Intrinsics.X86.Avx;
|
||||
|
||||
/// <summary>
|
||||
/// 验电笔
|
||||
|
@ -42,7 +43,7 @@ public class Tool_TestPen : Tool_Base
|
|||
|
||||
if(isFlicker)
|
||||
{
|
||||
time += Time.deltaTime;
|
||||
time += Time.deltaTime*3;
|
||||
if (time < 1)
|
||||
{
|
||||
screem.materials[0].color = Color.red;
|
||||
|
@ -77,10 +78,12 @@ public class Tool_TestPen : Tool_Base
|
|||
var tmp = ((Device_CabinetDoor)device_base);
|
||||
//位置移动
|
||||
transform.position = tmp.testPosAndRot.position;
|
||||
transform.eulerAngles = tmp.testPosAndRot.eulerAngles;
|
||||
transform.localEulerAngles = tmp.testPosAndRot.localEulerAngles;
|
||||
Debug.Log("计量柜_柜门 已验电");
|
||||
isFlicker = tmp.hasElectricity;
|
||||
}
|
||||
|
||||
screem.materials[0].color = isFlicker ? Color.red : Color.white;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -94,10 +97,12 @@ public class Tool_TestPen : Tool_Base
|
|||
var tmp = ((Tool_Screw)tool_base);
|
||||
//位置移动
|
||||
transform.position = tmp.installPos.position;
|
||||
transform.eulerAngles = tmp.installPos.eulerAngles;
|
||||
transform.localEulerAngles = tmp.installPos.localEulerAngles;
|
||||
Debug.Log("螺丝 已验电");
|
||||
isFlicker = tmp.hasElectricity;
|
||||
}
|
||||
|
||||
screem.materials[0].color = isFlicker ? Color.red : Color.white;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -32,14 +32,14 @@ public class Tool_WireStripper : Tool_Base
|
|||
//´ò¿ª
|
||||
while (renderer.GetBlendShapeWeight(0) < 100)
|
||||
{
|
||||
vlaue += (Time.deltaTime * 100);
|
||||
vlaue += (Time.deltaTime * 200);
|
||||
renderer.SetBlendShapeWeight(0, vlaue);
|
||||
yield return null;
|
||||
}
|
||||
//¹Ø±Õ
|
||||
while (renderer.GetBlendShapeWeight(0) > 0)
|
||||
{
|
||||
vlaue -= (Time.deltaTime * 100);
|
||||
vlaue -= (Time.deltaTime * 200);
|
||||
renderer.SetBlendShapeWeight(0, vlaue);
|
||||
yield return null;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ public class LiveSceneManager : SingletonMono<LiveSceneManager>
|
|||
{
|
||||
[HideInInspector]
|
||||
public FirstPersonController firstPersonController;
|
||||
public GameObject currentTool;
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
|
|
Loading…
Reference in New Issue