Пример #1
0
    // Use this for initialization (valeurs de défaut de l'objet)
    void Start()
    {
        // Trouve tous les GameObject ayant le tag "Wall"
        canons = GameObject.FindGameObjectsWithTag("Wall");
        //Gun
        gun = FindObjectOfType <Projectile>();

        // Reset icons
        moneyActivatedIcon.GetComponent <Image> ().fillAmount      = 0.0f;
        stopCanonActivatedIcon.GetComponent <Image> ().fillAmount  = 0.0f;
        invincibleActivatedIcon.GetComponent <Image> ().fillAmount = 0.0f;

        //Cacher le magasins de Power-ups et le panel de message
        shopController.CloseShop();
        shopController.openShop = true;
        messagePanel.Close();
        messagePanel.openPanel = true;

        //Appliquer les power-ups que le joueur a achete
        if (GlobalControl.Instance.nbProtection > 0 && SceneManager.GetActiveScene().name != "Scene")
        {
            shieldQuantity           = GlobalControl.Instance.nbProtection;
            texteShieldQuantity.text = "" + shieldQuantity;
        }
        if (GlobalControl.Instance.bootsSelected)
        {
            itemShopActivatedBoots = true;
            bootsQuantity.text     = "1";
        }
        if (GlobalControl.Instance.gunSelected)
        {
            gun.gunActivated = true;
            gunQuantity.text = "1";
        }

        GlobalControl.Instance.Reset();

        if (SceneManager.GetActiveScene().name == "Scene")
        {
            progressBar.slider.maxValue = 10;
            progressBar.slider.minValue = 0;
            progressBar.slider.value    = 0;
        }
        else if (SceneManager.GetActiveScene().name == "Scene_LV2")
        {
            progressBar.slider.maxValue = 15;
            progressBar.slider.minValue = 0;
            progressBar.slider.value    = 0;
        }
        else if (SceneManager.GetActiveScene().name == "Scene_LV3")
        {
            progressBar.slider.maxValue = 20;
            progressBar.slider.minValue = 0;
            progressBar.slider.value    = 0;
        }
    }
Пример #2
0
 public void ExitClick()
 {
     ShopController.CloseShop();
     StartCoroutine(CoroutineCloseMenu());
 }