using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; /// /// 编队控制脚本 /// public class FormationManager : MonoBehaviour { public Button startFormationBtn; public Button submitFormationBtn; public bool isStartFormation; // Start is called before the first frame update void Start() { startFormationBtn.onClick.AddListener(OnStartFormation); submitFormationBtn.onClick.AddListener(OnSubmit); } // Update is called once per frame void Update() { if (isStartFormation) { if (Input.GetKeyDown(KeyCode.LeftControl) && Input.GetMouseButtonDown(0)) { Debug.Log("拾取"); } } } public void OnStartFormation() { isStartFormation = true; } public void OnSubmit() { isStartFormation = false; } }