using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class XFS : MonoBehaviour { public static XFS instance; // Start is called before the first frame update public Button ConnectGun; public Button ConnectFa; public Button OpenFa; public GameObject Gun; public Transform Hand; public Transform XFsTransform; public GameObject ShuiguanGameObject; public GameObject firewater; public GameObject water; public bool IShavewater=false; public UseSkill UseSkill; void Start() { instance=this; ConnectGun.onClick.AddListener((() => { Invoke("connectGun",6f);})); ConnectFa.onClick.AddListener(() => { Invoke("connectFa", 6f); }); OpenFa.onClick.AddListener(() => { Invoke("openFa", 6f); }); } public void connectGun() { UseSkill.Initgun(Gun); } public void connectFa() { Solver solver = ShuiguanGameObject.GetComponent(); solver.INit(Gun.transform); } public void openFa() { 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); water.SetActive(false); IShavewater = true; } // Update is called once per frame void Update() { } }