Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        Instance = this;
        DialogDataAlert alert = new DialogDataAlert("START", "Game Start!", delegate() {
            Debug.Log ("OK Pressed");
        });

        DialogManager.Instance.Push(alert);
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        Instance = this;
        DialogDataAlert alert = new DialogDataAlert("START", "Game Start!", delegate() {
            Debug.Log("OK Pressed");
        });

        DialogManager.Instance.Push(alert);
    }
Exemplo n.º 3
0
    // 추후 if문을 없애고 보다 효율적으로 개선해야함.
    private void UpgradeDelegate(WWW www)
    {
        if (www.text == "")
        {
            Debug.Log("서버에서 업그레이드 정보를 전달하는 중 문제가 발생했습니다.");
            return;
        }

        int             nResultCode = 0;
        JSONObject      jsonResult  = null;
        DialogDataAlert dialogAlert = null;

        jsonResult  = JSONObject.Parse(www.text);
        nResultCode = (int)jsonResult["ResultCode"].Number;

        if (nResultCode == 1) // Success_Code
        {
            UserSingleton.GetInstance().Refresh
            (
                delegate()
            {
                NotificationCenter.GetInstance().Notify(NotificationCenter.E_SUBJECT.E_PLAYER_DATA);
            }
            );

            dialogAlert = new DialogDataAlert
                          (
                Language.GetInstance().GetLanguage("Upgrade Success"),
                Language.GetInstance().GetLanguage("Success"),
                delegate() { }
                          );
        }
        else if (nResultCode == 4) // Player_is_MaxLevel
        {
            dialogAlert = new DialogDataAlert
                          (
                Language.GetInstance().GetLanguage("Upgrade Failed"),
                Language.GetInstance().GetLanguage("Max Level"),
                delegate() { }
                          );
        }
        else if (nResultCode == 5) // Not_Enough_Diamond
        {
            dialogAlert = new DialogDataAlert
                          (
                Language.GetInstance().GetLanguage("Upgrade Failed"),
                Language.GetInstance().GetLanguage("Not Enough Diamond"),
                delegate() { }
                          );
        }

        m_objAlertDialog.SetActive(true);

        DialogManager.GetInstance().Push(dialogAlert);
    }
Exemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     // Instance 변수에 현재 클래스의 인스턴스를 설정합니다.
     Instance = this;
     // 다이얼로그 데이터를 하나 생성합니다. 제목하고 내용, 그리고 콜백함수를 매개변수로 전달합니다.
     DialogDataAlert alert = new DialogDataAlert("START", "Game Start!", delegate() {
         Debug.Log ("OK Pressed");
     });
     // 생성한 Alert 다이얼로그 데이터를 DialogManager에 추가합니다.
     DialogManager.Instance.Push(alert);
 }
Exemplo n.º 5
0
    IEnumerator ShowAlert()
    {
        yield return(new WaitForEndOfFrame());

        DialogDataAlert alert = new DialogDataAlert("START", "Game Start!", delegate()
        {
            Debug.Log("OK Pressed");
        });

        DialogManager.Instance.Push(alert);
    }
Exemplo n.º 6
0
 void CheckStatus()
 {
     if(status != 1)
     {
         DialogDataAlert alert = new DialogDataAlert(notice_title, notice, delegate() {
             Application.Quit();
         });
         DialogManager.Instance.Push(alert);
     }else{
         SelectServer();
     }
 }
