Beispiel #1
0
    private void Init()
    {
        if (!isInit)
        {
            isInit = true;
            if (ConstantManager.GetInstance() != null)
            {
                width  = ConstantManager.GetWidthMap();
                height = ConstantManager.GetHeightMap();
            }
            else
            {
                width  = CONST_WIDTH;
                height = CONST_HEIGHT;
            }

/*#if UNITY_EDITOR
 *          width = 6;
 *          height = 7;
 #endif*/
            offSet          = Mathf.RoundToInt(height / 2f);
            allCreatedNodes = new GameObject[width, height];

            //Setup Background
            UpdateSizeBackground();
        }
    }
Beispiel #2
0
    private string GetRandomHint()
    {
        if (ConstantManager.GetInstance() == null)
        {
            return("");
        }
        List <string> hints = ConstantManager.GetHintConst();

        if (hints == null || hints.Count <= 0)
        {
            return(ConstantManager.HINT_DEFAULT);
        }
        int random = Random.Range(0, hints.Count);

        return(hints[random]);
    }
Beispiel #3
0
    IEnumerator LoadingUpdate()
    {
        IncreaseUpdate(5);
        yield return(new WaitForSeconds(0.1f));

        ConstantManager.GetInstance().Initialize();
        IncreaseUpdate(20);
        yield return(new WaitForSeconds(0.1f));

        int count = ConstantManager.CONST_KEY_TO_LOAD.Length;
        int per   = Mathf.RoundToInt(10 / count);

        if (per <= 0)
        {
            per = 1;
        }
        for (int i = 0; i < count; i++)
        {
            ConstantManager.GetInstance().LoadConstantByKey(ConstantManager.CONST_KEY_TO_LOAD[i]);
            if (i % per == 0)
            {
                IncreaseUpdate(5);
            }
            yield return(new WaitForSeconds(0.2f));
        }
        yield return(new WaitForSeconds(0.2f));

        hint.gameObject.SetActive(true);
        AutoHint();
        yield return(new WaitForSeconds(0.1f));

        IncreaseUpdate(20);
        yield return(new WaitForSeconds(0.2f));

        IncreaseUpdate(30);
        yield return(new WaitForSeconds(0.2f));

        IncreaseUpdate(20);
    }