taotijiao1

This commit is contained in:
taosuqi 2024-06-14 01:53:35 +08:00
parent 1cf7f71f98
commit 7dcc199ec8
4 changed files with 1273 additions and 6 deletions

View File

@ -29,9 +29,14 @@ public class Seal : MonoBehaviour
public Image EndOfProcessImage; public Image EndOfProcessImage;
/// <summary> /// <summary>
/// 封印动画 ///
/// </summary> /// </summary>
//public SkinnedMeshRenderer[] Sealski; // public BoxCollider SparentoverCol;
/// <summary>
/// ¹ñÃÅ¿¨Ë¨
/// </summary>
public GameObject CabinetDoorLatch;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {
@ -58,6 +63,7 @@ public class Seal : MonoBehaviour
if (hit.collider.gameObject.name == "集中器_封印R碰撞 ") if (hit.collider.gameObject.name == "集中器_封印R碰撞 ")
{ {
Sealcol[1].gameObject.SetActive(true); Sealcol[1].gameObject.SetActive(true);
CabinetDoorLatch.GetComponent<BoxCollider>().enabled = true;
Debug.Log(hit.collider.gameObject.name); Debug.Log(hit.collider.gameObject.name);
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"steps": [ "steps": [
{ {
"stepDescription": "前往现场", "stepDescription": "前往现场",
"score": 0, "score": 0,
@ -244,16 +244,59 @@
} }
] ]
}, },
{
"stepDescription": "盖_透明外壳还原",
"score": 0,
"actions": [
{
"description": "点击盖_透明外壳还原操作",
"score": 0,
"isSequential": false,
"targetObjects": [
"盖_透明外壳"
]
}
]
},
{
"stepDescription": "盖_透明外壳还原",
"score": 0,
"actions": [
{
"description": "点击盖_透明外壳还原操作",
"score": 0,
"isSequential": false,
"targetObjects": [
"透明盖子封印碰撞R",
"透明盖子封印碰撞L"
]
}
]
},
{
"stepDescription": "关上柜门",
"score": 0,
"actions": [
{
"description": "点击柜门卡栓还原关门",
"score": 0,
"isSequential": false,
"targetObjects": [
"柜门卡栓",
]
}
]
},
{ {
"stepDescription": "加装封印", "stepDescription": "加装封印",
"score": 0, "score": 0,
"actions": [ "actions": [
{ {
"description": "在集中器上加装封印,关上柜门后,柜门加装封印。", "description": "柜门加装封印。",
"score": 0, "score": 0,
"isSequential": false, "isSequential": false,
"targetObjects": [ "targetObjects": [
"加装封印" "电柜门封印box碰撞"
] ]
} }
] ]

View File

@ -27,6 +27,51 @@ public class Fieldobservation : MonoBehaviour
/// ´ò¿ª·âÓ¡ /// ´ò¿ª·âÓ¡
/// </summary> /// </summary>
bool isOpenLock; bool isOpenLock;
/// <summary>
/// 透明盖子
/// </summary>
public Transform Transparentover;
/// <summary>
/// 透明盖子上的两颗螺丝
/// </summary>
public GameObject[] screw;
/// <summary>
/// 判断封印盒子是否在手上
/// </summary>
bool isbox = true;
/// <summary>
/// 透明盖子上的封印cube碰撞
/// </summary>
public BoxCollider[] BOXseal;
/// <summary>
/// 柜门卡栓碰撞
/// </summary>
public BoxCollider guimenkashuan;
/// <summary>
/// 透明盖子上的封印
/// </summary>
public GameObject[] parentoverSeal;
/// <summary>
/// 电箱门
/// </summary>
public GameObject guimen;
/// <summary>
/// 门锁01
/// </summary>
public GameObject mensuo01;
/// <summary>
/// 柜门box碰撞
/// </summary>
public BoxCollider guimenbox;
void Start() void Start()
{ {
@ -34,7 +79,53 @@ public class Fieldobservation : MonoBehaviour
void Update() void Update()
{ {
if (Input.GetMouseButtonDown(0))
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
bool raycast = Physics.Raycast(ray, out hit);
if (raycast)
{
if (hit.collider.gameObject.name == "盖_透明外壳")
{
StartCoroutine(IEparentoverSeal());
if (isbox)
{
BOXseal[0].enabled = true;
BOXseal[1].enabled = true;
isbox = false;
}
}
if (hit.collider.gameObject.name == "透明盖子封印碰撞R")
{
if (isbox)
{
parentoverSeal[0].gameObject.SetActive(true);
isbox = false;
}
}
if (hit.collider.gameObject.name == "透明盖子封印碰撞L")
{
if (isbox)
{
parentoverSeal[1].gameObject.SetActive(true);
guimenkashuan.enabled = true;
isbox = false;
}
}
if (hit.collider.gameObject.name == "柜门卡栓")
{
StartCoroutine(IEguimenkashuan());
if (isbox)
{
guimenbox.GetComponent<BoxCollider>().enabled = true;
isbox = false;
}
}
}
}
} }
/// <summary> /// <summary>
@ -48,4 +139,36 @@ public class Fieldobservation : MonoBehaviour
ExclamationPointBtn.gameObject.SetActive(false); ExclamationPointBtn.gameObject.SetActive(false);
} }
} }
/// <summary>
/// 透明外盖上的封印
/// </summary>
/// <returns></returns>
IEnumerator IEparentoverSeal()
{
Transparentover.transform.DOLocalMove(new Vector3(-90f, 0, 0), 1f);
yield return new WaitForSeconds(1);
screw[0].gameObject.SetActive(true);
Transparentover.transform.DOLocalMove(new Vector3(-90f, 0, 0), 1f);
yield return new WaitForSeconds(1);
screw[0].gameObject.SetActive(true);
yield return new WaitForSeconds(0.5f);
screw[0].gameObject.transform.DOLocalMove(new Vector3(-90f, 0, 0), 1f);
screw[1].gameObject.SetActive(true);
yield return new WaitForSeconds(0.5f);
screw[1].gameObject.transform.DOLocalMove(new Vector3(-90f, 0, 0), 1f);
}
/// <summary>
/// 点击柜门卡栓动画
/// </summary>
/// <returns></returns>
IEnumerator IEguimenkashuan()
{
guimen.gameObject.transform.DOLocalMove(new Vector3(-90, 0, 0), 1);
yield return new WaitForSeconds(1.1f);
mensuo01.gameObject.transform.DOLocalMove(new Vector3(0, 0, 0), 1);
}
} }