Exemplo n.º 7
0
    // Use this for initialization
    void Start()
    {
        // Instance 변수에 현재 클래스의 인스턴스를 설정합니다.
        Instance = this;
        // 다이얼로그 데이터를 하나 생성합니다. 제목하고 내용, 그리고 콜백함수를 매개변수로 전달합니다.
        DialogDataAlert alert = new DialogDataAlert("START", "Game Start!", delegate() {
            Debug.Log("OK Pressed");
        });

        // 생성한 Alert 다이얼로그 데이터를 DialogManager에 추가합니다.
        DialogManager.Instance.Push(alert);
    }
    public override void Build(DialogData data)
    {
        base.Build(data);

        if( ! (data is DialogDataAlert) ) {
            Debug.LogError("Invalid dialog data!");
            return;
        }

        Data = data as DialogDataAlert;
        LabelTitle.text = Data.Title;
        LabelMessage.text = Data.Message;
    }
    // 확인 팝업창이 생성될 때 호출되는 함수입니다.
    public override void Build(DialogData data)
    {
        base.Build(data);
        // 데이터가 없는데 Build를 하면 로그를 남기고 예외처리를 합니다.
        if( ! (data is DialogDataAlert) ) {
            Debug.LogError("Invalid dialog data!");
            return;
        }

        // DialogDataAlert로 데이터를 받고 화면의 제목과 메시지의 내용을 입력합니다.
        Data = data as DialogDataAlert;
        LabelTitle.text = Data.Title;
        LabelMessage.text = Data.Message;
    }
Exemplo n.º 10
0
    public override void Build(DialogData data)
    {
        base.Build(data);

        if (!(data is DialogDataAlert))
        {
            Debug.LogError("Invalid dialog data!");
            return;
        }

        Data              = data as DialogDataAlert;
        LabelText.text    = Data.Title;
        LabelMessage.text = Data.Message;
    }
Exemplo n.º 11
0
    // 확인 팝업창이 생성될 때 호출되는 함수입니다.
    public override void Build(DialogData data)
    {
        base.Build(data);
        // 데이터가 없는데 Build를 하면 로그를 남기고 예외처리를 합니다.
        if (!(data is DialogDataAlert))
        {
            Debug.LogError("Invalid dialog data!");
            return;
        }

        // DialogDataAlert로 데이터를 받고 화면의 제목과 메시지의 내용을 입력합니다.
        Data              = data as DialogDataAlert;
        LabelTitle.text   = Data.Title;
        LabelMessage.text = Data.Message;
    }
Exemplo n.º 12
0
    public override void Build(DialogData dialogData)
    {
        base.Build(dialogData);

        if (!(dialogData is DialogDataAlert))
        {
            Debug.Log("Invaild dialog data!");
            return;
        }

        m_dialogData = dialogData as DialogDataAlert;

        m_textLabelTitle.text   = m_dialogData.m_strTitle;
        m_textLabelMessage.text = m_dialogData.m_strMessage;
    }
Exemplo n.º 13
0
    public void Upgrade(string UpgradeType)
    {
        JSONObject obj = new JSONObject();
        obj.Add("UserID", UserSingleton.Instance.UserID);
        obj.Add("UpgradeType", UpgradeType);
        HTTPClient.Instance.POST(Singleton.Instance.HOST + "/Upgrade",obj.ToString(),delegate(WWW www) {
            Debug.Log (www.text);
            JSONObject res = JSONObject.Parse(www.text);
            int ResultCode = (int)res["ResultCode"].Number;
            if(ResultCode == 1){ // Success!
                // Upgrade Success => Load User data again
                UserSingleton.Instance.Refresh(delegate() {
                    NotificationCenter.Instance.Notify(NotificationCenter.Subject.PlayerData);
                });
                // Alert Dialog
                DialogDataAlert alert = new DialogDataAlert(Language.Instance.GetLanguage("Upgrade Success Title"),
                                                            Language.Instance.GetLanguage("Upgrade Success"),delegate() {

                } );
                DialogManager.Instance.Push(alert);

            }else if (ResultCode == 4) // Max Level
            {
                // Alert Dialog
                DialogDataAlert alert = new DialogDataAlert(Language.Instance.GetLanguage("Upgrade Failed Title"),
                                                            Language.Instance.GetLanguage("Max Level"), delegate() {

                });
                DialogManager.Instance.Push(alert);

            }else if(ResultCode == 5) // Not enough diamond
            {
                // Alert Dialog
                DialogDataAlert alert = new DialogDataAlert(Language.Instance.GetLanguage("Upgrade Failed Title"),
                                                            Language.Instance.GetLanguage("Not Enouhg Diamond"), delegate() {

                });
                DialogManager.Instance.Push(alert);

            }
        });
    }
