private void OnMouseDown()
    {
        if (coolDown.isSleeping || coolDown.isAlertView)
        {
            return;
        }

        if (coolDown.isCoolTime)
        {
            message = "물을 먹이겠습니까?";

            AlertViewController.Show(title, message, new AlertViewOptions
            {
                //취소 버튼의 타이틀과 버튼을 눌렀을 때 실행되는 델리게이트를 설정한다.
                cancelButtonTitle    = "아니요",
                cancelButtonDelegate = () =>
                {
                },

                //OK 버튼의 타이틀과 버튼을 눌렀을 때 실행되는 델리게이트를 설정한다.
                okButtonTitle    = "네",
                okButtonDelegate = () =>
                {
                    PlayerFSM.instance.SetDestination(coolDown.coolDownState);
                },
            });
        }
        else
        {
            message = "지금은 배가 부릅니다.";
            AlertViewController.Show(title, message);
        }
    }
    private void OnMouseDown()
    {
        if (coolDown.isSleeping || coolDown.isAlertView)
        {
            return;
        }

        if (coolDown.isCoolTime)
        {
            message = "흙이 말라있습니다. 물을 주시겠습니까?";

            AlertViewController.Show(title, message, new AlertViewOptions
            {
                //취소 버튼의 타이틀과 버튼을 눌렀을 때 실행되는 델리게이트를 설정한다.
                cancelButtonTitle    = "아니요",
                cancelButtonDelegate = () =>
                {
                },

                //OK 버튼의 타이틀과 버튼을 눌렀을 때 실행되는 델리게이트를 설정한다.
                okButtonTitle    = "네",
                okButtonDelegate = () =>
                {
                    CheckGrowCount();
                },
            });
        }
        else
        {
            message = "흙이 아직 축축하다";
            AlertViewController.Show(title, message);
        }
    }
Пример #3
0
    private void onLoadingImage(string success, Result result = null)
    {
        DataManager.instance.OnLoadingImage -= onLoadingImage;
        loadingObj.SetActive(false);

        if (success.Equals("true"))
        {
            SaveLoginSettings();
            OnAutoSetID();

            DataManager.instance.Token = result.Token;
            StartCoroutine(GameSceneManager.instance.ChangeScene(2));
        }
        else if (success.Equals("false"))
        {
            if (result.Code.Equals("3"))
            {
                string message = "비밀번호가 일치하지 않습니다.";
                AlertViewController.Show("", message);
            }
            else if (result.Code.Equals("4"))
            {
                string message = "등록되지 않은 아이디입니다.";
                AlertViewController.Show("", message);
            }
        }
        else
        {
            string message = "네트워크가 불안정합니다. 잠시후 다시 시도해주세요.";
            AlertViewController.Show("", message);
        }
    }
    private void CallAlertView()
    {
        AlertViewController.Show(skill.title, message, new AlertViewOptions
        {
            //취소 버튼의 타이틀과 버튼을 눌렀을 때 실행되는 델리게이트를 설정한다.
            cancelButtonTitle    = "아니요",
            cancelButtonDelegate = () =>
            {
            },

            //OK 버튼의 타이틀과 버튼을 눌렀을 때 실행되는 델리게이트를 설정한다.
            okButtonTitle    = "네",
            okButtonDelegate = () =>
            {
                if (gm.Coin > skill.price)
                {
                    SkillReward(skill.skill_item, skill.price);
                }
                else
                {
                    string title = "알림";
                    message      = "잔액이 부족합니다.";
                    StoreAlertViewController.Show(title, message);
                }
            },
        });
    }
    private void OnMouseDown()
    {
        if (coolDown.isSleeping || coolDown.isAlertView)
        {
            return;
        }

        if (coolDown.isCoolTime)
        {
            message = "포탈을 통해 밖으로 미세먼지와 싸우거나 상점을 갈 수 있습니다. 포탈을 작동 시키겠습니까?";

            AlertViewController.Show(title, message, new AlertViewOptions
            {
                //취소 버튼의 타이틀과 버튼을 눌렀을 때 실행되는 델리게이트를 설정한다.
                cancelButtonTitle    = "취소",
                cancelButtonDelegate = () =>
                {
                },

                //OK 버튼의 타이틀과 버튼을 눌렀을 때 실행되는 델리게이트를 설정한다.
                okButtonTitle    = "출발",
                okButtonDelegate = () =>
                {
                    StartCoroutine(CheckDestination());
                },
            });
        }
        else
        {
            message = "포탈을 열기 위해서는 에너지가 더 필요합니다.";
            AlertViewController.Show(title, message);
        }
    }
Пример #6
0
 partial void DisplayTextInputAlert(Foundation.NSObject sender)
 {
     // User helper class to present alert
     AlertViewController.PresentTextInputAlert("A Short Title is Best", "The message should be a short, complete sentence.", "placeholder", "", this, (ok, text) => {
         Console.WriteLine("Text Input Alert: The user selected {0} and entered `{1}`", ok, text);
     });
 }
Пример #7
0
 partial void DisplayOkCancelAlert(Foundation.NSObject sender)
 {
     // User helper class to present alert
     AlertViewController.PresentOKCancelAlert("A Short Title is Best", "The message should be a short, complete sentence.", this, (ok) => {
         Console.WriteLine("OK/Cancel Alert: The user selected {0}", ok);
     });
 }
Пример #8
0
    IEnumerator CreateNick()
    {
        WWWForm form = new WWWForm();

        form.AddField("NICKNAME", NickName_InputField.text);
        UnityWebRequest webRequest = UnityWebRequest.Post(NickUrl, form);
        {
            webRequest.certificateHandler = new CertPublicKey {
                PUB_KEY = gameManager.pubkey
            };
            yield return(webRequest.SendWebRequest());

            Debug.Log(webRequest.downloadHandler.text);
            CreateNickName = webRequest.downloadHandler.text;

            switch (CreateNickName)
            {
            case "Success":
                StartCoroutine(LoadNick());
                LoadLevel();
                break;

            case "Exist":
                AlertViewController.Show("경고", "중복 닉네임 입니다.", null);
                break;

            case "Fail":
                AlertViewController.Show("경고", "닉네임을 입력하세요.", null);
                break;
            }
        }
    }
Пример #9
0
 /// <summary>
 /// This action is triggered when the Buy button is clicked using the Apple Remote.
 /// </summary>
 /// <param name="sender">Sender.</param>
 partial void BuyButton_PrimaryActionTriggered(UIButton sender)
 {
     AlertViewController.PresentOKCancelAlert("Add Flower to Shopping Cart",
                                              "Would you like to add the currently selected flower to your shopping cart?",
                                              this,
                                              (ok) => {
     });
 }
Пример #10
0
 private void CheckPWInput(InputField input)
 {
     if (input.text.Length != 0 && input.text.Length < 6)
     {
         string errMessage = "비밀번호는 최소 6자 이상입니다.";
         AlertViewController.Show(errTitle, errMessage);
         return;
     }
 }
Пример #11
0
 private void CheckNameInput(InputField input)
 {
     if (input.text.Length != 0 && (input.text.Length > 10 || input.text.Length < 2))
     {
         string errMessage = "올바른 이름을 입력하세요.";
         AlertViewController.Show(errTitle, errMessage);
         return;
     }
 }
Пример #12
0
 private void CheckRePWInput(InputField input)
 {
     if (input.text.Length != 0 && !input.text.Equals(pwInput.text))
     {
         string errMessage = "비밀번호가 일치하지 않습니다.";
         AlertViewController.Show(errTitle, errMessage);
         return;
     }
 }
Пример #13
0
    private void CheckPWInput(InputField input)
    {
        if (input.text.Length != 0 && input.text.Length < 6)
        {
            AlertViewController.Show("", "비밀번호는 최소 6자 이상입니다.");
            return;
        }

        logInInform.Pw = input.text;
    }
Пример #14
0
        public Task <bool> ShowAlert(string title, string message = "", AlertType alertType = AlertType.Error, string ConfirmButtonText = "", string CancelButtonText = null)
        {
            var tcs = new TaskCompletionSource <bool>();

            var alertVC = new AlertViewController(title, message, alertType, ConfirmButtonText, () => tcs.TrySetResult(true));

            alertVC.Show();

            return(tcs.Task);
        }
    private IEnumerator LostToken()
    {
        string message = "계정 정보가 없습니다. 다시 로그인 해주세요.";

        AlertViewController.Show("", message);
        yield return(new WaitForSeconds(1f));

        token = "";
        GameSceneManager.instance.ChangeScene(1);
    }
 /// <summary>
 /// Handles the user clicking the Flight button.
 /// </summary>
 /// <param name="sender">Sender.</param>
 partial void BookFlight(NSObject sender)
 {
     // Ask user to book flight
     AlertViewController.PresentOKCancelAlert("Book Flight",
                                              string.Format("Would you like to book a flight to {0}?", Attraction.City.Name),
                                              this,
                                              (ok) => {
         Attraction.City.FlightBooked = ok;
         IsFlighBooked.Hidden         = (!Attraction.City.FlightBooked);
     });
 }
 /// <summary>
 /// Handles the user clicking the Directions button.
 /// </summary>
 /// <param name="sender">Sender.</param>
 partial void GetDirections(NSObject sender)
 {
     // Ask user to add directions
     AlertViewController.PresentOKCancelAlert("Add Directions",
                                              string.Format("Would you like to add directions to {0} to you itinerary?", Attraction.Name),
                                              this,
                                              (ok) => {
         Attraction.AddDirections = ok;
         IsDirections.Hidden      = (!Attraction.AddDirections);
     });
 }
Пример #18
0
    public static AlertViewController Show(string title, string message, AlertViewOptions options = null)
    {
        if (prefab == null)
        {
            prefab = Resources.Load("Alert View") as GameObject;
        }
        GameObject          obj       = Instantiate(prefab) as GameObject;
        AlertViewController alertView = obj.GetComponent <AlertViewController>();

        alertView.UpdateContent(title, message, options);
        return(alertView);
    }
Пример #19
0
    //로그인 버튼 클릭
    private void LogIn()
    {
        if (idInput.text.Length == 0 || pwInput.text.Length == 0)
        {
            string message = "빈칸을 입력해주세요";
            AlertViewController.Show("", message);
            return;
        }

        loadingObj.SetActive(true);
        DataManager.instance.OnLoadingImage += onLoadingImage;
        DataManager.instance.SendSignIn(idInput.text, pwInput.text);
    }
    private void RequestAgain()
    {
        requestCount++;

        if (requestCount > 15)
        {
            string message = "서버가 불안정합니다. 잠시후 다시 시도하세요.";
            AlertViewController.Show("", message);
            return;
        }

        if (RequestState == RequestState.listClinical)
        {
            SendListClinical();
        }
    }
Пример #21
0
    // CONFIRM 버튼이 눌렸을 때 호출되는 메서드
    public void OnPressConfirmButton()
    {
        string title   = "ARE YOU SURE?";
        string message = messageLabel.text;

        // 알림 뷰를 표시한다
        AlertViewController.Show(title, message, new AlertViewOptions {
            // 취소 버튼의 타이틀과 눌렸을 때 실행되는 델리게이트를 설정
            cancelButtonTitle = "CANCEL", cancelButtonDelegate = () => {
                Debug.Log("Cancelled.");
            },
            // OK 버튼의 타이틀과 눌렸을 때 실행되는 델리게이트를 설정
            okButtonTitle = "BUY", okButtonDelegate = () => {
                Debug.Log("Bought.");
            },
        });
    }
