Exemplo n.º 1
0
    // Start is called before the first frame update
    public void Init(bool _inhibit = false)
    {
        button = GetComponent <Button>();
        img    = GetComponent <Image>();
        grid   = FindObjectOfType <GridLocation>();

        if (!_inhibit)
        {
            if (radar)
            {
                button.onClick.AddListener(() => grid.StartRadar(slotNumber));
            }
            else
            {
                button.onClick.AddListener(() => grid.PlaceBuldings(building, slotNumber));
            }
            StartCoroutine(FadeIn());
        }
        else
        {
            button.interactable = false;
        }
    }