Exemplo n.º 1
0
    public void Next()
    {
        DisableAll();
        DataCentre.SelectedWeaponMenu = Mathf.Clamp(DataCentre.SelectedWeaponMenu + 1, 0, 5);
        if (DataCentre.SelectedWeaponMenu > 4)
        {
            DataCentre.SelectedWeaponMenu = 0;
        }
//		weapons [DataCentre.SelectedWeaponMenu].SetActive (true);
        gunproperties [DataCentre.SelectedWeaponMenu].SetActive(true);
        priceLabel.GetComponent <Text> ().text = DataCentre.WeaponPrice [DataCentre.SelectedWeaponMenu].ToString();

        ManageBuyButton();

        selectedWeapon = DataCentre.SelectedWeaponMenu;

        if (DataCentre.SelectedWeaponMenu == DataCentre.equipedGun)
        {
            equiped.SetActive(true);
        }
        else
        {
            equiped.SetActive(false);
        }
//		weapons[DataCentre.SelectedWeaponMenu].GetComponent<Animation> ().Play ("Reload");
        DataCentre.Save();
    }
Exemplo n.º 2
0
    public void BuyWeapon(int weaponID)
    {
        if (DataCentre.Coins >= DataCentre.WeaponPrice [weaponID])
        {
            DataCentre.Coins -= DataCentre.WeaponPrice [weaponID];
            DataCentre.UnlockWeapon [weaponID] = true;
            totalCoins.text = DataCentre.Coins.ToString();
            buyButtons [weaponID].SetActive(false);
            buyButtons [0].SetActive(true);
            _lock.SetActive(false);

            DataCentre.Save();
        }
        else
        {
            popup.SetActive(true);
        }
    }
Exemplo n.º 3
0
 public void PlayFromWeapon()
 {
     DataCentre.equipedGun = DataCentre.SelectedWeaponMenu;
     DataCentre.Save();
 }
    // Update is called once per frame
    void Update()
    {
        if (npcRegistry.Npcs.Count == 0 && healthText.healthGui > 0)
        {
            if (abComplete == 0)
            {
                hudMenu    = GameObject.FindObjectOfType <HudMenuController> ();
                abComplete = 1;

                // level complete database setting
                if (DataCentre.BaseID == 1)
                {
                    if (DataCentre.CurrentLevel < 9)
                    {
                        DataCentre.UnlockLevel1 [Mathf.Clamp(DataCentre.CurrentLevel + 1, 0, DataCentre.UnlockLevel1.Length)] = true;
                    }
                    if (DataCentre.CurrentLevel == 9)
                    {
                        DataCentre.UnlockBase [1] = true;
                    }
                }

                if (DataCentre.BaseID == 2)
                {
                    if (DataCentre.CurrentLevel < 9)
                    {
                        DataCentre.UnlockLevel2 [Mathf.Clamp(DataCentre.CurrentLevel + 1, 0, DataCentre.UnlockLevel2.Length)] = true;
                    }
                    if (DataCentre.CurrentLevel == 9)
                    {
//						DataCentre.UnlockBase [2] = true;
                    }
                }

                if (DataCentre.BaseID == 3)
                {
                    if (DataCentre.CurrentLevel < 9)
                    {
                        DataCentre.UnlockLevel3 [Mathf.Clamp(DataCentre.CurrentLevel + 1, 0, DataCentre.UnlockLevel3.Length)] = true;
                    }
                }


                DataCentre.Save();


                Debug.Log("Level Complete");
                hudMenu.OnLevelComplete();

                DataCentre.Save();
                minimap.SetActive(false);
            }
        }


        if (npcRegistry.Npcs.Count > 0 && healthText.healthGui < 2)
        {
            if (abFail == 0)
            {
                abFail  = 1;
                hudMenu = GameObject.FindObjectOfType <HudMenuController> ();
                Debug.Log("Game Failed");
                hudMenu.OnLevelFailed();
                minimap.SetActive(false);
            }
        }



        if (DataCentre.SCORE == 25)
        {
            //	GPGManager.Instance.UnlockAchievment01 ();
        }
        if (DataCentre.SCORE == 50)
        {
            //	GPGManager.Instance.UnlockAchievment02 ();
        }
        if (DataCentre.SCORE == 100)
        {
            //	GPGManager.Instance.UnlockAchievment03 ();
        }
        if (DataCentre.SCORE == 2)
        {
            //	GPGManager.Instance.UnlockAchievment04 ();
        }
        if (DataCentre.SCORE == 10)
        {
            //	GPGManager.Instance.UnlockAchievment05 ();
        }
        if (DataCentre.SCORE == 60)
        {
            //	GPGManager.Instance.UnlockAchievment06 ();
        }
    }