using System.Collections; using System.Collections.Generic; using DragonLi.Core; using Mirror; using Unity.VisualScripting; using UnityEngine; public class TempHand : Launcher { private void OnTriggerEnter(Collider other) { if (other.CompareTag("TurretLeft")) { Debug.Log("触碰到左手"); EventDispatcher.TriggerEvent("HandLeftTrriger", true); } if (other.CompareTag("TurretRight")) { Debug.Log("触碰到右手"); EventDispatcher.TriggerEvent("HandRightTrriger", true); } } // ���ֱ��뿪��ǹ̨��������Χʱ private void OnTriggerExit(Collider other) { if (other.CompareTag("TurretLeft")) { EventDispatcher.TriggerEvent("HandLeftTrriger", false); } if (other.CompareTag("TurretRight")) { EventDispatcher.TriggerEvent("HandRightTrriger", false); } } public new void Update() { if (!isOwned) { return; } if(GameInit.Ins.self==null) return; // 左手 if (hand == HandType.Right) { // 同步左手位姿 transform.position = GameInit.Ins.self.RightHand.position; transform.rotation = GameInit.Ins.self.RightHand.rotation; } if (hand == HandType.Left) { // 同步左手位姿 transform.position = GameInit.Ins.self.LeftHand.position; transform.rotation = GameInit.Ins.self.LeftHand.rotation; } } }