static public void Show(eMallCategory inCategory, float inOffsetX = 0.0f) { if (mInstance) { mInstance.gameObject.SetActive(true); mInstance.DoShow(inCategory, inOffsetX); } }
void DoShow(eMallCategory inCategory, float inOffsetX = 0.0f) { if (inOffsetX != 0.0f) Gui.Transition(Anim, inOffsetX); Pivot.position = mPivotStartPos; Vector3 thePos = Pivot.position; mCategory = inCategory; switch(mCategory) { default: case eMallCategory.ArtsAndEntertainment: mButtons = ArtsAndEntertainment; break; case eMallCategory.FoodDrinkAndDining: mButtons = FoodDrinkAndDining; break; case eMallCategory.PlacesToStay: mButtons = PlacesToStay; break; case eMallCategory.TravelToursAndTransportation: mButtons = TravelToursAndTransportation; break; case eMallCategory.HealthFitnessAndBeauty: mButtons = HealthFitnessAndBeauty; break; case eMallCategory.Medical: mButtons = Medical; break; case eMallCategory.FinancialAndLegalServices: mButtons = FinancialAndLegalServices; break; case eMallCategory.HomeHookupAndServices: mButtons = HomeHookupAndServices; break; case eMallCategory.Housing: mButtons = Housing; break; case eMallCategory.AptHomeFurnishings: mButtons = AptHomeFurnishings; break; case eMallCategory.ClothingAndAccessories: mButtons = ClothingAndAccessories; break; case eMallCategory.MovingAndStorage: mButtons = MovingAndStorage; break; case eMallCategory.MaterialsAndSupplies: mButtons = MaterialsAndSupplies; break; case eMallCategory.CommunityConnections: mButtons = CommunityConnections; break; case eMallCategory.SnailMail: mButtons = SnailMail; break; case eMallCategory.VehicleSalesAndService: mButtons = VehicleSalesAndService; break; case eMallCategory.StuffYouJustGottaHave: mButtons = StuffYouJustGottaHave; break; case eMallCategory.SportingGoodsAndFacilities: mButtons = SportingGoodsAndFacilities; break; case eMallCategory.StoresAndPlacesToShop: mButtons = StoresAndPlacesToShop; break; case eMallCategory.InCaseOfEmergency: mButtons = InCaseOfEmergency; break; } for (int i = 0; i < mButtons.Length; i++) { GameObject theButton = (GameObject)GameObject.Instantiate(Resources.Load("Prefabs/FormMallCategories/Button"), thePos, Quaternion.identity); theButton.GetComponent<MallScrollButton>().Setup(mButtons[i]); theButton.transform.parent = Pivot; mButtonGOs.Add(theButton); thePos.y -= BUTTON_SPACING; } }