This commit is contained in:
YangHua 2023-09-17 17:06:34 +08:00
commit d90489fd56
4 changed files with 62 additions and 22 deletions

View File

@ -10576,6 +10576,10 @@ PrefabInstance:
propertyPath: m_Name
value: "\u4F0F\u5B89UI"
objectReference: {fileID: 0}
- target: {fileID: 5953364403843559748, guid: 6858abc4395af9947bb1e19b0f27fffb, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5953364403843559751, guid: 6858abc4395af9947bb1e19b0f27fffb, type: 3}
propertyPath: m_Pivot.x
value: 0.5
@ -140631,6 +140635,10 @@ PrefabInstance:
propertyPath: m_TagString
value: Untagged
objectReference: {fileID: 0}
- target: {fileID: 1253040782233410607, guid: 3fb1235fb3cb2ea4782e6c99e4cff4bf, type: 3}
propertyPath: isDian
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4300732867488139875, guid: 3fb1235fb3cb2ea4782e6c99e4cff4bf, type: 3}
propertyPath: m_RootOrder
value: 24

View File

@ -19,32 +19,35 @@ public class MultimeterManager : MonoBehaviour
// Update is called once per frame
void Update()
{
// 鼠标左键按下
if (Input.GetMouseButtonDown(0))
if (Camera)
{
// 从相机位置发射一条射线经过屏幕上的鼠标点击位置
Ray ray = Camera.ScreenPointToRay(Input.mousePosition);
// 声明一个射线碰撞信息类
RaycastHit hit;
// 进行碰撞检测
bool res = Physics.Raycast(ray, out hit,1 << 7) && !EventSystem.current.IsPointerOverGameObject();
if (res)
// 鼠标左键按下
if (Input.GetMouseButtonDown(0))
{
// 如果产生了碰撞
if (hit.collider.name.Equals("RedWanYon"))
// 从相机位置发射一条射线经过屏幕上的鼠标点击位置
Ray ray = Camera.ScreenPointToRay(Input.mousePosition);
// 声明一个射线碰撞信息类
RaycastHit hit;
// 进行碰撞检测
bool res = Physics.Raycast(ray, out hit, 1 << 7) && !EventSystem.current.IsPointerOverGameObject();
if (res)
{
GameManager.ins.BlackWanYon = null;
GameManager.ins.RedWanYon = RedXian.gameObject;
// 如果产生了碰撞
if (hit.collider.name.Equals("RedWanYon"))
{
GameManager.ins.BlackWanYon = null;
GameManager.ins.RedWanYon = RedXian.gameObject;
}
if (hit.collider.name.Equals("BlackWanYon"))
{
GameManager.ins.RedWanYon = null;
GameManager.ins.BlackWanYon = blackXian.gameObject;
}
Debug.Log(hit.collider.name);
}
if (hit.collider.name.Equals("BlackWanYon"))
{
GameManager.ins.RedWanYon = null;
GameManager.ins.BlackWanYon = blackXian.gameObject;
}
Debug.Log(hit.collider.name);
}
}
}

View File

@ -0,0 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class VoltAmpereMeter : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 009306981be6fdd42bcf5d7f9474d54a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: