58 lines
1.4 KiB
C#
58 lines
1.4 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// 盒装封印
|
|
/// </summary>
|
|
|
|
public class Seal : MonoBehaviour
|
|
{
|
|
/// <summary>
|
|
/// 盒装封印
|
|
/// </summary>
|
|
public GameObject SealObj;
|
|
|
|
/// <summary>
|
|
/// 新集中器上封印
|
|
/// </summary>
|
|
public GameObject[] Sealcol;
|
|
|
|
/// <summary>
|
|
/// 封印动画
|
|
/// </summary>
|
|
//public SkinnedMeshRenderer[] Sealski;
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
for (int i = 0; i < Sealcol.Length; i++)
|
|
{
|
|
Sealcol[i].GetComponent<BoxCollider>().enabled = true;
|
|
}
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
if (Input.GetMouseButtonDown(0))
|
|
{//Camera.transform.forward
|
|
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
|
RaycastHit hit;
|
|
bool raycast = Physics.Raycast(ray, out hit);
|
|
if (raycast)
|
|
{
|
|
if (hit.collider.gameObject.name == "集中器_封印_L碰撞")
|
|
{
|
|
Sealcol[0].gameObject.SetActive(true);
|
|
Debug.Log(hit.collider.gameObject.name);
|
|
}
|
|
if (hit.collider.gameObject.name == "集中器_封印R碰撞 ")
|
|
{
|
|
Sealcol[1].gameObject.SetActive(true);
|
|
Debug.Log(hit.collider.gameObject.name);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|