Esempio n. 1
0
    void Awake()
    {
        //Check if there is already an instance of SoundManager
        if (instance == null)
        {
            //if not, set it to this.
            instance = this;
        }
        //If instance already exists:
        else if (instance != this)
        {
            //Destroy this, this enforces our singleton pattern so there can only be one instance of SoundManager.
            Destroy(gameObject);
        }

        Advertisement.Initialize("1027042");
        levels     = GameObject.FindGameObjectWithTag("loading").gameObject;
        background = GameObject.FindGameObjectWithTag("backgrounds").gameObject;

        if (levels != null)
        {
            zerovictory = GeneralControls.ReturnNumber(levels, "victory");
            zerodefeat  = GeneralControls.ReturnNumber(levels, "zero");
            defeat1     = GeneralControls.ReturnNumber(levels, "defeated");
        }

        DontDestroyOnLoad(gameObject);
    }
Esempio n. 2
0
 private void getAdsDetails_actuals(HttpContext context)
 {
     try
     {
         MySqlCommand cmd;
         cmd = new MySqlCommand("SELECT  Ab_ads.ads_id, Ab_ads.Name, Ab_ads.status FROM Ab_ads");
         DataTable  leaddata        = dbm.SelectQuery(cmd).Tables[0];
         List <ads> getAddleadslist = new List <ads>();
         foreach (DataRow dr in leaddata.Rows)
         {
             ads ss = new ads();
             ss.sno    = dr["ads_id"].ToString();
             ss.Name   = dr["Name"].ToString();
             ss.status = dr["status"].ToString();
             getAddleadslist.Add(ss);
         }
         string response = GetJson(getAddleadslist);
         context.Response.Write(response);
     }
     catch (Exception ex)
     {
         string response = GetJson(ex.ToString());
         context.Response.Write(response);
     }
 }
Esempio n. 3
0

        
Esempio n. 4
0
 void Awake()
 {
     DontDestroyOnLoad(this);
     if (_instance == null)
     {
         _instance = this;
     }
     else
     {
         DestroyObject(gameObject);
     }
 }
Esempio n. 5
0
 public ads UpdateAds([FromBody] ads model)
 {
     if (model.anh != null)
     {
         var arrData = model.anh.Split(';');
         if (arrData.Length == 3)
         {
             var savePath = $@"{arrData[0]}";
             model.anh = $"{savePath}";
             SaveFileFromBase64String(savePath, arrData[2]);
         }
     }
     _adsBusiness.Update(model);
     return(model);
 }
Esempio n. 6
0
        public bool Update(ads model)
        {
            string msgError = "";

            try
            {
                var result = _dbHelper.ExecuteScalarSProcedureWithTransaction(out msgError, "ads_update",
                                                                              "@idads", model.idads,
                                                                              "@idtheloai", model.idtheloai,
                                                                              "@anh ", model.anh,
                                                                              "@noidung ", model.noidung);
                if ((result != null && !string.IsNullOrEmpty(result.ToString())) || !string.IsNullOrEmpty(msgError))
                {
                    throw new Exception(Convert.ToString(result) + msgError);
                }
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 7
0
 public bool Update(ads model)
 {
     return(_res.Update(model));
 }
Esempio n. 8
0
 public bool Create(ads model)
 {
     return(_res.Create(model));
 }
Esempio n. 9
0
    void Start( )
    {
        if (PlayerPrefs.GetInt("isFirstGame") == 0)
        {
            isFirstGame = true;
        }
        resetPossibleNumbers = possibleNumbers;
        isLevelController    = GameObject.FindWithTag("LevelController");
        if (isLevelController == null)
        {
            isLevelController = (GameObject)Instantiate(levelController);
        }
        isLevelController.GetComponent <leaderbords>( ).SearchCamera( );
        save = isLevelController.GetComponent <levelController>( );
        ads  = isLevelController.GetComponent <ads>( );
        if (PlayerPrefs.GetInt("isMuteSound") == 0)
        {
            soundOn.SetActive(true);
            soundMute.SetActive(false);
            lockS.mute = clock.mute = isLevelController.GetComponent <AudioSource>( ).mute = false;
        }
        else
        {
            soundOn.SetActive(false);
            soundMute.SetActive(true);
            lockS.mute = clock.mute = isLevelController.GetComponent <AudioSource>( ).mute = true;
        }
        if (save.isMenu)
        {
            anim.Play("arrow");
            if (PlayerPrefs.GetInt("AllNumberGame") >= (PlayerPrefs.GetInt("NumberNo") + 1) * 3)
            {
                if (PlayerPrefs.GetInt("NoRateGooglePlay") == 0)
                {
                    rateApp.SetActive(true);
                }
            }
        }
        else
        {
            anim.Play("loadLevel");
        }
        startMarker    = butttonPlay.position;
        timer          = save.timerPass + (isHardGame ? 1 : 0);
        level          = save.lvl;
        textLevel.text = "Уровень " + level;
        if (level <= 4)
        {
            difficult = 4;
        }
        else if (level <= 8)
        {
            difficult = 5;
        }
        else if (level <= 12)
        {
            difficult = 6;
        }
        else if (level <= 16)
        {
            difficult = 7;
        }
        else if (level <= 20)
        {
            difficult = 8;
        }
        else if (level > 20)
        {
            difficult = 9;
        }
        if (isFirstGame)
        {
            password = "******";
        }
        else
        {
            GenerationPassword(difficult);
        }
        timerText[0].text = (int)(timer / 10) + "";
        timerText[1].text = (int)(timer) - ((int)(timer / 10)) * 10 + "";
        timerText[2].text = (int)((timer - Mathf.FloorToInt(timer)) * 10) + "";
        timerText[3].text = (int)((timer - Mathf.FloorToInt(timer)) * 100) - ((int)((timer - Mathf.FloorToInt(timer)) * 10)) * 10 + "";
        difDropdown.onValueChanged.AddListener(delegate {
            DropdownValueChanged(difDropdown);
        });
        difDropdown.value  = PlayerPrefs.GetInt("Difficult");
        attempts           = 1;
        textScore.text     = "Очки: " + save.score;
        textHighScore.text = "Рекорд: " + PlayerPrefs.GetInt("HighScore");

        var curMaxLvl = PlayerPrefs.GetInt("MaxLvl");

        for (int i = 0; i < backgroundObjects.Length; i++)
        {
            if (curMaxLvl > 8 && curMaxLvl <= 16)
            {
                if (i < 6)
                {
                    backgroundObjects[i].interactable = true;
                }
            }
            else if (curMaxLvl > 16)
            {
                backgroundObjects[i].interactable = true;
            }
        }
        if (PlayerPrefs.GetInt("ShowBackgrounds") == 1)
        {
            PlayerPrefs.SetInt("ShowBackgrounds", 0);
            ShowSelectBackground();
        }
    }