Пример #22
0
    IEnumerator CreateCo()
    {
        WWWForm form = new WWWForm();

        form.AddField("EMAIL", New_IDInputField.text);
        form.AddField("PASSWORD", New_PassInputField.text);
        form.AddField("REPASSWORD", New_RePassInputField.text);
        UnityWebRequest webRequest = UnityWebRequest.Post(CreateUrl, form);
        {
            webRequest.certificateHandler = new CertPublicKey {
                PUB_KEY = gameManager.pubkey
            };
            yield return(webRequest.SendWebRequest());

            if (webRequest.isNetworkError)
            {
                Debug.Log("Error While Sending: " + webRequest.error);
            }
            else
            {
                CreateResult = webRequest.downloadHandler.text;
                Debug.Log("Received: " + CreateResult);
            }
            switch (CreateResult)
            {
            case "empty":
                AlertViewController.Show("경고", "입력하세요.", null);
                break;

            case "Exist ID":
                AlertViewController.Show("경고", "존재하는 ID 입니다.", null);
                break;

            case "pwd":
                AlertViewController.Show("경고", "비밀번호가 일치하지 않습니다.", null);
                break;

            case "Enroll\n":
                LoginPanel.SetActive(true);
                CreateAccountPanel.SetActive(false);
                CreateNickNamePanel.SetActive(false);
                break;
            }
        }
    }
    public void OnClickBuySkill()
    {
        switch (skill.skill_item)
        {
        case Skill_Item.car:
            if (gm.carSkillCount == 0)
            {
                message = "전체 미세먼지의 20%를 감소시켜 줍니다. 구매 하시겠습니까?";
                CallAlertView();
            }
            else
            {
                message = "이미 보유한 스킬입니다";
                AlertViewController.Show(skill.title, message);
            }
            break;

        case Skill_Item.rain:
            if (gm.rainSkillCount == 0)
            {
                message = "전체 미세먼지의 20%를 감소시켜 줍니다. 구매 하시겠습니까?";
                CallAlertView();
            }
            else
            {
                message = "이미 보유한 스킬입니다";
                AlertViewController.Show(skill.title, message);
            }
            break;

        case Skill_Item.tree:
            if (gm.treeSkillCount == 0)
            {
                message = "전체 미세먼지의 20%를 감소시켜 줍니다. 구매 하시겠습니까?";
                CallAlertView();
            }
            else
            {
                message = "이미 보유한 스킬입니다";
                AlertViewController.Show(skill.title, message);
            }
            break;
        }
    }
Пример #24
0
    IEnumerator LoginCo()
    {
        WWWForm form = new WWWForm();

        form.AddField("EMAIL", IDInputField.text);
        form.AddField("PASSWORD", PassInputField.text);

        UnityWebRequest request = UnityWebRequest.Post(LoginUrl, form);
        {
            request.certificateHandler = new CertPublicKey {
                PUB_KEY = gameManager.pubkey
            };
            yield return(request.SendWebRequest());

            if (request.isNetworkError)
            {
                Debug.Log("Error While Sending: " + request.error);
            }
            else
            {
                Debug.Log("Received: " + request.downloadHandler.text);
                LoginResult = request.downloadHandler.text;
            }

            switch (LoginResult)
            {
            case "Login":
                LoginPanel.SetActive(false);
                CreateAccountPanel.SetActive(false);
                CreateNickNamePanel.SetActive(true);
                break;

            case "Exist":
                StartCoroutine(LoadNick());
                LoadLevel();
                break;

            case "diff":
                AlertViewController.Show("경고", "중복 로그인 입니다.", null);
                break;
            }
        }
    }
Пример #25
0
    public void FinishButton()
    {
        AlertViewController.Show("확인", "게임방을 개설합니다.", new AlertViewOptions
        {
            cancelButtonDelegate = () =>
            {
                // 입력된 정보 초기화
                //roomName.text = "";

                Debug.Log("취소");
            },
            okButtonDelegate = () =>
            {
                // 확인 절차 후에 게임방 생성
                Onclick_CreateRoom();
                Debug.Log("확인");
            }
        });
    }
