Exemplo n.º 1
0
        // methods to go to any game screens
        public void GotoGames(UISnapScrolling _snapScrolling)
        {
            // get album id

            // get user id

            int gameID = sm_instance.gameContent.SelectedPanID; // get game ID

            _gc.m_GameManager.currentGameID = gameID;
            SwitchScreen(sm_instance.m_GameScreens[gameID], true);
        }
Exemplo n.º 2
0
        // album button behavior
        public void GoToAlbum(UISnapScrolling _snapScrolling)
        {
            int albumID = _snapScrolling.SelectedPanID; // get album ID
            // grab next screen and populate
            AlbumData currentAlbum = _gc.m_SaveManager.albumDatas[albumID];

            if (albumID == 0 || albumID == 1)
            {
                screenFiller = GetScreenFiller(sm_instance.albumScreen);

                instImage = new GameObject[_gc.m_SaveManager.albumDatas[albumID].imagePath.Count];
                for (int i = 0; i < _gc.m_SaveManager.albumDatas[albumID].imagePath.Count; i++)
                {
                    instImage[i] = Instantiate(_gc.m_SaveManager.m_imagePrefab, albumContainer.transform, false);
                    AlbumFiller albumFiller = instImage[i].GetComponent <AlbumFiller>();
                    if (albumFiller.frameText)
                    {
                        albumFiller.frameText.text = _gc.m_SaveManager.albumDatas[albumID].imageName[i];
                    }
                    albumFiller.frameID = _gc.m_SaveManager.albumDatas[albumID].imageName.IndexOf(_gc.m_SaveManager.albumDatas[albumID].imageName[i]);

                    var texture = Resources.Load <Texture2D>("defaultalbum/" +
                                                             _gc.m_SaveManager.albumDatas[albumID].imagePath[i]);
                    if (albumFiller.frameImage)
                    {
                        albumFiller.frameImage.texture = texture;
                    }
                }
                SwitchScreen(sm_instance.albumScreen, true);
            }
            else
            {
                screenFiller = GetScreenFiller(sm_instance.customAlbumScreen);
                // load texture from gallery
                SwitchScreen(sm_instance.customAlbumScreen, true);
            }
            if (screenFiller.screenTextFiller)
            {
                screenFiller.screenTextFiller.text = currentAlbum.albumName;
            }
            screenFiller.screenID = _gc.m_SaveManager.albumDatas[albumID]._id;
        }
Exemplo n.º 3
0
        // profile button behaviour
        public void GoToProfile(UISnapScrolling _snapScrolling)
        {
            int profileID = _snapScrolling.SelectedPanID; // get album ID
            // grab next screen and populate
            UserData currentProfile = _gc.m_SaveManager.userDatas[profileID];

            screenFiller = GetScreenFiller(sm_instance.userScreen);
            if (screenFiller.screenTextFiller)
            {
                screenFiller.screenTextFiller.text = currentProfile.userName;
            }
            if (screenFiller.ageTextFiller)
            {
                screenFiller.ageTextFiller.text = currentProfile.age.ToString();
            }
            if (screenFiller.genderTextFiller)
            {
                screenFiller.genderTextFiller.text = currentProfile.gender;
            }
            screenFiller.screenID = profileID;
            SwitchScreen(sm_instance.userScreen, true);
        }
Exemplo n.º 4
0
        public override void BootSequence()
        {
            if (screenManagerInstance == null)
            {
                screenManagerInstance = this;
            }
            m_Screens      = GetComponentsInChildren <UIScreen>(true);        // get all the screens
            m_ScrollSnap   = GetComponentsInChildren <UISnapScrolling>(true); // get all the pop ups
            m_GameScreens  = GetComponentsInChildren <UIGameScreen>(true);
            m_PopupScreens = GetComponentsInChildren <UIPopup>(true);

            for (int i = 0; i < m_Screens.Length; i++)
            {
                if (m_Screens[i].name == "album_screen")
                {
                    albumScreen = m_Screens[i];
                }
                else if (m_Screens[i].name == "custom_album_screen")
                {
                    customAlbumScreen = m_Screens[i];
                }
                else if (m_Screens[i].name == "user_screen")
                {
                    userScreen = m_Screens[i];
                }
            }
            // create temp holder for pop ups
            for (int i = 0; i < m_PopupScreens.Length; i++)
            {
                if (m_PopupScreens[i].name == "new_popup_album")
                {
                    newAlbumPopup = m_PopupScreens[i];
                }
                else if (m_PopupScreens[i].name == "new_popup_user")
                {
                    newUserPopup = m_PopupScreens[i];
                }
                else if (m_PopupScreens[i].name == "name_popup")
                {
                    editUserNamePopup = m_PopupScreens[i];
                }
                else if (m_PopupScreens[i].name == "age_popup")
                {
                    editUserAgePopup = m_PopupScreens[i];
                }
                else if (m_PopupScreens[i].name == "gender_popup")
                {
                    editUserGenderPopup = m_PopupScreens[i];
                }
                else if (m_PopupScreens[i].name == "error_popup")
                {
                    errorPopup_parents_page = m_PopupScreens[i];
                }
                else if (m_PopupScreens[i].name == "error_popup2")
                {
                    errorPopup_user_page = m_PopupScreens[i];
                }
                else if (m_PopupScreens[i].name == "album_select_popup")
                {
                    albumSelectPopup = m_PopupScreens[i];
                }
                else if (m_PopupScreens[i].name == "profile_select_popup")
                {
                    profileSelectPopup = m_PopupScreens[i];
                }
            }
            // create temp holder for gamescreens
            for (int i = 0; i < m_ScrollSnap.Length; i++)
            {
                if (m_ScrollSnap[i].name == "Content_expression")
                {
                    expressionContent = m_ScrollSnap[i];
                }
                else if (m_ScrollSnap[i].name == "Content_album")
                {
                    albumContent = m_ScrollSnap[i];
                }
                else if (m_ScrollSnap[i].name == "Content_profile")
                {
                    profileContent = m_ScrollSnap[i];
                }
                else if (m_ScrollSnap[i].name == "Content_game")
                {
                    gameContent = m_ScrollSnap[i];
                }
            }
        }