This commit is contained in:
parent
fd12821146
commit
5bf0e384c6
|
@ -108,6 +108,7 @@ RectTransform:
|
|||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 267684787124082563}
|
||||
- {fileID: 38172639612528770}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
|
@ -167,3 +168,139 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
image: {fileID: 267684787124082560}
|
||||
textMeshProUGUI: {fileID: 2523285510643614807}
|
||||
--- !u!1 &3452568093716872615
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 38172639612528770}
|
||||
- component: {fileID: 2329643047023932906}
|
||||
- component: {fileID: 2523285510643614807}
|
||||
m_Layer: 5
|
||||
m_Name: Text (TMP)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &38172639612528770
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3452568093716872615}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 267684787304413251}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2329643047023932906
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3452568093716872615}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &2523285510643614807
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3452568093716872615}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 0
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: "\u68C0\u67E5\u4E2D"
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 9ea913af302bbdf42a9f003451c70e02, type: 2}
|
||||
m_sharedMaterial: {fileID: 4239875615288461448, guid: 9ea913af302bbdf42a9f003451c70e02, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_fontColorGradientPreset: {fileID: 0}
|
||||
m_spriteAsset: {fileID: 0}
|
||||
m_tintAllSprites: 0
|
||||
m_StyleSheet: {fileID: 0}
|
||||
m_TextStyleHashCode: -1183493901
|
||||
m_overrideHtmlColors: 0
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 36
|
||||
m_fontSizeBase: 36
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 2
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
m_lineSpacing: 0
|
||||
m_lineSpacingMax: 0
|
||||
m_paragraphSpacing: 0
|
||||
m_charWidthMaxAdj: 0
|
||||
m_enableWordWrapping: 1
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 0
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 1
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
m_parseCtrlCharacters: 1
|
||||
m_isOrthographic: 1
|
||||
m_isCullingEnabled: 0
|
||||
m_horizontalMapping: 0
|
||||
m_verticalMapping: 0
|
||||
m_uvLineOffset: 0
|
||||
m_geometrySortingOrder: 0
|
||||
m_IsTextObjectScaleStatic: 0
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
|
|
|
@ -14,6 +14,9 @@ public class Device_Base : PermanentTriggerBase
|
|||
/// </summary>
|
||||
public Func<string,bool,int> triggerAction;
|
||||
|
||||
private Vector3 head_LocalPos;
|
||||
private Vector3 head_LocalEulerAnglesl;
|
||||
|
||||
protected override void OnStart()
|
||||
{
|
||||
if ( GameManager.RunModelMgr.SceneType == E_SceneType.Site)
|
||||
|
@ -44,4 +47,15 @@ public class Device_Base : PermanentTriggerBase
|
|||
{
|
||||
this.triggerAction = action;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置工具回到手中的位置
|
||||
/// </summary>
|
||||
/// <param name="head_LocalPos"></param>
|
||||
/// <param name="head_LocalEulerAnglesl"></param>
|
||||
public void SetHeadPosAndEulerang(Vector3 head_LocalPos, Vector3 head_LocalEulerAnglesl)
|
||||
{
|
||||
this.head_LocalPos = head_LocalPos;
|
||||
this.head_LocalEulerAnglesl = head_LocalEulerAnglesl;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,10 +81,10 @@ public class Device_3Phase4WireMeter : Device_Base
|
|||
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(cover.cover_screw_Left.transform.localPosition.x, cover.cover_screw_Left.initPostionY - 0.03f, cover.cover_screw_Left.transform.localPosition.z);
|
||||
cover.cover_screw_Left.transform.localPosition = new Vector3(cover.cover_screw_Left.transform.localPosition.x, -0.1840515f, -0.2512321f);
|
||||
//右螺丝拧下
|
||||
cover.cover_screw_Right.isInstall = false;
|
||||
cover.cover_screw_Right.transform.localPosition = new Vector3(cover.cover_screw_Right.transform.localPosition.x, cover.cover_screw_Right.initPostionY - 0.03f, cover.cover_screw_Right.transform.localPosition.z);
|
||||
cover.cover_screw_Right.transform.localPosition = new Vector3(cover.cover_screw_Right.transform.localPosition.x, -0.1840515f, -0.2512321f);
|
||||
}
|
||||
/// <summary>
|
||||
/// 盖子装上的状态
|
||||
|
@ -96,10 +96,10 @@ public class Device_3Phase4WireMeter : Device_Base
|
|||
cover.transform.localPosition = new Vector3(0.0001220703f, 0.01112366f, -0.09854126f);
|
||||
//左螺丝拧上
|
||||
cover.cover_screw_Left.isInstall = true;
|
||||
cover.cover_screw_Left.transform.localPosition = new Vector3(cover.cover_screw_Left.transform.localPosition.x, cover.cover_screw_Left.initPostionY, cover.cover_screw_Left.transform.localPosition.z);
|
||||
cover.cover_screw_Left.transform.localPosition = new Vector3(cover.cover_screw_Left.transform.localPosition.x, -0.01405334f, -0.1012321f);
|
||||
//右螺丝拧上
|
||||
cover.cover_screw_Right.isInstall = true;
|
||||
cover.cover_screw_Right.transform.localPosition = new Vector3(cover.cover_screw_Right.transform.localPosition.x, cover.cover_screw_Right.initPostionY, cover.cover_screw_Right.transform.localPosition.z);
|
||||
cover.cover_screw_Right.transform.localPosition = new Vector3(cover.cover_screw_Right.transform.localPosition.x, -0.01405334f, -0.1012321f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -55,9 +55,14 @@ public class Device_Cover : Device_Base
|
|||
{
|
||||
Debug.Log("打开盖子");
|
||||
isOpen = true;
|
||||
transform.DOLocalMoveY(-0.1388763f, 2);
|
||||
transform.DOLocalMoveZ(-0.2485413f, 2).OnComplete(() =>
|
||||
|
||||
Transform parent = cover_screw_Left.transform.parent;
|
||||
cover_screw_Left.transform.parent = transform;
|
||||
cover_screw_Right.transform.parent = transform;
|
||||
transform.DOLocalMove(new Vector3(transform.localPosition.x,-0.1388763f, -0.2485413f), 2).OnComplete(() =>
|
||||
{
|
||||
cover_screw_Left.transform.parent = parent;
|
||||
cover_screw_Right.transform.parent = parent;
|
||||
int result = (triggerAction == null ? 0 : triggerAction.Invoke(triggerName, true));
|
||||
});
|
||||
}
|
||||
|
@ -69,9 +74,14 @@ public class Device_Cover : Device_Base
|
|||
{
|
||||
Debug.Log("盖上盖子");
|
||||
isOpen = false;
|
||||
transform.DOLocalMoveY(0.01112366f, 2);
|
||||
transform.DOLocalMoveZ(-0.09854126f, 2).OnComplete(() =>
|
||||
|
||||
Transform parent = cover_screw_Left.transform.parent;
|
||||
cover_screw_Left.transform.parent = transform;
|
||||
cover_screw_Right.transform.parent = transform;
|
||||
transform.DOLocalMove(new Vector3(transform.localPosition.x,0.01112366f, -0.09854126f), 2).OnComplete(() =>
|
||||
{
|
||||
cover_screw_Left.transform.parent = parent;
|
||||
cover_screw_Right.transform.parent = parent;
|
||||
int result = (triggerAction == null ? 0 : triggerAction.Invoke(triggerName, true));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class ScoreBase : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// 科目满分
|
||||
/// </summary>
|
||||
protected float maxScore = 100;
|
||||
/// <summary>
|
||||
/// 科目得分s
|
||||
/// </summary>
|
||||
protected float currentScore;
|
||||
/// <summary>
|
||||
/// 步骤
|
||||
/// </summary>
|
||||
protected Dictionary<int, ScoreSubjectStep> steps;
|
||||
|
||||
//protected abstract void Init(ScoreSubjectStep step);
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 00415bfa520d2dd43b89c50a93350199
|
||||
guid: 8dfb1c2b6f6420d47a6094d456c9ad88
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
|
@ -4,6 +4,10 @@ using UnityEngine;
|
|||
|
||||
public class ScoreManager : MonoBehaviour
|
||||
{
|
||||
List<ScoreSubject> scoreSubjectList;
|
||||
|
||||
public static ScoreManager instance;
|
||||
List<Score_1002> scoreSubjectList;
|
||||
private void Awake()
|
||||
{
|
||||
instance = this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class ScoreSubject : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// 科目满分
|
||||
/// </summary>
|
||||
float maxScore;
|
||||
/// <summary>
|
||||
/// 科目得分
|
||||
/// </summary>
|
||||
float currentScore;
|
||||
List<ScoreSubjectStep> steps;
|
||||
}
|
|
@ -2,7 +2,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class ScoreSubjectStep : MonoBehaviour
|
||||
public class ScoreSubjectStep
|
||||
{
|
||||
/// <summary>
|
||||
/// 步骤满分
|
||||
|
@ -17,6 +17,10 @@ public class ScoreSubjectStep : MonoBehaviour
|
|||
/// </summary>
|
||||
bool isDone;
|
||||
|
||||
public ScoreSubjectStep(float maxScore)
|
||||
{
|
||||
this.maxScore = maxScore;
|
||||
}
|
||||
public void SetScore(float score)
|
||||
{
|
||||
isDone = true;
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Score_1002 : ScoreBase
|
||||
{
|
||||
|
||||
private void Init()
|
||||
{
|
||||
steps = new Dictionary<int, ScoreSubjectStep>();
|
||||
steps.Add(3001,new ScoreSubjectStep(0));
|
||||
steps.Add(3002, new ScoreSubjectStep(0));
|
||||
steps.Add(3003, new ScoreSubjectStep(5));
|
||||
steps.Add(3004, new ScoreSubjectStep(5));
|
||||
steps.Add(3005, new ScoreSubjectStep(5));
|
||||
steps.Add(3006, new ScoreSubjectStep(10));
|
||||
steps.Add(3007, new ScoreSubjectStep(5));
|
||||
steps.Add(3008, new ScoreSubjectStep(0));
|
||||
steps.Add(3009, new ScoreSubjectStep(3));
|
||||
steps.Add(3010, new ScoreSubjectStep(4));
|
||||
steps.Add(3011, new ScoreSubjectStep(3));
|
||||
steps.Add(3012, new ScoreSubjectStep(20));
|
||||
steps.Add(3013, new ScoreSubjectStep(20));
|
||||
steps.Add(3014, new ScoreSubjectStep(5));
|
||||
steps.Add(3015, new ScoreSubjectStep(5));
|
||||
steps.Add(3016, new ScoreSubjectStep(3));
|
||||
steps.Add(3017, new ScoreSubjectStep(4));
|
||||
steps.Add(3018, new ScoreSubjectStep(3));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ÅзÖ
|
||||
/// </summary>
|
||||
public void CheckScore()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8897a2609da37744e94a004f97f53e6a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -2,6 +2,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using DG.Tweening;
|
||||
|
||||
/// <summary>
|
||||
/// 묏야꼼죕샘잚
|
||||
|
@ -18,6 +19,9 @@ public class Tool_Base : PermanentTriggerBase
|
|||
/// </summary>
|
||||
public Func<string, bool, int> triggerAction;
|
||||
|
||||
private Vector3 head_LocalPos;
|
||||
private Vector3 head_LocalEulerAnglesl;
|
||||
|
||||
protected override void OnStart()
|
||||
{
|
||||
if ( GameManager.RunModelMgr.SceneType == E_SceneType.Site)
|
||||
|
@ -48,4 +52,24 @@ public class Tool_Base : PermanentTriggerBase
|
|||
{
|
||||
this.triggerAction = action;
|
||||
}
|
||||
/// <summary>
|
||||
/// 设置工具回到手中的位置
|
||||
/// </summary>
|
||||
/// <param name="head_LocalPos"></param>
|
||||
/// <param name="head_LocalEulerAnglesl"></param>
|
||||
public void SetHeadPosAndEulerang(Vector3 head_LocalPos,Vector3 head_LocalEulerAnglesl)
|
||||
{
|
||||
this.head_LocalPos = head_LocalPos;
|
||||
this.head_LocalEulerAnglesl= head_LocalEulerAnglesl;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 工具回到手中
|
||||
/// </summary>
|
||||
public void ReBackHead()
|
||||
{
|
||||
transform.parent=Camera.main.transform;
|
||||
transform.DOLocalMove(head_LocalPos, 1);
|
||||
transform.DOLocalRotate(head_LocalEulerAnglesl, 1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,23 +67,26 @@ public class Tool_Screw : Tool_Base
|
|||
Debug.Log("¿ªÊ¼Å¡½ôÂÝË¿");
|
||||
//ÉèÖÃÂÝË¿µ¶³õʼλÖÃ
|
||||
screwdriver.transform.parent = null;
|
||||
screwdriver.transform.position = installPos.position;
|
||||
screwdriver.transform.localEulerAngles = installPos.localEulerAngles;
|
||||
//动画
|
||||
transform.DOLocalMoveY(initPostionY, 1)
|
||||
.OnUpdate(() =>
|
||||
{
|
||||
transform.RotateAroundLocal(Vector3.up, 1);
|
||||
screwdriver.transform.position = installPos.position;
|
||||
screwdriver.transform.RotateAroundLocal(Vector3.right, 10);
|
||||
})
|
||||
.OnComplete(() =>
|
||||
{
|
||||
Debug.Log("螺丝已拧紧");
|
||||
isInstall = true;
|
||||
isMoving = false;
|
||||
installAction?.Invoke(true);
|
||||
});
|
||||
screwdriver.transform.DOLocalRotate(installPos.localEulerAngles, 0.5f);
|
||||
screwdriver.transform.DOMove(installPos.position, 1).OnComplete(() =>
|
||||
{
|
||||
//动画
|
||||
transform.DOLocalMoveY(initPostionY, 1)
|
||||
.OnUpdate(() =>
|
||||
{
|
||||
transform.RotateAroundLocal(Vector3.up, 1);
|
||||
screwdriver.transform.position = installPos.position;
|
||||
screwdriver.transform.RotateAroundLocal(Vector3.right, 10);
|
||||
})
|
||||
.OnComplete(() =>
|
||||
{
|
||||
Debug.Log("螺丝已拧紧");
|
||||
isInstall = true;
|
||||
isMoving = false;
|
||||
installAction?.Invoke(true);
|
||||
ReBackHead();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -99,23 +102,26 @@ public class Tool_Screw : Tool_Base
|
|||
Debug.Log("¿ªÊ¼Ð¶ÂÝË¿");
|
||||
//ÉèÖÃÂÝË¿µ¶³õʼλÖÃ
|
||||
screwdriver.transform.parent = null;
|
||||
screwdriver.transform.position = installPos.position;
|
||||
screwdriver.transform.localEulerAngles = installPos.localEulerAngles;
|
||||
//动画
|
||||
transform.DOLocalMoveY(initPostionY - 0.02f, 1)
|
||||
.OnUpdate(() =>
|
||||
{
|
||||
transform.RotateAroundLocal(Vector3.up, 1);
|
||||
screwdriver.transform.position = installPos.position;
|
||||
screwdriver.transform.RotateAroundLocal(Vector3.right, 10);
|
||||
})
|
||||
.OnComplete(() =>
|
||||
{
|
||||
Debug.Log("螺丝已拧松");
|
||||
isInstall = false;
|
||||
isMoving = false;
|
||||
installAction?.Invoke(false);
|
||||
});
|
||||
screwdriver.transform.DOLocalRotate(installPos.localEulerAngles, 0.5f);
|
||||
screwdriver.transform.DOMove(installPos.position, 1).OnComplete(() =>
|
||||
{
|
||||
//动画
|
||||
transform.DOLocalMoveY(initPostionY - 0.02f, 1)
|
||||
.OnUpdate(() =>
|
||||
{
|
||||
transform.RotateAroundLocal(Vector3.up, 1);
|
||||
screwdriver.transform.position = installPos.position;
|
||||
screwdriver.transform.RotateAroundLocal(Vector3.right, 10);
|
||||
})
|
||||
.OnComplete(() =>
|
||||
{
|
||||
Debug.Log("螺丝已拧松");
|
||||
isInstall = false;
|
||||
isMoving = false;
|
||||
installAction?.Invoke(false);
|
||||
ReBackHead();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,16 +44,34 @@ public class Tool_Screwdriver : Tool_Base
|
|||
Tool_Screw ts = hit.transform.GetComponent<Tool_Screw>();
|
||||
if (ts != null)
|
||||
{
|
||||
if (ts.id == "电能表盖子固定螺丝1" && !SiteManager.instance.measuringCabinet.meteringDevice.cover.cover_seal_Left.isCut)
|
||||
//固定螺丝操作限制
|
||||
if (ts.id == "电能表盖子固定螺丝1")
|
||||
{
|
||||
Debug.Log("封印未剪断");
|
||||
return;
|
||||
if (!SiteManager.instance.measuringCabinet.meteringDevice.cover.cover_seal_Left.isCut)
|
||||
{
|
||||
Debug.Log("封印未剪断");
|
||||
return;
|
||||
}
|
||||
|
||||
if(SiteManager.instance.measuringCabinet.meteringDevice.cover.isOpen)
|
||||
{
|
||||
Debug.Log("盖子打开的");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (ts.id == "电能表盖子固定螺丝2" && !SiteManager.instance.measuringCabinet.meteringDevice.cover.cover_seal_Right.isCut)
|
||||
if (ts.id == "电能表盖子固定螺丝2")
|
||||
{
|
||||
Debug.Log("封印未剪断");
|
||||
return;
|
||||
if (!SiteManager.instance.measuringCabinet.meteringDevice.cover.cover_seal_Right.isCut)
|
||||
{
|
||||
Debug.Log("封印未剪断");
|
||||
return;
|
||||
}
|
||||
if (SiteManager.instance.measuringCabinet.meteringDevice.cover.isOpen)
|
||||
{
|
||||
Debug.Log("盖子打开的");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//接线螺丝要先点击检查接线
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
using DG.Tweening;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.VisualScripting;
|
||||
|
@ -76,10 +77,13 @@ public class Tool_TestPen : Tool_Base
|
|||
var tmp = ((Device_Socket)device_base);
|
||||
//位置移动
|
||||
transform.parent = null;
|
||||
transform.position = tmp.testPosAndRot.position;
|
||||
transform.eulerAngles = tmp.testPosAndRot.eulerAngles;
|
||||
Debug.Log("¼ÆÁ¿¹ñ_²å×ù ÒÑÑéµç");
|
||||
isFlicker = tmp.hasElectricity;
|
||||
transform.DORotate(tmp.testPosAndRot.eulerAngles, 0.5f);
|
||||
transform.DOMove(tmp.testPosAndRot.position, 1).OnComplete(() =>
|
||||
{
|
||||
Debug.Log("¼ÆÁ¿¹ñ_²å×ù ÒÑÑéµç");
|
||||
isFlicker = tmp.hasElectricity;
|
||||
screem.materials[0].color = isFlicker ? Color.red : Color.white;
|
||||
});
|
||||
}
|
||||
else if (device_base.deviceType == DeviceType.计量柜_柜门)
|
||||
{
|
||||
|
@ -87,13 +91,14 @@ public class Tool_TestPen : Tool_Base
|
|||
|
||||
//位置移动
|
||||
transform.parent = null;
|
||||
transform.position = tmp.testPosAndRot.position;
|
||||
transform.localEulerAngles = tmp.testPosAndRot.localEulerAngles;
|
||||
Debug.Log("¼ÆÁ¿¹ñ_¹ñÃÅ ÒÑÑéµç");
|
||||
isFlicker = tmp.hasElectricity;
|
||||
transform.DOLocalRotate(tmp.testPosAndRot.localEulerAngles, 0.5f);
|
||||
transform.DOMove(tmp.testPosAndRot.position, 1).OnComplete(() =>
|
||||
{
|
||||
Debug.Log("¼ÆÁ¿¹ñ_¹ñÃÅ ÒÑÑéµç");
|
||||
isFlicker = tmp.hasElectricity;
|
||||
screem.materials[0].color = isFlicker ? Color.red : Color.white;
|
||||
});
|
||||
}
|
||||
|
||||
screem.materials[0].color = isFlicker ? Color.red : Color.white;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,13 +115,14 @@ public class Tool_TestPen : Tool_Base
|
|||
var tmp = ((Tool_Screw)tool_base);
|
||||
//位置移动
|
||||
transform.parent = null;
|
||||
transform.position = tmp.installPos.position;
|
||||
transform.localEulerAngles = tmp.installPos.localEulerAngles;
|
||||
Debug.Log("ÂÝË¿ ÒÑÑéµç");
|
||||
isFlicker = tmp.hasElectricity;
|
||||
transform.DOLocalRotate(tmp.installPos.localEulerAngles, 0.5f);
|
||||
transform.DOMove(tmp.installPos.position, 1).OnComplete(() =>
|
||||
{
|
||||
Debug.Log("ÂÝË¿ ÒÑÑéµç");
|
||||
isFlicker = tmp.hasElectricity;
|
||||
screem.materials[0].color = isFlicker ? Color.red : Color.white;
|
||||
});
|
||||
}
|
||||
|
||||
screem.materials[0].color = isFlicker ? Color.red : Color.white;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
using DG.Tweening;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
@ -17,11 +18,13 @@ public class Tool_WireStripper : Tool_Base
|
|||
{
|
||||
isCuning = true;
|
||||
transform.parent = null;
|
||||
transform.position = device_Seal.testPosAndRot.position;
|
||||
transform.eulerAngles = device_Seal.testPosAndRot.eulerAngles;
|
||||
//播放动画
|
||||
StopAllCoroutines();
|
||||
StartCoroutine(PlayAnimi(device_Seal));
|
||||
transform.DORotate(device_Seal.testPosAndRot.eulerAngles, 0.5f);
|
||||
transform.DOMove(device_Seal.testPosAndRot.position, 1).OnComplete(() =>
|
||||
{
|
||||
//播放动画
|
||||
StopAllCoroutines();
|
||||
StartCoroutine(PlayAnimi(device_Seal));
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -49,6 +52,7 @@ public class Tool_WireStripper : Tool_Base
|
|||
//¼ô¶Ï
|
||||
device_Seal.Cut();
|
||||
isCuning = false;
|
||||
ReBackHead();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using static UnityEngine.Rendering.DebugUI;
|
||||
|
@ -8,6 +9,7 @@ using static UnityEngine.Rendering.DebugUI;
|
|||
public class ProcessTipPanel : MonoBehaviour
|
||||
{
|
||||
public Image image;
|
||||
public TextMeshProUGUI textMeshProUGUI;
|
||||
/// <summary>
|
||||
/// 是否启用进度
|
||||
/// </summary>
|
||||
|
@ -35,6 +37,7 @@ public class ProcessTipPanel : MonoBehaviour
|
|||
this.isCheck=true;
|
||||
tmpback = back;
|
||||
Debug.Log("开始核对和抄录");
|
||||
textMeshProUGUI.text = "核对中";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -79,6 +82,7 @@ public class ProcessTipPanel : MonoBehaviour
|
|||
private void ThisDestroy()
|
||||
{
|
||||
Debug.Log("核对和抄录完成!");
|
||||
textMeshProUGUI.text = "核对完成";
|
||||
tmpback(true);
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue