public void MoveScroll(bool right)
    {
        float x;

        if (right)
        {
            LeftArrow.SetActive(true);
            Vector3 newPos = Grid.GetComponent <RectTransform>().localPosition;
            newPos.x -= ScrollbarSeparateValue;
            Grid.GetComponent <RectTransform>().localPosition = newPos;
            CurrentScrollbarValue++;
            if (CurrentScrollbarValue >= CurrentGridChild)
            {
                RightArrow.SetActive(false);
            }
        }
        else
        {
            RightArrow.SetActive(true);
            Vector3 newPos = Grid.GetComponent <RectTransform>().localPosition;
            newPos.x += ScrollbarSeparateValue;
            Grid.GetComponent <RectTransform>().localPosition = newPos;
            CurrentScrollbarValue--;
            if (CurrentScrollbarValue <= 4)
            {
                LeftArrow.SetActive(false);
            }
        }
    }
Example #2
0
 public void OnRightArrow()
 {
     for (int i = 0; i < InstructionScreens.Length; i++)
     {
         InstructionScreens[i].SetActive(false);
     }
     showscreen++;
     InstructionScreens[showscreen].SetActive(true);
     if (showscreen == InstructionScreens.Length - 1)
     {
         RightArrow.SetActive(false);
     }
     LeftArrow.SetActive(true);
 }
    public void PrintGroupBtn(GroupType type = GroupType.Return_MaxGroupType)
    {
        ClearGrid();
        if (type == GroupType.Return_MaxGroupType)
        {
            for (int i = 0; i < (int)GroupType.Return_MaxGroupType; i++)
            {
                switch ((GroupType)i)
                {
                case GroupType.Pictures:
                    PrintNewBtn(GroupType.Pictures, "Imagenes");
                    break;

                case GroupType.Videos:
                    PrintNewBtn(GroupType.Videos, "Videos");
                    break;

                case GroupType.Pictures360:
                    PrintNewBtn(GroupType.Pictures360, "Imagenes 360º");
                    break;

                case GroupType.Videos360:
                    PrintNewBtn(GroupType.Videos360, "Videos 360º");
                    break;

                case GroupType.Return_MaxGroupType:
                    break;
                }
            }
        }
        else
        {
            switch (type)
            {
            case GroupType.Pictures:
            case GroupType.Pictures360:
                for (int i = 0; i < allPicture.Count; i++)
                {
                    if (allPicture[i].Type == type)
                    {
                        PrintNewBtn(allPicture[i].Type, allPicture[i].Name, i);
                    }
                }
                break;

            case GroupType.Videos:
            case GroupType.Videos360:
                for (int i = 0; i < allFilms.Count; i++)
                {
                    if (allFilms[i].Type == type)
                    {
                        PrintNewBtn(allFilms[i].Type, allFilms[i].Name, i);
                    }
                }
                break;
            }
            PrintNewBtn(GroupType.Return_MaxGroupType, "Return");
        }
        if (CurrentGridChild == 0)
        {
            CurrentGridChild = Grid.transform.childCount;
        }
        else
        {
            CurrentGridChild = Grid.transform.childCount - CurrentGridChild;
        }

        if (CurrentScrollbarValue < CurrentGridChild)
        {
            RightArrow.SetActive(true);
        }
        else
        {
            RightArrow.SetActive(false);
        }
        LeftArrow.SetActive(false);
    }