Пример #1
0
    public override void ShowDialog(DialogAbs.CallBackShowDialog callback = null)
    {
        bgBlack.gameObject.SetActive(true);
        main.gameObject.SetActive(true);
        if (("Vietnamese").Equals(VariableSystem.language))
        {
            detail = vi_detail;
        }
        else
        {
            detail = en_detail;
        }
        Show = true;
        lbDesciption.text = MissionControl.Language["Description"];
        main.FindChild("BgLeft").FindChild("Logo").FindChild("Label").GetComponent <UILabel>().text = MissionControl.Language["ITEM"];

        LeanTween.scale(main.gameObject, new Vector3(1, 1, 1f), 0.3f).setEase(LeanTweenType.easeOutBack).setOnComplete(() =>
        {
            main.FindChild("Scroll View").gameObject.SetActive(true);
            //gridView.gameObject.SetActive(true);
        });
        IdItem = 1;
        //gridView.GetComponent<UIGrid>().Reposition();
        AddIconItem();
        //gridView.parent.GetComponent<UIScrollView>().

        //Check buy item - Khi nhan thuong o daily gift
        for (int i = 0; i < BoughtItem.Length; i++)
        {
            if (BoughtItem[i])
            {
                gridView.FindChild("" + (i + 1)).GetComponent <ItemShop>().SetBuy();
            }
        }
    }
Пример #2
0
 public override void ShowDialog(DialogAbs.CallBackShowDialog callback = null)
 {
     dialogMain.FindChild("Bg1").FindChild("Texture").FindChild("Title").GetComponent <UILabel>().text = MissionControl.Language["ACHIEVEMENTS"];
     grid.transform.parent.GetComponent <UIPanel>().clipOffset = new Vector2();
     grid.transform.parent.localPosition = new Vector2();
     //Cap nhat du lieu tu xml data cache
     for (int i = 0; i < DataCache.dataAchievementCache.Length; i++)
     {
         int id = DataCache.dataAchievementCache[i].Group - 1;
         //Current value of mission group in xml data
         int currentValue = DataCache.dataAchievementCache[id].Value;
         int currentLevel = DataCache.dataAchievementCache[id].Level;
         //Debug.Log("Update group " + DataCache.dataAchievementCache[i].Group + " level " + DataCache.dataAchievementCache[i].Level
         //    + " current " + DataCache.dataAchievementCache[id].Value);
         grid.GetChild(id).GetComponent <ItemAchievement>().UpdateData(currentLevel, currentValue);
     }
     Show = true;
     bgBlack.gameObject.SetActive(true);
     dialogMain.gameObject.SetActive(true);
     LeanTween.scale(dialogMain.gameObject, new Vector3(1, 1, 1), 0.4f).setEase(LeanTweenType.easeOutBack).setUseEstimatedTime(true).setOnComplete(() =>
     {
         dialogMain.FindChild("Scroll View").FindChild("Grid").gameObject.SetActive(true);
     });
     CountAchievementFinish();
 }
Пример #3
0
 public override void ShowDialog(DialogAbs.CallBackShowDialog callback = null)
 {
     if (CommonObjectScript.isViewPoppup)
     {
         return;
     }
     CommonObjectScript.isViewPoppup = true;
     grid.transform.parent.GetComponent <UIPanel>().clipOffset = new Vector2();
     grid.transform.parent.localPosition = new Vector2();
     scroll.GetComponent <UICenterOnChild>().CenterOn(scroll.FindChild(0 + ""));
     scroll.GetComponent <UICenterOnChild>().Recenter();
     dialogMain.FindChild("Bg1").FindChild("Texture").FindChild("Title").GetComponent <UILabel>().text = MissionControl.Language["HELP"];
     Show = true;
     bgBlack.gameObject.SetActive(true);
     dialogMain.gameObject.SetActive(true);
     LeanTween.scale(dialogMain.gameObject, new Vector3(1, 1, 1), 0.4f).setEase(LeanTweenType.easeOutBack).setUseEstimatedTime(true);
     for (int i = 1; i <= 16; i++)
     {
         if ("Vietnamese".Equals(VariableSystem.language))
         {
             scroll.FindChild(i + "").FindChild("Vi").gameObject.SetActive(true);
             scroll.FindChild(i + "").FindChild("En").gameObject.SetActive(false);
         }
         else
         {
             scroll.FindChild(i + "").FindChild("Vi").gameObject.SetActive(false);
             scroll.FindChild(i + "").FindChild("En").gameObject.SetActive(true);
         }
     }
 }
Пример #4
0
    public override void ShowDialog(DialogAbs.CallBackShowDialog callback = null)
    {
        Show = true;
        CommonObjectScript.isViewComplete = true;
        bgMain.FindChild("Logo").FindChild("Title").GetComponent <UILabel>().text         = MissionControl.Language["COMPLETE"];
        bgMain.FindChild("Cancel").FindChild("LabelCancel").GetComponent <UILabel>().text = MissionControl.Language["Cancel"];
        bgMain.FindChild("Ok").FindChild("LabelOK").GetComponent <UILabel>().text         = MissionControl.Language["Ok"];
        bgMain.FindChild("TextShow").GetComponent <UILabel>().text = MissionControl.Language["Quest_finish_detail"];
        int addGold = (int)(CommonObjectScript.maxTimeOfMission * 200);

        bgMain.FindChild("TextShow1").GetComponent <UILabel>().text = CommonObjectScript.maxTimeOfMission + " " + MissionControl.Language["day_reamain_equal"] + " = ";
        bgMain.FindChild("TextShow2").GetComponent <UILabel>().text = "" + addGold;
        //An bang task khi hien thi result
        CommonObjectScript.isViewPoppup = true;
        GameObject task = GameObject.Find("DialogTask").gameObject;

        if (task != null)
        {
            task.GetComponent <DialogTask>().HideButton();
        }
        bgMain.gameObject.SetActive(true);
        bgBlack.gameObject.SetActive(true);
        LeanTween.scale(bgMain.gameObject, new Vector3(1, 1, 1), 0.4f).setUseEstimatedTime(true).setEase(LeanTweenType.easeOutBack).setOnComplete(() =>
        {
            Time.timeScale = 0;
        });
        //Hide loading scene if it is showing
        LoadingScene.HideLoadingScene();
    }
Пример #5
0
 public override void ShowDialog(DialogAbs.CallBackShowDialog callback = null)
 {
     if (CommonObjectScript.isViewPoppup)
     {
         return;
     }
     CommonObjectScript.isViewPoppup = true;
     dialogMain.FindChild("Panel").FindChild("Logo").FindChild("Title").GetComponent <UILabel>().text = MissionControl.Language["INFO"];
     if ("Vietnamese".Equals(VariableSystem.language))
     {
         dialogMain.FindChild("En").gameObject.SetActive(false);
         dialogMain.FindChild("Vi").gameObject.SetActive(true);
     }
     else
     {
         dialogMain.FindChild("En").gameObject.SetActive(true);
         dialogMain.FindChild("Vi").gameObject.SetActive(false);
     }
     Show = true;
     bgBlack.gameObject.SetActive(true);
     dialogMain.gameObject.SetActive(true);
     left.parent.gameObject.SetActive(true);
     LeanTween.scale(dialogMain.gameObject, new Vector3(1, 1, 1), 0.4f).setEase(LeanTweenType.easeOutBack);
     LeanTween.moveLocalY(left.gameObject, -130, 0.4f).setEase(LeanTweenType.easeOutBack);
     LeanTween.moveLocalY(right.gameObject, -130, 0.4f).setEase(LeanTweenType.easeOutBack);
     dialogMain.FindChild("En").FindChild("Texture").GetComponent <TweenPosition>().ResetToBeginning();
     dialogMain.FindChild("Vi").FindChild("Texture").GetComponent <TweenPosition>().ResetToBeginning();
 }
Пример #6
0
 public override void ShowDialog(DialogAbs.CallBackShowDialog callback = null)
 {
     dialogMain.FindChild("Bg1").FindChild("Texture").FindChild("Title").GetComponent <UILabel>().text = MissionControl.Language["REFILL"];
     Show = true;
     bgBlack.gameObject.SetActive(true);
     dialogMain.gameObject.SetActive(true);
     dialogMain.FindChild("AskFriend").FindChild("Label").GetComponent <UILabel>().text = MissionControl.Language["Ask_friends"];
     dialogMain.FindChild("Refill").FindChild("Label").GetComponent <UILabel>().text    = MissionControl.Language["Refill"];
     LeanTween.scale(dialogMain.gameObject, new Vector3(1, 1, 1), 0.4f).setUseEstimatedTime(true).setEase(LeanTweenType.easeOutBack);
 }
Пример #7
0
    public override void ShowDialog(DialogAbs.CallBackShowDialog callback = null)
    {
        if (!Show)
        {
            bgMain  = transform.FindChild("Main");
            bgBlack = transform.FindChild("Black");
            transform.FindChild("Main").FindChild("Bg1").GetComponent <UITexture>().mainTexture = Resources.Load <Texture>("Mission/SpecialGiftWeeken/event-" + (VariableSystem.language.Equals("Vietnamese") ? "vie" : "eng"));

            Show = true;
            bgMain.gameObject.SetActive(true);
            bgBlack.gameObject.SetActive(true);

            if (timer.CompareTo(timer82) < 0)
            {
                txt_Diamond.text = "50";
            }
            else
            {
                txt_Diamond.text = "10";
            }

            if (!isAvailable)
            {
                text.transform.parent.gameObject.SetActive(false);
            }
            if (VariableSystem.language.Equals("Vietnamese"))
            {
                text.text = "Nhận";
                if (timer.CompareTo(timer82) < 0)
                {
                    info.text = "*Thời gian sự kiện: Hết 8/2/2015  *Mỗi tài khoản chỉ nhận quà một lần";
                }
                else
                {
                    info.text = "";
                }
                txt_Diamond.transform.localPosition = new Vector3(30, 80);
            }
            else
            {
                text.text = "Get";
                if (timer.CompareTo(timer82) < 0)
                {
                    info.text = "*Event duration: Until Feb.8  *Each user can only get  one reward";
                }
                else
                {
                    info.text = "";
                }
                txt_Diamond.transform.localPosition = new Vector3(0, 80);
            }

            LeanTween.scale(bgMain.gameObject, new Vector3(1, 1, 1), 0.4f).setUseEstimatedTime(true).setEase(LeanTweenType.easeOutBack).setUseEstimatedTime(true);;
        }
    }
Пример #8
0
 public override void ShowDialog(DialogAbs.CallBackShowDialog callback = null)
 {
     CommonObjectScript.isViewPoppup = true;
     Show = true;
     gameObject.SetActive(true);
     LeanTween.scale(gameObject, new Vector3(1, 1, 1f), 0.3f).setUseEstimatedTime(true).setEase(LeanTweenType.easeOutBack);
     transform.FindChild("Content").GetComponent <UILabel>().text = MissionControl.Language["Login_content"];
     transform.FindChild("Logo").FindChild("name").GetComponent <UILabel>().text     = MissionControl.Language["CONNECT"];
     transform.FindChild("Login").FindChild("Label").GetComponent <UILabel>().text   = MissionControl.Language["LOGIN"];
     transform.FindChild("Nothank").FindChild("Label").GetComponent <UILabel>().text = MissionControl.Language["NO_THANK"];
 }
Пример #9
0
    public override void ShowDialog(DialogAbs.CallBackShowDialog callback = null)
    {
        main.FindChild("BackGround").FindChild("Logo").FindChild("name").GetComponent <UILabel>().text = MissionControl.Language["RATE"];
        main.FindChild("Content").GetComponent <UILabel>().text = MissionControl.Language["Rate_Content"];
        main.FindChild("Rate").FindChild("Label").GetComponent <UILabel>().text    = MissionControl.Language["RATE_IT"];
        main.FindChild("Nothank").FindChild("Label").GetComponent <UILabel>().text = MissionControl.Language["NO_THANK"];

        CommonObjectScript.isViewPoppup = true;
        if (!Show)
        {
            Show = true;
            main.gameObject.SetActive(true);
            black.gameObject.SetActive(true);
            LeanTween.scale(main.gameObject, Vector3.one, 0.5f).setEase(LeanTweenType.easeOutBack);
        }
    }
Пример #10
0
    public override void ShowDialog(DialogAbs.CallBackShowDialog callback = null)
    {
        transform.FindChild("Logo").FindChild("name").GetComponent <UILabel>().text = MissionControl.Language["POWER_UP"];
        Show = true;
        LeanTween.scale(gameObject, new Vector3(1, 1, 1f), 0.2f).setEase(LeanTweenType.easeOutBack).setDelay(0.3f).setOnComplete(() =>
        {
            if (callback != null)
            {
                callback();
            }
        });

        for (int i = 1; i <= 6; i++)
        {
            transform.FindChild("Table").FindChild("Item" + i).GetComponent <ItemPowerUp>().CheckItemBuy();
        }
    }
Пример #11
0
 public override void ShowDialog(DialogAbs.CallBackShowDialog callback = null)
 {
     if (!Show)
     {
         Show    = true;
         bgMain  = transform.FindChild("Main");
         bgBlack = transform.FindChild("Black");
         bgMain.gameObject.SetActive(true);
         bgBlack.gameObject.SetActive(true);
         bgMain.FindChild("Logo").FindChild("Title").GetComponent <UILabel>().text = MissionControl.Language["DAILY_GIFT"];
         for (int i = 1; i <= grid.GetChildList().Count; i++)
         {
             grid.GetChild(i - 1).FindChild("Day").GetComponent <UILabel>().text = MissionControl.Language["Day"] + " " + i;
             grid.GetChild(i - 1).FindChild("ButtonGet").FindChild("Label").GetComponent <UILabel>().text = MissionControl.Language["Get"];
         }
         LeanTween.scale(bgMain.gameObject, new Vector3(1, 1, 1), 0.4f).setUseEstimatedTime(true).setEase(LeanTweenType.easeOutBack).setUseEstimatedTime(true);;
     }
 }
Пример #12
0
 public override void ShowDialog(DialogAbs.CallBackShowDialog callback = null)
 {
     star1.gameObject.SetActive(false);
     star2.gameObject.SetActive(false);
     star3.gameObject.SetActive(false);
     //Debug.Log("VariableSystem.mission " + VariableSystem.mission +" Star "+ DataMissionControlNew.missionData[VariableSystem.mission].Star);
     if (DataCache.dataMissionCache[VariableSystem.mission - 1].Star > 0)
     {
         star1.gameObject.SetActive(true);
     }
     if (DataCache.dataMissionCache[VariableSystem.mission - 1].Star > 1)
     {
         star2.gameObject.SetActive(true);
     }
     if (DataCache.dataMissionCache[VariableSystem.mission - 1].Star > 2)
     {
         star3.gameObject.SetActive(true);
     }
     LeanTween.scale(gameObject, new Vector3(1, 1, 1f), 0.3f).setUseEstimatedTime(true).setEase(LeanTweenType.easeOutBack);
     transform.FindChild("Score").FindChild("Label").GetComponent <UILabel>().text = "" + DataCache.dataMissionCache[VariableSystem.mission - 1].Score;
     transform.FindChild("LbStar1").GetComponent <UILabel>().text = MissionControl.Language["All_target"];
 }
