2024-12-16 20:29:28 +08:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
public class XFS : MonoBehaviour
|
|
|
|
{
|
2024-12-17 17:06:14 +08:00
|
|
|
public static XFS instance;
|
2024-12-16 20:29:28 +08:00
|
|
|
// Start is called before the first frame update
|
|
|
|
public Button ConnectGun;
|
|
|
|
public Button ConnectFa;
|
|
|
|
public Button OpenFa;
|
|
|
|
public GameObject Gun;
|
|
|
|
public Transform Hand;
|
2024-12-17 10:58:51 +08:00
|
|
|
public Transform XFsTransform;
|
|
|
|
public GameObject ShuiguanGameObject;
|
2024-12-18 11:38:13 +08:00
|
|
|
public GameObject gun;
|
2024-12-17 12:00:17 +08:00
|
|
|
public GameObject firewater;
|
2024-12-17 17:06:14 +08:00
|
|
|
public GameObject water;
|
2024-12-17 17:27:46 +08:00
|
|
|
public bool IShavewater=false;
|
2024-12-16 20:29:28 +08:00
|
|
|
void Start()
|
|
|
|
{
|
2024-12-17 17:06:14 +08:00
|
|
|
instance=this;
|
2024-12-17 12:00:17 +08:00
|
|
|
ConnectGun.onClick.AddListener((() => { Invoke("connectGun",6f);}));
|
|
|
|
ConnectFa.onClick.AddListener(() => { Invoke("connectFa", 6f); });
|
|
|
|
OpenFa.onClick.AddListener(() => { Invoke("openFa", 6f); });
|
2024-12-16 20:29:28 +08:00
|
|
|
}
|
|
|
|
|
2024-12-17 12:00:17 +08:00
|
|
|
public void connectGun()
|
2024-12-16 20:29:28 +08:00
|
|
|
{
|
2024-12-17 10:58:51 +08:00
|
|
|
gun = Instantiate(Gun);
|
|
|
|
gun.transform.SetParent(Hand);
|
|
|
|
gun.transform.localRotation = new Quaternion(0, 180, 0, 0);
|
|
|
|
gun.transform.localPosition = new Vector3(0.000419999997f, 0.00138999999f, 0.000569999975f);
|
|
|
|
gun.transform.localScale = new Vector3(0.01f, 0.01f, 0.01f);
|
2024-12-16 20:29:28 +08:00
|
|
|
}
|
|
|
|
|
2024-12-17 12:00:17 +08:00
|
|
|
public void connectFa()
|
2024-12-16 20:29:28 +08:00
|
|
|
{
|
2024-12-18 03:03:46 +08:00
|
|
|
Solver solver = ShuiguanGameObject.GetComponent<Solver>();
|
|
|
|
solver.INit(gun.transform);
|
2024-12-16 20:29:28 +08:00
|
|
|
}
|
|
|
|
|
2024-12-17 12:00:17 +08:00
|
|
|
public void openFa()
|
2024-12-16 20:29:28 +08:00
|
|
|
{
|
2024-12-17 17:06:14 +08:00
|
|
|
water = Instantiate(firewater);
|
|
|
|
water.transform.SetParent(gun.transform);
|
|
|
|
water.transform.localPosition = new Vector3(0, 0, 0);
|
|
|
|
water.transform.localRotation = new Quaternion(0, 180, 0, 0);
|
2024-12-17 17:27:46 +08:00
|
|
|
water.SetActive(false);
|
|
|
|
IShavewater = true;
|
2024-12-16 20:29:28 +08:00
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
|
|
void Update()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|