Exemplo n.º 14
0
    public void Upgrade(string UpgradeType)
    {
        JSONObject obj = new JSONObject();

        obj.Add("UserID", UserSingleton.Instance.UserID);
        obj.Add("UpgradeType", UpgradeType);
        Debug.Log("URL : " + Singleton.Instance.HOST + "/Upgrade/Execute");
        Debug.Log("DATA : " + obj.ToString());
        HTTPClient.Instance.POST(Singleton.Instance.HOST + "/Upgrade/Execute", obj.ToString(), delegate(WWW www) {
            Debug.Log(www.text);
            JSONObject res = JSONObject.Parse(www.text);
            int ResultCode = (int)res["ResultCode"].Number;
            if (ResultCode == 1)             // Success!
            // Upgrade Success => Load User data again
            {
                UserSingleton.Instance.Refresh(delegate() {
                    NotificationCenter.Instance.Notify(NotificationCenter.Subject.PlayerData);
                });
                // Alert Dialog
                DialogDataAlert alert = new DialogDataAlert(Language.Instance.GetLanguage("Upgrade Success Title"),
                                                            Language.Instance.GetLanguage("Upgrade Success"), delegate() {
                });
                DialogManager.Instance.Push(alert);
            }
            else if (ResultCode == 4)              // Max Level
            {
                // Alert Dialog
                DialogDataAlert alert = new DialogDataAlert(Language.Instance.GetLanguage("Upgrade Failed Title"),
                                                            Language.Instance.GetLanguage("Max Level"), delegate() {
                });
                DialogManager.Instance.Push(alert);
            }
            else if (ResultCode == 5)             // Not enough diamond
            {
                // Alert Dialog
                DialogDataAlert alert = new DialogDataAlert(Language.Instance.GetLanguage("Upgrade Failed Title"),
                                                            Language.Instance.GetLanguage("Not Enough Diamond"), delegate() {
                });
                DialogManager.Instance.Push(alert);
            }
        });
    }
Exemplo n.º 15
0
    // Use this for initialization
    IEnumerator Start()
    {
        yield return(new WaitForSeconds(1f));

        DialogDataAlert alert = new DialogDataAlert("Welcome", "Lets start!", delegate() {
            Debug.Log("OK Pressed!");

            DialogDataConfirm confirm = new DialogDataConfirm("Buy Gold?", "Do you want buy 100,000 golds?",
                                                              delegate(bool yn) {
                if (yn)
                {
                    Debug.Log("Confirm OK");
                }
                else
                {
                    Debug.Log("Confirm Cancel");
                }
            });

            DialogManager.Instance.Push(confirm);
        });

        DialogManager.Instance.Push(alert);
    }
Exemplo n.º 16
0
    private void Start()
    {
        DialogDataAlert alert = new DialogDataAlert("START", "GAME START!", delegate { Debug.Log("OK_Pressed!"); });

        DialogManager.GetInstance().Push(alert);
    }
Exemplo n.º 17
0
    void CheckVersion()
    {
        bool need_update = false;

        #if UNITY_ANDROID

        if(server_aos_ver > Singleton.Instance.aos_version) // New Version Updated
        {
            need_update = true;
        }

        #elif UNITY_IOS

        if(server_ios_ver > Singleton.Instance.ios_version) // New Version Updated
        {
            need_update = true;
        }

        #endif

        if(need_update)
        {

            DialogDataAlert alert = new DialogDataAlert("need update", "need update", delegate() {

        #if UNITY_ANDROID
                Application.OpenURL(Singleton.Instance.AOSMarketURL);
        #elif UNITY_IOS
                Application.OpenURL(Singleton.Instance.IOSMarketURL);
        #endif

            });
            DialogManager.Instance.Push(alert);

        }else{

            CheckStatus();

        }
    }