Пример #13
0
    public override void ShowDialog(DialogAbs.CallBackShowDialog callback = null)
    {
        CommonObjectScript.isViewPoppup = true;
        if (!Show)
        {
            Show = true;
            main.gameObject.SetActive(true);
            black.gameObject.SetActive(true);
            main.FindChild("Title").GetComponent <UILabel>().text    = MissionControl.Language["RESOURCE"];
            main.FindChild("package1").GetComponent <UILabel>().text = MissionControl.Language["package1"];
            main.FindChild("package2").GetComponent <UILabel>().text = MissionControl.Language["package2"];
            main.FindChild("package3").GetComponent <UILabel>().text = MissionControl.Language["package3"];
            main.FindChild("package4").GetComponent <UILabel>().text = MissionControl.Language["package4"];
            main.FindChild("package5").GetComponent <UILabel>().text = MissionControl.Language["package5"];
            main.FindChild("package6").GetComponent <UILabel>().text = MissionControl.Language["package6"];

            LeanTween.scale(main.gameObject, Vector3.one, 0.3f).setUseEstimatedTime(true).setEase(LeanTweenType.easeOutBack).setOnComplete(() =>
            {
                //cuongvm
                Time.timeScale = 0;
            });
        }
    }
Пример #14
0
 public override void ShowDialog(DialogAbs.CallBackShowDialog callback = null)
 {
     Show = true;
     transform.FindChild("BackGround").gameObject.SetActive(true);
 }
Пример #15
0
    //void OnGUI()
    //{
    //    //GUI.backgroundColor = Color.black;
    //    GUI.Label(new Rect(10, 100, 200, 200), fb_result);
    //}

    public override void ShowDialog(DialogAbs.CallBackShowDialog callback = null)
    {
        if (isInbox)
        {
            lbInbox.text = MissionControl.Language["No_message"];
        }
        else
        {
            lbInbox.text = MissionControl.Language["No_request"];
        }
        Show = true;
        transform.FindChild("Request").GetComponent <UILabel>().text = MissionControl.Language["Request"];
        transform.FindChild("Receive").GetComponent <UILabel>().text = MissionControl.Language["Receive"];
        transform.FindChild("Logo").FindChild("name").GetComponent <UILabel>().text       = MissionControl.Language["Your_Message"];
        transform.FindChild("AcceptAll").FindChild("Label").GetComponent <UILabel>().text = MissionControl.Language["Accept_all"];

        FB.API("v2.2/me/apprequests?fields=id,from,message,data&limit=30", Facebook.HttpMethod.GET, result =>
        {
            try
            {
                if (!String.IsNullOrEmpty(result.Error))
                {
                    Debug.LogError(result.Error);
                    dialogLoading.gameObject.SetActive(false);
                    transform.parent.parent.GetComponent <MissionControl>().ShowConfirm();
                }
                else
                {
                    if (dialogLoading.gameObject.activeInHierarchy)
                    {
                        RemoveAllItem();
                        Debug.Log(JsonHelper.FormatJson(result.Text));
                        var dict = Json.Deserialize(result.Text) as IDictionary;
                        var data = dict["data"] as List <object>;
                        Debug.Log("AAAAAAAAAAAAAAAAAAAAAAAA " + data.Count);
                        for (int i = 0; i < data.Count; i++)
                        {
                            Dictionary <string, object> info = data[i] as Dictionary <string, object>;
                            string datasend = info["data"] as string;
                            //Loc tab receive va tab request
                            if (datasend == DString.DATA_ASK_LIFE)
                            {
                                //Cap nhat danh sach ban be len list view
                                AddItemRequest(info);
                            }
                            else if (datasend == DString.DATA_SEND_LIFE)
                            {
                                //Cap nhat danh sach ban be len list view
                                AddItemReceive(info);
                            }
                            else
                            {
                                Debug.Log("ko cho vao listview " + info);
                            }
                            Debug.Log("ITEM " + i);
                        }
                        LeanTween.scale(gameObject, new Vector3(1, 1, 1f), 0.3f).setUseEstimatedTime(true).setEase(LeanTweenType.easeOutBack);
                        gridViewReceive.parent.GetComponent <UIPanel>().clipOffset = new Vector2();
                        gridViewReceive.parent.localPosition = new Vector2();
                        gridViewRequest.parent.GetComponent <UIPanel>().clipOffset = new Vector2();
                        gridViewRequest.parent.localPosition = new Vector2();
                        ShowNoMessage();
                    }
                }
            }
            catch (Exception e)
            {
                transform.parent.parent.GetComponent <MissionControl>().ShowConfirm();
                Debug.Log("--------------------catch error StartCoroutine-------------------" + e.Message);
            }
        });
    }
