Exemple #1
0
 public void Hide()
 {
     BETween.anchoredPosition(rtDialog.gameObject, 0.3f, new Vector3(0, -500)).method = BETweenMethod.easeOut;
     BETween.alpha(gameObject, 0.3f, 0.5f, 0.0f).method = BETweenMethod.easeOut;
     BETween.enable(gameObject, 0.01f, false).delay     = 0.4f;
     //gameObject.SetActive(false);
     SceneTown.isModalShow = false;
 }
Exemple #2
0
        void _Show(ShopType type)
        {
            // if shop dialog called while new building is in creation,
            // delete new building
            if (SceneTown.buildingSelected != null)
            {
                if (!SceneTown.buildingSelected.OnceLanded)
                {
                    SceneTown.instance.BuildingDelete();
                }
            }

            gameObject.transform.localPosition = Vector3.zero;
            gameObject.SetActive(true);
            gameObject.GetComponent <Image>().color = new Color32(0, 0, 0, 0);
            SceneTown.isModalShow = true;
            eType = type;

            // delete old items of each content
            for (int i = 0; i < contents.Length; ++i)
            {
                for (int j = contents[i].transform.childCount - 1; j >= 0; j--)
                {
                    Destroy(contents[i].transform.GetChild(j).gameObject);
                }
            }

            // create shop items of each contents
            if (eType == ShopType.Normal)
            {
                List <BuildingType> bt = new List <BuildingType>();

                // fill first tab
                bt.Clear();
                bt.Add(TBDatabase.GetBuildingType(3));
                bt.Add(TBDatabase.GetBuildingType(4));
                bt.Add(TBDatabase.GetBuildingType(5));
                bt.Add(TBDatabase.GetBuildingType(6));
                FillContents(0, "Economy", bt);

                // fill second tab
                bt.Clear();
                bt.Add(TBDatabase.GetBuildingType(2));
                bt.Add(TBDatabase.GetBuildingType(7));
                bt.Add(TBDatabase.GetBuildingType(8));
                //bt.Add (TBDatabase.GetBuildingType(9));
                //bt.Add (TBDatabase.GetBuildingType(10));
                FillContents(1, "Defense", bt);

                // fill third tab
                bt.Clear();
                bt.Add(TBDatabase.GetBuildingbyName(name: "Hut"));
                bt.Add(TBDatabase.GetBuildingbyName(name: "wangtianshu"));
                bt.Add(TBDatabase.GetBuildingbyName(name: "apartment_mess"));
                bt.Add(TBDatabase.GetBuildingbyName(name: "apartment_huge"));
                FillContents(2, "Support", bt);

                BETween.anchoredPosition(rtDialog.gameObject, 0.3f, new Vector3(0, -500), new Vector3(0, 0)).method = BETweenMethod.easeOut;
            }
            else if (eType == ShopType.InApp)
            {
                FillInApp(0, "InApp");

                // if shop has only one tab, then change position to hide tab
                BETween.anchoredPosition(rtDialog.gameObject, 0.3f, new Vector3(0, -500), new Vector3(0, -50)).method = BETweenMethod.easeOut;
            }
            else if (eType == ShopType.House)
            {
                List <BuildingType> bt = new List <BuildingType>();

                // add house building
                bt.Clear();
                bt.Add(TBDatabase.GetBuildingType(1));
                FillContents(0, "House", bt);

                // if shop has only one tab, then change position to hide tab
                BETween.anchoredPosition(rtDialog.gameObject, 0.3f, new Vector3(0, -500), new Vector3(0, -50)).method = BETweenMethod.easeOut;
            }
            else
            {
            }

            toggleButtons[0].isOn = true;
            CategorySelected(0);
            rtDialog.anchoredPosition = new Vector3(0, -500);
            BETween.alpha(gameObject, 0.3f, 0, 0.5f).method = BETweenMethod.easeOut;
        }