Пример #26
0
    public void OnPressTestButton()
    {
        string title   = "종료";
        string message = "정말 종료하시겠습니까?";

        //알림 뷰를 표시
        AlertViewController.Show(title, message, new AlertViewOptions
        {
            //취소 버튼의 타이틀과 버튼을 눌렀을 때 실행되는 델리게이트를 설정한다.
            cancelButtonTitle = "아니요", cancelButtonDelegate = () =>
            {
                Debug.Log("Cancel");
            },

            //OK 버튼의 타이틀과 버튼을 눌렀을 때 실행되는 델리게이트를 설정한다.
            okButtonTitle = "네", okButtonDelegate = () =>
            {
                Debug.Log("OK");
            },
        });
    }
Пример #27
0
    private void OnPressSend()
    {
        if (idInput.text.Length == 0 || pwInput.text.Length == 0 || rePwInput.text.Length == 0 || nameInput.text.Length == 0 || !jobGroup.AnyTogglesOn())
        {
            string message = "빈칸을 입력해주세요";
            AlertViewController.Show(errTitle, message);
            return;
        }

        IEnumerable <Toggle> activeToggles = jobGroup.ActiveToggles();
        string job = "";

        foreach (Toggle tg in activeToggles)
        {
            job = tg.name;
        }

        loadingObj.SetActive(true);

        DataManager.instance.OnLoadingImage += onLoadingImage;
        DataManager.instance.SendSignUp(idInput.text, pwInput.text, nameInput.text, job);
    }
    IEnumerator CheckDestination()
    {
        yield return(new WaitForSeconds(.1f));

        message = "이동하고자 하는 장소를 입력하세요";
        AlertViewController.Show(title, message, new AlertViewOptions
        {
            //취소 버튼의 타이틀과 버튼을 눌렀을 때 실행되는 델리게이트를 설정한다.
            cancelButtonTitle    = "지구",
            cancelButtonDelegate = () =>
            {
                gameUI[0].SetActive(false);
                gameUI[1].SetActive(false);
                shopObj[0].SetActive(false);
                earthObj[0].SetActive(true);
                earthObj[2].SetActive(true);
                earthObj[4].SetActive(true);
                StartCoroutine(StartARGame());

                anim.enabled = true;
            },

            //OK 버튼의 타이틀과 버튼을 눌렀을 때 실행되는 델리게이트를 설정한다.
            okButtonTitle    = "상점",
            okButtonDelegate = () =>
            {
                gameUI[0].SetActive(false);
                gameUI[1].SetActive(false);
                shopObj[0].SetActive(true);
                shopObj[1].SetActive(true);
                shopObj[2].SetActive(true);
                earthObj[0].SetActive(false);
                earthObj[1].SetActive(false);

                anim.enabled = true;
            },
        });
    }
Пример #29
0
    private void onLoadingImage(string success, Result result = null)
    {
        loadingObj.SetActive(false);

        if (success.Equals("true"))
        {
            string message = "회원가입을 완료했습니다";
            AlertViewController.Show(errTitle, message);
            OnPressClose();
        }
        else if (success.Equals("false"))
        {
            string message = "아이디가 중복됐습니다. 다시 시도하세요.";
            AlertViewController.Show(errTitle, message);
        }
        else
        {
            string message = "네트워크가 불안정합니다. 잠시후 다시 시도해주세요.";
            AlertViewController.Show("", message);
        }

        DataManager.instance.OnLoadingImage -= onLoadingImage;
    }
Пример #30
0
 /// <summary>
 /// This action is triggered when the More Info button is clicked using the Apple Remote.
 /// </summary>
 /// <param name="sender">Sender.</param>
 partial void MoreInfoButton_PrimaryActionTriggered(UIButton sender)
 {
     AlertViewController.PresentOKAlert("More Information", "Sorry but more information on the currently selected flower is not available", this);
 }