Пример #16
0
 public override void ShowDialog(DialogAbs.CallBackShowDialog callback = null)
 {
     throw new System.NotImplementedException();
 }
Пример #17
0
    public override void ShowDialog(DialogAbs.CallBackShowDialog callback = null)
    {
        main.FindChild("Button1").FindChild("Get").FindChild("Label").GetComponent <UILabel>().text = MissionControl.Language["Get"];
        if (PlayerPrefs.HasKey("EventFriend1"))
        {
            main.FindChild("Button1").gameObject.SetActive(true);
        }
        else
        {
            main.FindChild("Button1").gameObject.SetActive(false);
        }
        if (PlayerPrefs.HasKey("EventFriend2"))
        {
            main.FindChild("Button2").gameObject.SetActive(true);
        }
        else
        {
            main.FindChild("Button2").gameObject.SetActive(false);
        }
        if (PlayerPrefs.HasKey("EventFriend3"))
        {
            main.FindChild("Button3").gameObject.SetActive(true);
        }
        else
        {
            main.FindChild("Button3").gameObject.SetActive(false);
        }
        if (PlayerPrefs.HasKey("EventFriend4"))
        {
            main.FindChild("Button4").gameObject.SetActive(true);
        }
        else
        {
            main.FindChild("Button4").gameObject.SetActive(false);
        }
        if (PlayerPrefs.HasKey("EventFriend5"))
        {
            main.FindChild("Button5").gameObject.SetActive(true);
        }
        else
        {
            main.FindChild("Button5").gameObject.SetActive(false);
        }
        /////////////////////////////////////////////////////////////////////////////
        if (PlayerPrefs.GetInt("EventFriend1", 0) == 1)
        {
            main.FindChild("Button1").FindChild("Complete").gameObject.SetActive(true);
            main.FindChild("Button1").FindChild("Get").gameObject.SetActive(false);
        }
        if (PlayerPrefs.GetInt("EventFriend2", 0) == 1)
        {
            main.FindChild("Button2").FindChild("Complete").gameObject.SetActive(true);
            main.FindChild("Button2").FindChild("Get").gameObject.SetActive(false);
        }
        if (PlayerPrefs.GetInt("EventFriend3", 0) == 1)
        {
            main.FindChild("Button3").FindChild("Complete").gameObject.SetActive(true);
            main.FindChild("Button3").FindChild("Get").gameObject.SetActive(false);
        }
        if (PlayerPrefs.GetInt("EventFriend4", 0) == 1)
        {
            main.FindChild("Button4").FindChild("Complete").gameObject.SetActive(true);
            main.FindChild("Button4").FindChild("Get").gameObject.SetActive(false);
        }
        if (PlayerPrefs.GetInt("EventFriend5", 0) == 1)
        {
            main.FindChild("Button5").FindChild("Complete").gameObject.SetActive(true);
            main.FindChild("Button5").FindChild("Get").gameObject.SetActive(false);
        }

        if ("Vietnamese".Equals(VariableSystem.language))
        {
            main.FindChild("Vi").gameObject.SetActive(true);
            main.FindChild("En").gameObject.SetActive(false);
        }
        else
        {
            main.FindChild("Vi").gameObject.SetActive(false);
            main.FindChild("En").gameObject.SetActive(true);
        }
        CommonObjectScript.isViewPoppup = true;
        if (!Show)
        {
            Show = true;
            main.gameObject.SetActive(true);
            black.gameObject.SetActive(true);
            LeanTween.scale(main.gameObject, Vector3.one, 0.3f).setEase(LeanTweenType.easeOutBack);
        }
    }