ERROR- Assets\Scripts\GameManager.cs(17,28): error CS1061: ‘Button.ButtonClickedEvent’ does not contain a definition for ‘AddListner’ and no accessible extension method ‘AddListner’ accepting a first argument of type ‘Button.ButtonClickedEvent’ could be found (are you missing a using directive or an assembly reference?)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Button = UnityEngine.UI.Button;
public class GameManager : MonoBehaviour
{
public DroneController _DroneController;
public Button _FlyButton;
// Start is called before the first frame update
void Start()
{
_FlyButton.onClick.AddListner(EventOnClickFlyButton);
}
// Update is called once per frame
void Update()
{
float speedX = Input.GetAxis("Horizontal");
float speedZ = Input.GetAxis("Vertical");
_DroneController.Move(speedX, speedZ);
}
void EventOnClickFlyButton()
{
if(_DroneController.isIdle())
{
_DroneController.takeOff();
}
}