예제 #1
0
    public void DIE()
    {
        if (isOnActiveFleet)
        {
            hangar.removeShipfromFleet(this.gameObject);
        }

        print(this.name + " died in DIE()");

        this.hpSlider.gameObject.SetActive(false);
        this.gameObject.SetActive(false);
    }
예제 #2
0
    private void removeShipFromFleet(GameObject s)
    {
        _playerHangar.removeShipfromFleet(s);
        removeShipFromFleetButton.SetActive(false);

        if (_playerHangar.GetFleet().Count == 3)
        {
            battleButton.SetActive(true);
        }
        else
        {
            battleButton.SetActive(false);
        }


        addShipToFleetButton.SetActive(true);
        addShipToFleetButton.GetComponent <Button>().onClick.AddListener(delegate() { addShipToFleet(s.gameObject); });

        PersistantDataManager.Instance.SetPlayerHangar(_playerHangar);
    }