Exemple #1
0
    private void Awake()
    {
        curPannelState = selectPannel.c_00_logo;

        gpsPopClicked    = false;
        cameraPopClicked = false;
        pushOnce         = false;
        panel_01_authorization.SetActive(false);
        panel_02_resource.SetActive(false);

        curGpsPermission    = gpsPermission.notSet;
        curCameraPermission = cameraPermission.notSet;


        pushOnce = false;

        //get os status
#if UNITY_ANDROID
        curDeviceMode = OsMode.android;
#elif UNITY_IOS
        curDeviceMode       = OsMode.ios;
        Screen.sleepTimeout = SleepTimeout.NeverSleep;
#endif

        //check init status
        isInitApp = PlayerPrefs.GetString("isInitApp");
        Debug.Log("curDeviceMode? =====>" + curDeviceMode);
        CheckPermissionState();
        StartCoroutine(DelayOnLogo());
    }
Exemple #2
0
    public IEnumerator PushPermissionPopUp()
    {
        if (!pushOnce)
        {
            PopGpsPermission();
        }

        yield return(new WaitForSeconds(0.2f));

        yield return(new WaitUntil(() => Application.isFocused == true));

        Debug.Log("application focus ? ->" + Application.isFocused);
        GetGpsPermission();

        yield return(new WaitUntil(() => gpsPopClicked));

        pushOnce = false;

        if (!cameraPopClicked)
        {
            PopCameraPermission();
        }

        yield return(new WaitForSeconds(0.2f));

        Debug.Log("application focus ? ->" + Application.isFocused);
        yield return(new WaitUntil(() => Application.isFocused == true));

        GetCameraPermission();
        yield return(new WaitUntil(() => cameraPopClicked));

        if (loader.isNeedToDownload)
        {
            Debug.Log("++++++++need to download+++++++++");

            //start from jsonsort
            //StartCoroutine(loader.LoadJsonAndSort());
        }
        else
        {
            Debug.Log("+++++++++don't need to download json +++++++");
            SourceLoader.isPermissionChecked = true;
        }


        if (curDeviceMode == OsMode.ios)
        {
            PlayerPrefs.SetString("isInitApp", "true");
        }


        //check loading or select
        curPannelState = selectPannel.c_CheckNextState;

        yield return(null);
    }
Exemple #3
0
    //private void Update()
    //{
    //    if(Input.touchCount>0)
    //    {
    //        Touch touch = Input.GetTouch(0);
    //        if (touch.phase == TouchPhase.Began)
    //        {
    //            Debug.Log("start Check json");
    //            loader.CheckJsonExist();
    //            //추후에  연결
    //           // StartCoroutine(loader.LoadJsonAndSort());

    //        }

    //    }
    //    if (Input.GetKeyDown(KeyCode.P) )
    //    {
    //        loader.CheckJsonExist();
    //        //추후에  연결
    //       // StartCoroutine(loader.LoadJsonAndSort());
    //    }

    //    if (Input.GetKeyDown(KeyCode.G))
    //    {
    //        gpsPopClicked = true;
    //    }

    //    if (Input.GetKeyDown(KeyCode.C))
    //    {
    //        cameraPopClicked = true;
    //    }

    //    if (Input.GetKeyDown(KeyCode.KeypadEnter))
    //    {
    //        Debug.Log("start loading pannel");
    //        curPannelState = SelectManager.selectPannel.c_CheckNextState;
    //    }

    //}

    void CheckNextPannel()
    {
        Debug.Log("start CheckNextPannel");

        Debug.Log("check next pannel cur dowload need? --->" + loader.isNeedToDownload);
        if (SourceLoader.isPermissionChecked)
        {
            if (DataSorter.instance.list_DownloadObject.Count == 0)
            {
                Debug.Log("download end skip loading");
                //move to select pannel
                curPannelState = selectPannel.c_03_selectCharacter;
            }
            else
            {
                Debug.Log("start download");

                //start loading bar
                InitLoadingBar();
                //get loading
                curPannelState = selectPannel.c_02_resource;
                Debug.Log("다운로드 숫자" + DataSorter.instance.list_DownloadObject.Count + "<- 다운로드 시작 ");
            }
        }
        else
        {
            if (loader.isNeedToDownload)
            {
                SourceLoader.isPermissionChecked = true;
                loader.isNeedToDownload          = false;
                Debug.Log("start download json files");
                StartCoroutine(loader.LoadJsonAndSort());

                curPannelState = selectPannel.c_waitJsonDown;
            }
        }
    }
Exemple #4
0
    void ChangePannel()
    {
        Debug.Log("cur pannel changed");
        switch (curPannelState)
        {
        case selectPannel.c_00_logo:
            panel_00_logo.SetActive(true);
            break;

        case selectPannel.c_01_authorization:
            CheckPermissionState();
            if (!skipPermission)
            {
                panel_00_logo.SetActive(false);
                panel_01_authorization.SetActive(true);
            }
            else
            {
                if (loader.isNeedToDownload)
                {
                    Debug.Log("++++++++need to download+++++++++");

                    //start from jsonsort
                    //StartCoroutine(loader.LoadJsonAndSort());
                }
                else
                {
                    Debug.Log("+++++++++don't need to download json +++++++");
                    SourceLoader.isPermissionChecked = true;
                }

                //check loading or select
                curPannelState = selectPannel.c_CheckNextState;
            }


            break;

        case selectPannel.c_CheckNextState:
            CheckNextPannel();
            break;

        case selectPannel.c_02_resource:
            panel_00_logo.SetActive(false);
            panel_01_authorization.SetActive(false);
            panel_02_resource.SetActive(true);
            //start download resource
            break;

        case selectPannel.c_03_selectCharacter:
            //load characterselect pannel
            SceneManager.LoadScene("S_01_SelectScene");
            // panel_02_resource.SetActive(false);

            break;

        case selectPannel.c_waitJsonDown:

            break;
        }
    }
Exemple #5
0
 IEnumerator FadeOut(Transform root)
 {
     root.gameObject.SetActive(false);
     curPannelState = selectPannel.c_01_authorization;
     yield return(null);
 }