NewN_UAVPlane/Assets/Zion/Scripts/Adam/FormationManager.cs

44 lines
948 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 编队控制脚本
/// </summary>
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;
}
}