6.23修改
This commit is contained in:
parent
1a0b71dd82
commit
4023a75f52
|
|
@ -32,16 +32,43 @@ public class JunctionBox : MonoBehaviour
|
||||||
/// 接线盒是否盖上
|
/// 接线盒是否盖上
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool iscover;
|
public bool iscover;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 滑块的原始位置
|
||||||
|
/// </summary>
|
||||||
|
private List<Vector3> originalPosition=new List<Vector3>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 滑块的原始旋转
|
||||||
|
/// </summary>
|
||||||
|
private Quaternion originalRotation;
|
||||||
|
|
||||||
|
bool isanzhaung =false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 接线盒上的封印和螺丝
|
||||||
|
/// </summary>
|
||||||
|
public GameObject[] tool;
|
||||||
|
//public static JunctionBox intance;
|
||||||
|
|
||||||
|
//public void Awake()
|
||||||
|
//{
|
||||||
|
// intance = this;
|
||||||
|
//}
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < GameObjectSlider.Length; i++)
|
for (int i = 0; i < GameObjectSlider.Length; i++)
|
||||||
{
|
{
|
||||||
GameObjectSlider[i].GetComponent<HighlightEffect>().enabled = false;
|
GameObjectSlider[i].GetComponent<HighlightEffect>().enabled = false;
|
||||||
|
originalPosition.Add(GameObjectSlider[i].transform.localPosition);
|
||||||
|
//originalRotation = GameObjectSlider[i].transform.localRotation;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -102,16 +129,41 @@ public class JunctionBox : MonoBehaviour
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//else
|
if (AreAllTool())
|
||||||
//{
|
{
|
||||||
// Debug.Log("线盒还在");
|
switch (hit.collider.gameObject.name)
|
||||||
//}
|
{
|
||||||
|
case "接线盒纵向滑块001":
|
||||||
|
hit.collider.gameObject.transform.DOLocalMove(originalPosition[0], 1f);
|
||||||
|
Debug.Log(hit.collider.gameObject.name);
|
||||||
|
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
||||||
|
break;
|
||||||
|
case "接线盒纵向滑块002":
|
||||||
|
hit.collider.gameObject.transform.DOLocalMove(originalPosition[1], 1f);
|
||||||
|
Debug.Log(hit.collider.gameObject.name);
|
||||||
|
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
||||||
|
break;
|
||||||
|
case "接线盒纵向滑块003":
|
||||||
|
hit.collider.gameObject.transform.DOLocalMove(originalPosition[2], 1f);
|
||||||
|
Debug.Log(hit.collider.gameObject.name);
|
||||||
|
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
||||||
|
break;
|
||||||
|
case "接线盒纵向滑块004":
|
||||||
|
hit.collider.gameObject.transform.DOLocalMove(originalPosition[3], 1f);
|
||||||
|
Debug.Log(hit.collider.gameObject.name);
|
||||||
|
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
if (AreAllObjectsHidden())
|
if (AreAllObjectsHidden())
|
||||||
{
|
{
|
||||||
iscover = true;
|
|
||||||
TransparentlidObj.transform.DOLocalMove(new Vector3(0, -0.0914f, 0), 2f);
|
TransparentlidObj.transform.DOLocalMove(new Vector3(0, -0.0914f, 0), 2f);
|
||||||
|
iscover = true;
|
||||||
|
//isanzhaung = true;
|
||||||
for (int i = 0; i < GameObjectSlider.Length; i++)
|
for (int i = 0; i < GameObjectSlider.Length; i++)
|
||||||
{
|
{
|
||||||
GameObjectSlider[i].GetComponent<HighlightEffect>().enabled = true;
|
GameObjectSlider[i].GetComponent<HighlightEffect>().enabled = true;
|
||||||
|
|
@ -128,8 +180,20 @@ public class JunctionBox : MonoBehaviour
|
||||||
return false; // 如果找到任何一个激活的对象,返回false
|
return false; // 如果找到任何一个激活的对象,返回false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return true; // 如果所有对象都未激活,返回true
|
return true; // 如果所有对象都未激活,返回true
|
||||||
}
|
}
|
||||||
|
//判断新集中器上的螺丝和封印是否全部显示
|
||||||
|
public bool AreAllTool()
|
||||||
|
{
|
||||||
|
// 检查每个对象的激活状态
|
||||||
|
foreach (GameObject obj in tool)
|
||||||
|
{
|
||||||
|
if (obj.activeInHierarchy) // 使用 activeInHierarchy 如果你想检查对象是否在其父级结构中被激活
|
||||||
|
{
|
||||||
|
TransparentlidObj.gameObject.GetComponent<BoxCollider>().enabled = true;
|
||||||
|
return true; // 如果找到任何一个激活的对象,返回
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false; // 如果所有对象都未激活,返回false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -83,9 +83,9 @@ public class Screwdriver : MonoBehaviour
|
||||||
public InteractiveObjects[] interactiveObjects;
|
public InteractiveObjects[] interactiveObjects;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 拆完封印
|
/// 拆完旧集中器下端螺丝后
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool issplit;
|
bool issplit =true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 螺丝刀的原始位置
|
/// 螺丝刀的原始位置
|
||||||
|
|
@ -113,11 +113,11 @@ public class Screwdriver : MonoBehaviour
|
||||||
void Init()
|
void Init()
|
||||||
{
|
{
|
||||||
ElectricWireBcr.enabled = false;
|
ElectricWireBcr.enabled = false;
|
||||||
ElectricWireSMR.SetBlendShapeWeight(0, 0);
|
//ElectricWireSMR.SetBlendShapeWeight(0, 0);
|
||||||
ElectricWireSMR.SetBlendShapeWeight(1, 0);
|
//ElectricWireSMR.SetBlendShapeWeight(1, 0);
|
||||||
ElectricWireSMR.SetBlendShapeWeight(2, 0);
|
//ElectricWireSMR.SetBlendShapeWeight(2, 0);
|
||||||
ElectricWireSMR.SetBlendShapeWeight(3, 0);
|
//ElectricWireSMR.SetBlendShapeWeight(3, 0);
|
||||||
ElectricWireSMR.SetBlendShapeWeight(4, 0);
|
//ElectricWireSMR.SetBlendShapeWeight(4, 0);
|
||||||
ElectricWireSMR.SetBlendShapeWeight(5, 0);
|
ElectricWireSMR.SetBlendShapeWeight(5, 0);
|
||||||
TapeMar.SetFloat("_step_p1", 0);
|
TapeMar.SetFloat("_step_p1", 0);
|
||||||
TapeMar.SetFloat("_step_p2", 0);
|
TapeMar.SetFloat("_step_p2", 0);
|
||||||
|
|
@ -226,31 +226,7 @@ public class Screwdriver : MonoBehaviour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//判断上下两颗螺丝是否全部取下
|
chaiwan();
|
||||||
if (!ScrewObj[0].activeInHierarchy && !ScrewObj[1].activeInHierarchy)
|
|
||||||
{
|
|
||||||
StartCoroutine(Frist());
|
|
||||||
}
|
|
||||||
if (!ScrewObj[2].activeInHierarchy && !ScrewObj[3].activeInHierarchy)
|
|
||||||
{
|
|
||||||
StartCoroutine(Second());
|
|
||||||
}
|
|
||||||
if (!ScrewObj[4].activeInHierarchy && !ScrewObj[5].activeInHierarchy)
|
|
||||||
{
|
|
||||||
StartCoroutine(Thrid());
|
|
||||||
}
|
|
||||||
if (!ScrewObj[6].activeInHierarchy && !ScrewObj[7].activeInHierarchy)
|
|
||||||
{
|
|
||||||
StartCoroutine(Fourth());
|
|
||||||
}
|
|
||||||
if (!ScrewObj[9].activeInHierarchy)
|
|
||||||
{
|
|
||||||
StartCoroutine(Sixth());
|
|
||||||
}
|
|
||||||
if (!ScrewObj[8].activeInHierarchy)
|
|
||||||
{
|
|
||||||
StartCoroutine(Fivth());
|
|
||||||
}
|
|
||||||
if (ConcentratorScrew())
|
if (ConcentratorScrew())
|
||||||
{
|
{
|
||||||
StartCoroutine(IEConcentratorScrew());
|
StartCoroutine(IEConcentratorScrew());
|
||||||
|
|
@ -271,6 +247,52 @@ public class Screwdriver : MonoBehaviour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void chaiwan()
|
||||||
|
{
|
||||||
|
if (!issplit)
|
||||||
|
{
|
||||||
|
//判断上下两颗螺丝是否全部取下
|
||||||
|
if (!ScrewObj[0].activeInHierarchy && !ScrewObj[1].activeInHierarchy)
|
||||||
|
{
|
||||||
|
StartCoroutine(Frist());
|
||||||
|
issplit = true;
|
||||||
|
}
|
||||||
|
if (!ScrewObj[2].activeInHierarchy && !ScrewObj[3].activeInHierarchy)
|
||||||
|
{
|
||||||
|
StartCoroutine(Second());
|
||||||
|
issplit = true;
|
||||||
|
}
|
||||||
|
if (!ScrewObj[4].activeInHierarchy && !ScrewObj[5].activeInHierarchy)
|
||||||
|
{
|
||||||
|
|
||||||
|
StartCoroutine(Thrid());
|
||||||
|
|
||||||
|
issplit = true;
|
||||||
|
}
|
||||||
|
if (!ScrewObj[6].activeInHierarchy && !ScrewObj[7].activeInHierarchy)
|
||||||
|
{
|
||||||
|
|
||||||
|
StartCoroutine(Fourth());
|
||||||
|
|
||||||
|
issplit = true;
|
||||||
|
}
|
||||||
|
if (!ScrewObj[9].activeInHierarchy)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
StartCoroutine(Sixth());
|
||||||
|
issplit = true;
|
||||||
|
}
|
||||||
|
if (!ScrewObj[8].activeInHierarchy)
|
||||||
|
{
|
||||||
|
|
||||||
|
StartCoroutine(Fivth());
|
||||||
|
issplit = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 判断集中器螺丝
|
/// 判断集中器螺丝
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -313,6 +335,7 @@ public class Screwdriver : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (obj.activeInHierarchy)
|
if (obj.activeInHierarchy)
|
||||||
{
|
{
|
||||||
|
issplit = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,12 +31,35 @@ public class Seal : MonoBehaviour
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 透明盖子碰撞
|
/// 透明盖子碰撞
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public BoxCollider SparentoverCol;
|
// public BoxCollider SparentoverCol;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ¹ñÃÅ¿¨Ë¨
|
/// 左边柜门
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public GameObject CabinetDoorLatch;
|
public GameObject DoorLatch;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 柜门box碰撞
|
||||||
|
/// </summary>
|
||||||
|
public BoxCollider guimenbox;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 透明盖子上的封印
|
||||||
|
/// </summary>
|
||||||
|
public GameObject[] parentoverSeal;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 柜门卡栓碰撞
|
||||||
|
/// </summary>
|
||||||
|
public BoxCollider guimenkashuan;
|
||||||
|
|
||||||
|
public GameObject fengy;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 判断封印盒子是否在手上
|
||||||
|
/// </summary>
|
||||||
|
bool isbox = true;
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
|
|
@ -62,11 +85,38 @@ public class Seal : MonoBehaviour
|
||||||
}
|
}
|
||||||
if (hit.collider.gameObject.name == "集中器_封印R碰撞")
|
if (hit.collider.gameObject.name == "集中器_封印R碰撞")
|
||||||
{
|
{
|
||||||
|
Debug.Log(hit.collider.gameObject.name);
|
||||||
Sealcol[1].gameObject.SetActive(true);
|
Sealcol[1].gameObject.SetActive(true);
|
||||||
CabinetDoorLatch.GetComponent<BoxCollider>().enabled = true;
|
DoorLatch.GetComponent<BoxCollider>().enabled = true;
|
||||||
SparentoverCol.GetComponent<BoxCollider>().enabled = true;
|
//SparentoverCol.GetComponent<BoxCollider>().enabled = true;
|
||||||
Debug.Log(hit.collider.gameObject.name); MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
Debug.Log(hit.collider.gameObject.name); MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
||||||
}
|
}
|
||||||
|
if (hit.collider.gameObject.name == "透明盖子封印碰撞R")
|
||||||
|
{
|
||||||
|
if (isbox)
|
||||||
|
{
|
||||||
|
isbox = true;
|
||||||
|
parentoverSeal[0].gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
||||||
|
}
|
||||||
|
if (hit.collider.gameObject.name == "透明盖子封印碰撞L")
|
||||||
|
{
|
||||||
|
if (isbox)
|
||||||
|
{
|
||||||
|
isbox = true;
|
||||||
|
parentoverSeal[1].gameObject.SetActive(true);
|
||||||
|
guimenkashuan.enabled = true;
|
||||||
|
//isbox = false;
|
||||||
|
}
|
||||||
|
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
||||||
|
}
|
||||||
|
if (hit.collider.gameObject.name == "柜门卡栓")
|
||||||
|
{
|
||||||
|
fengy.gameObject.SetActive(true);
|
||||||
|
//fengy.transform.localPosition = new Vector3(0.6371536f, 0.02661133f, -0.01525164f);
|
||||||
|
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -75,4 +125,5 @@ public class Seal : MonoBehaviour
|
||||||
EndOfProcessImage.gameObject.SetActive(true);
|
EndOfProcessImage.gameObject.SetActive(true);
|
||||||
Debug.Log("流程结束");
|
Debug.Log("流程结束");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,9 +70,9 @@ public class ToolManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
Tool[5].gameObject.SetActive(false);
|
Tool[5].gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
if (Tool[6].activeInHierarchy)
|
if (Tool[7].activeInHierarchy)
|
||||||
{
|
{
|
||||||
Tool[6].gameObject.SetActive(false);
|
Tool[7].gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
processBt.onClick.AddListener(delegate
|
processBt.onClick.AddListener(delegate
|
||||||
|
|
@ -208,12 +208,12 @@ public class ToolManager : MonoBehaviour
|
||||||
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[4].gameObject.SetActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.Log("Received message: " + message);
|
Debug.Log("Received message: " + message);
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,15 @@ using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 集中器
|
||||||
|
/// </summary>
|
||||||
public class concentrator : MonoBehaviour
|
public class concentrator : MonoBehaviour
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 集中器
|
/// 集中器
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public GameObject concentratorObj;
|
public GameObject ConcentratorObj;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 集中器端子螺丝
|
/// 集中器端子螺丝
|
||||||
|
|
@ -31,10 +34,12 @@ public class concentrator : MonoBehaviour
|
||||||
/// 电线前段胶带
|
/// 电线前段胶带
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Material TapeMar;
|
public Material TapeMar;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 螺丝是否全部显示
|
/// 螺丝是否全部显示
|
||||||
/// </summary>
|
/// </summary>
|
||||||
int allls;
|
int allls;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否播放集线器螺丝拆完后电线动画
|
/// 是否播放集线器螺丝拆完后电线动画
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -46,7 +51,7 @@ public class concentrator : MonoBehaviour
|
||||||
public GameObject Cover;
|
public GameObject Cover;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 新盖子上左右两颗螺丝
|
/// 新集中器盖子上左右两颗螺丝
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public GameObject[] screw;
|
public GameObject[] screw;
|
||||||
|
|
||||||
|
|
@ -74,7 +79,7 @@ public class concentrator : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (hit.collider.gameObject.name == "新的集中器碰撞")
|
if (hit.collider.gameObject.name == "新的集中器碰撞")
|
||||||
{
|
{
|
||||||
concentratorObj.gameObject.transform.SetParent(null);
|
ConcentratorObj.gameObject.transform.SetParent(null);
|
||||||
StartCoroutine(Newconcentrator());
|
StartCoroutine(Newconcentrator());
|
||||||
Debug.Log(hit.collider.gameObject.name);
|
Debug.Log(hit.collider.gameObject.name);
|
||||||
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
||||||
|
|
@ -86,24 +91,50 @@ public class concentrator : MonoBehaviour
|
||||||
Debug.Log(hit.collider.gameObject.name);
|
Debug.Log(hit.collider.gameObject.name);
|
||||||
//StartCoroutine(IEHubSegmentRowScrews());
|
//StartCoroutine(IEHubSegmentRowScrews());
|
||||||
ScrewObj[i].GetComponent<MeshRenderer>().enabled = true;
|
ScrewObj[i].GetComponent<MeshRenderer>().enabled = true;
|
||||||
}
|
if (ScrewObj[0].GetComponent<MeshRenderer>().enabled & ScrewObj[1].GetComponent<MeshRenderer>().enabled)
|
||||||
}
|
|
||||||
if (hit.collider.gameObject.name == "pCylinder170")
|
|
||||||
{
|
{
|
||||||
if (isplaying)
|
StartCoroutine(TapeBackFrist());
|
||||||
{
|
|
||||||
StartCoroutine(IEElectricWire()); MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
|
||||||
isplaying = false;
|
|
||||||
}
|
}
|
||||||
|
if (ScrewObj[2].GetComponent<MeshRenderer>().enabled & ScrewObj[3].GetComponent<MeshRenderer>().enabled)
|
||||||
|
{
|
||||||
|
StartCoroutine(TapeBackSecond());
|
||||||
|
}
|
||||||
|
if (ScrewObj[4].GetComponent<MeshRenderer>().enabled & ScrewObj[5].GetComponent<MeshRenderer>().enabled)
|
||||||
|
{
|
||||||
|
StartCoroutine(TapeBackThird());
|
||||||
|
}
|
||||||
|
if (ScrewObj[6].GetComponent<MeshRenderer>().enabled & ScrewObj[7].GetComponent<MeshRenderer>().enabled)
|
||||||
|
{
|
||||||
|
StartCoroutine(TapeBackFourth());
|
||||||
|
}
|
||||||
|
if (ScrewObj[8].GetComponent<MeshRenderer>().enabled)
|
||||||
|
{
|
||||||
|
StartCoroutine(TapeBackFifth());
|
||||||
|
}
|
||||||
|
if (ScrewObj[9].GetComponent<MeshRenderer>().enabled)
|
||||||
|
{
|
||||||
|
StartCoroutine(TapeBackSixth());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (AreAllObjectsHidden())
|
if (AreAllObjectsHidden())
|
||||||
{
|
{
|
||||||
isPlayAni = false;
|
isPlayAni = false;
|
||||||
StartCoroutine(TapeBack());
|
//StartCoroutine(IEElectricWire());
|
||||||
|
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
||||||
// Debug.Log("所有螺丝都显示");
|
// Debug.Log("所有螺丝都显示");
|
||||||
}
|
}
|
||||||
|
//if (hit.collider.gameObject.name == "pCylinder170")
|
||||||
|
//{
|
||||||
|
// if (isplaying)
|
||||||
|
// {
|
||||||
|
// StartCoroutine(IEElectricWire());// MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
||||||
|
// isplaying = false;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -115,13 +146,15 @@ public class concentrator : MonoBehaviour
|
||||||
allls = 0;
|
allls = 0;
|
||||||
for (int i = 0; i < ScrewObj.Length; i++)
|
for (int i = 0; i < ScrewObj.Length; i++)
|
||||||
{
|
{
|
||||||
if (ScrewObj[i].gameObject.GetComponent<MeshRenderer>().enabled)
|
if (ScrewObj[i].gameObject.GetComponent<MeshRenderer>().enabled == true)
|
||||||
{
|
{
|
||||||
|
//StartCoroutine(IEElectricWire());
|
||||||
allls++;
|
allls++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (allls >= ScrewObj.Length - 1)
|
if (allls >=ScrewObj.Length )
|
||||||
{
|
{
|
||||||
|
StartCoroutine(IEElectricWire());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -129,31 +162,24 @@ public class concentrator : MonoBehaviour
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 集中器更换动画
|
/// 新集中器更换动画
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
IEnumerator Newconcentrator()
|
IEnumerator Newconcentrator()
|
||||||
{
|
{
|
||||||
concentratorObj.gameObject.transform.DOLocalMove(oncentratorTrans.gameObject.transform.position, 1f);//3.0778f, 2.2149f, -1.4581f
|
ConcentratorObj.gameObject.transform.DOLocalMove(oncentratorTrans.gameObject.transform.localPosition, 1f);//3.0778f, 2.2149f, -1.4581f
|
||||||
yield return new WaitForSeconds(1.0f);
|
yield return new WaitForSeconds(1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 集线器上线动画
|
/// 集中器盖子后续动画
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
IEnumerator IEElectricWire()
|
IEnumerator IEElectricWire()
|
||||||
{
|
{
|
||||||
TapeMarCol.enabled = false;
|
TapeMarCol.enabled = false;
|
||||||
for (int i = 0; i < 6; i++)
|
|
||||||
{
|
|
||||||
for (int a = 100; a >= 0; a--)
|
|
||||||
{
|
|
||||||
yield return new WaitForSeconds(0.01f);
|
|
||||||
ElectricWireSMR.SetBlendShapeWeight(i, a);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
yield return new WaitForSeconds(1f);
|
yield return new WaitForSeconds(1f);
|
||||||
Cover.gameObject.SetActive(true);
|
Cover.gameObject.SetActive(true);
|
||||||
yield return new WaitForSeconds(0.5f);
|
yield return new WaitForSeconds(0.5f);
|
||||||
|
|
@ -165,24 +191,103 @@ public class concentrator : MonoBehaviour
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 胶带还原动画
|
/// 第一个螺丝和第二个安装完成后卸下胶带和电线安装的动画
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
IEnumerator TapeBack()
|
IEnumerator TapeBackFrist()
|
||||||
{
|
{
|
||||||
TapeMarCol.enabled = true;
|
|
||||||
yield return new WaitForSeconds(1f);
|
|
||||||
TapeMar.SetFloat("_step_p6", 0);
|
|
||||||
yield return new WaitForSeconds(1f);
|
|
||||||
TapeMar.SetFloat("_step_p5", 0);
|
|
||||||
yield return new WaitForSeconds(1f);
|
|
||||||
TapeMar.SetFloat("_step_p4", 0);
|
|
||||||
yield return new WaitForSeconds(1f);
|
|
||||||
TapeMar.SetFloat("_step_p3", 0);
|
|
||||||
yield return new WaitForSeconds(1f);
|
|
||||||
TapeMar.SetFloat("_step_p2", 0);
|
|
||||||
yield return new WaitForSeconds(1f);
|
|
||||||
TapeMar.SetFloat("_step_p1", 0);
|
TapeMar.SetFloat("_step_p1", 0);
|
||||||
yield return new WaitForSeconds(1f);
|
if (ElectricWireSMR.GetBlendShapeWeight(0)!=0&& ElectricWireSMR.GetBlendShapeWeight(0)==100)
|
||||||
|
{
|
||||||
|
|
||||||
|
for (int i = 100; i >= 0; i--)
|
||||||
|
{
|
||||||
|
yield return new WaitForSeconds(0.01f);
|
||||||
|
ElectricWireSMR.SetBlendShapeWeight(0, i);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
IEnumerator TapeBackSecond()
|
||||||
|
{
|
||||||
|
TapeMar.SetFloat("_step_p2", 0);
|
||||||
|
if (ElectricWireSMR.GetBlendShapeWeight(1) != 0 && ElectricWireSMR.GetBlendShapeWeight(1) == 100)
|
||||||
|
{
|
||||||
|
for (int i = 100; i >= 0; i--)
|
||||||
|
{
|
||||||
|
yield return new WaitForSeconds(0.01f);
|
||||||
|
ElectricWireSMR.SetBlendShapeWeight(1, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
IEnumerator TapeBackThird()
|
||||||
|
{
|
||||||
|
TapeMar.SetFloat("_step_p3", 0);
|
||||||
|
if (ElectricWireSMR.GetBlendShapeWeight(2) != 0 && ElectricWireSMR.GetBlendShapeWeight(2) == 100)
|
||||||
|
{
|
||||||
|
for (int i = 100; i >= 0; i--)
|
||||||
|
{
|
||||||
|
yield return new WaitForSeconds(0.01f);
|
||||||
|
ElectricWireSMR.SetBlendShapeWeight(2, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
IEnumerator TapeBackFourth()
|
||||||
|
{
|
||||||
|
TapeMar.SetFloat("_step_p4", 0);
|
||||||
|
if (ElectricWireSMR.GetBlendShapeWeight(3) != 0 && ElectricWireSMR.GetBlendShapeWeight(3) == 100)
|
||||||
|
{
|
||||||
|
for (int i = 100; i >= 0; i--)
|
||||||
|
{
|
||||||
|
yield return new WaitForSeconds(0.01f);
|
||||||
|
ElectricWireSMR.SetBlendShapeWeight(3, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
IEnumerator TapeBackFifth()
|
||||||
|
{
|
||||||
|
TapeMar.SetFloat("_step_p5", 0);
|
||||||
|
if (ElectricWireSMR.GetBlendShapeWeight(4) != 0 && ElectricWireSMR.GetBlendShapeWeight(4) == 100)
|
||||||
|
{
|
||||||
|
for (int i = 100; i >= 0; i--)
|
||||||
|
{
|
||||||
|
yield return new WaitForSeconds(0.01f);
|
||||||
|
ElectricWireSMR.SetBlendShapeWeight(4, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
IEnumerator TapeBackSixth()
|
||||||
|
{
|
||||||
|
TapeMar.SetFloat("_step_p6", 0);
|
||||||
|
if (ElectricWireSMR.GetBlendShapeWeight(5) != 0 && ElectricWireSMR.GetBlendShapeWeight(5) == 100)
|
||||||
|
{
|
||||||
|
for (int i = 100; i >= 0; i--)
|
||||||
|
{
|
||||||
|
yield return new WaitForSeconds(0.01f);
|
||||||
|
ElectricWireSMR.SetBlendShapeWeight(5, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 胶带还原&和电线还原动画
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
//IEnumerator IETapeBackFrist()
|
||||||
|
//{
|
||||||
|
|
||||||
|
// yield return new WaitForSeconds(1f);
|
||||||
|
// TapeMar.SetFloat("_step_p6", 0);
|
||||||
|
// yield return new WaitForSeconds(1f);
|
||||||
|
// TapeMar.SetFloat("_step_p5", 0);
|
||||||
|
// yield return new WaitForSeconds(1f);
|
||||||
|
// TapeMar.SetFloat("_step_p4", 0);
|
||||||
|
// yield return new WaitForSeconds(1f);
|
||||||
|
// TapeMar.SetFloat("_step_p3", 0);
|
||||||
|
// yield return new WaitForSeconds(1f);
|
||||||
|
// TapeMar.SetFloat("_step_p2", 0);
|
||||||
|
// yield return new WaitForSeconds(1f);
|
||||||
|
// TapeMar.SetFloat("_step_p1", 0);
|
||||||
|
// yield return new WaitForSeconds(1f);
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,10 +52,10 @@ public class Fieldobservation : MonoBehaviour
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public BoxCollider guimenkashuan;
|
public BoxCollider guimenkashuan;
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 透明盖子上的封印
|
///// 透明盖子上的封印
|
||||||
/// </summary>
|
///// </summary>
|
||||||
public GameObject[] parentoverSeal;
|
//public GameObject[] parentoverSeal;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// µçÏäÃÅ
|
/// µçÏäÃÅ
|
||||||
|
|
@ -109,26 +109,8 @@ public class Fieldobservation : MonoBehaviour
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (hit.collider.gameObject.name == "透明盖子封印碰撞R")
|
|
||||||
{
|
if (hit.collider.gameObject.name == "变电箱_门")
|
||||||
if (isbox)
|
|
||||||
{
|
|
||||||
parentoverSeal[0].gameObject.SetActive(true);
|
|
||||||
isbox = false;
|
|
||||||
}
|
|
||||||
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
|
||||||
}
|
|
||||||
if (hit.collider.gameObject.name == "透明盖子封印碰撞L")
|
|
||||||
{
|
|
||||||
if (isbox)
|
|
||||||
{
|
|
||||||
parentoverSeal[1].gameObject.SetActive(true);
|
|
||||||
guimenkashuan.enabled = true;
|
|
||||||
isbox = false;
|
|
||||||
}
|
|
||||||
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
|
||||||
}
|
|
||||||
if (hit.collider.gameObject.name == "柜门卡栓")
|
|
||||||
{
|
{
|
||||||
StartCoroutine(IEguimenkashuan());
|
StartCoroutine(IEguimenkashuan());
|
||||||
//if (isbox)
|
//if (isbox)
|
||||||
|
|
@ -138,12 +120,7 @@ public class Fieldobservation : MonoBehaviour
|
||||||
// }
|
// }
|
||||||
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
||||||
}
|
}
|
||||||
if (hit.collider.gameObject.name == "电柜门封印box碰撞")
|
|
||||||
{
|
|
||||||
fengy.gameObject.SetActive(true);
|
|
||||||
fengy.transform.localPosition = new Vector3(0.6371536f, 0.02661133f, -0.01525164f);
|
|
||||||
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(hit.collider.gameObject.name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -207,6 +184,6 @@ public class Fieldobservation : MonoBehaviour
|
||||||
guimen.gameObject.transform.DOLocalRotate(new Vector3(-90, 0, 0), 1);
|
guimen.gameObject.transform.DOLocalRotate(new Vector3(-90, 0, 0), 1);
|
||||||
yield return new WaitForSeconds(1.1f);
|
yield return new WaitForSeconds(1.1f);
|
||||||
mensuo01.gameObject.transform.DOLocalRotate(new Vector3(0, 0, 0), 1);
|
mensuo01.gameObject.transform.DOLocalRotate(new Vector3(0, 0, 0), 1);
|
||||||
|
guimenkashuan.gameObject.GetComponent<BoxCollider>().enabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue