Esempio n. 1
0
    protected override void OnInit()
    {
        base.OnInit();

        for (int i = 0; i < BUTTON_COUNT; i++)
        {
            AvatarNavButton avatarNavButton = Instantiate(NavButtonPrefab, Vector3.zero, Quaternion.identity) as AvatarNavButton;
            NavButtonList.AddListElement(avatarNavButton);

            switch (i)
            {
            case (int)AvatarItemType.BODY:
                avatarNavButton.Disable();
                //avatarNavButton.Button.image.color = new Color(SELECTED_COLOR, SELECTED_COLOR, SELECTED_COLOR);
                avatarNavButton.Image.sprite = AssetLookUp.Instance.GetAvatarNavIcon(BODY_ICON_NAME);
                break;

            case (int)AvatarItemType.FACE:
                avatarNavButton.BGImage.color = new Color(1.0f, 1.0f, 1.0f, UNSELECTED_ALPHA);
                avatarNavButton.Image.sprite  = AssetLookUp.Instance.GetAvatarNavIcon(FACE_ICON_NAME);
                break;

            case (int)AvatarItemType.HAIR:
                avatarNavButton.BGImage.color = new Color(1.0f, 1.0f, 1.0f, UNSELECTED_ALPHA);
                avatarNavButton.Image.sprite  = AssetLookUp.Instance.GetAvatarNavIcon(HAIR_ICON_NAME);
                break;

            case (int)AvatarItemType.HAIR_COLOR:
                avatarNavButton.BGImage.color = new Color(1.0f, 1.0f, 1.0f, UNSELECTED_ALPHA);
                avatarNavButton.Image.sprite  = AssetLookUp.Instance.GetAvatarNavIcon(HAIR_COLOR_ICON_NAME);
                break;

            case (int)AvatarItemType.SKIN_COLOR:
                avatarNavButton.BGImage.color = new Color(1.0f, 1.0f, 1.0f, UNSELECTED_ALPHA);
                avatarNavButton.Image.sprite  = AssetLookUp.Instance.GetAvatarNavIcon(SKIN_COLOR_ICON_NAME);
                break;
            }
            avatarNavButton.Setup(i);
        }

        _page = 0;

        NavButtonList.itemSelected    += NavItemSelected;
        ChoiceButtonList.itemSelected += ChoiceItemSelected;
    }
Esempio n. 2
0
    void SetUpNavButtons()
    {
        for (int i = 0; i < BUTTON_COUNT; i++)
        {
            AvatarNavButton avatarNavButton = NavButtonList.ListItems[i] as AvatarNavButton;

            if (i != _page)
            {
                avatarNavButton.BGImage.color = new Color(1.0f, 1.0f, 1.0f, UNSELECTED_ALPHA);
                avatarNavButton.Enable();
            }
            else
            {
                avatarNavButton.BGImage.color = Color.white;
                avatarNavButton.Disable();
            }
        }
        ChoiceButtonList.ClearElements();
        PopulateChoiceButtons();

        if (_page == 0)
        {
            PreviousButton.Deactivate();
        }
        else
        {
            PreviousButton.Activate();
        }

        /*
         * Debug.Log("here!");
         * if (_page == (BUTTON_COUNT - 1))
         *  NextButton.Text = "Done";
         * else
         *  NextButton.Text = "Next";
         */
    }