Ejemplo n.º 1
0
    //Methods for displaying

    public override void Init()
    {
        base.Init();

        front   = transform.Find("Front").GetComponent <Image>();
        pointer = transform.Find("Pointer").GetComponent <ButtonPointer>();

        front.gameObject.SetActive(false);
        textName.SetColor(darkColor);
        pointer.SetNormal();
    }
Ejemplo n.º 2
0
    //Methods for focus and press events

    public override void SetFocused(bool value)
    {
        if (value)
        {
            if (!isFocused)
            {
                if (ParentMenu != null)
                {
                    if (ParentMenu.LastFocused != this)
                    {
                        ParentMenu.LastFocused = this;
                        SoundManager.instance.PlayUiEfx(focusSound);
                    }
                }
                else
                {
                    SoundManager.instance.PlayUiEfx(focusSound);
                }

                if (controlGroup != null)
                {
                    if (currentFocused.ContainsKey(controlGroup))
                    {
                        currentFocused[controlGroup].SetFocused(false);
                    }
                    currentFocused.Add(controlGroup, this);
                }

                isFocused = true;
                front.gameObject.SetActive(true);
                textName.SetColor(lightColor);
                pointer.SetFocus();
                StartCoroutine(Blink(1f, 0.5f));
                InfoBox.SetInfo(description);
            }
        }
        else
        {
            if (isFocused)
            {
                if (IsControlFocusedInGroup())
                {
                    currentFocused.Remove(controlGroup);
                }

                isFocused = false;
                front.gameObject.SetActive(false);
                textName.SetColor(darkColor);
                pointer.SetNormal();
            }
        }
    }
Ejemplo n.º 3
0
    //Methods for displaying

    public override void Init()
    {
        base.Init();

        back    = transform.Find("Back").GetComponent <Image>();
        front   = transform.Find("Front").GetComponent <Image>();
        mark    = transform.Find("Mark").GetComponent <Image>();
        pointer = transform.Find("Pointer").GetComponent <ButtonPointer>();

        frontWidth = 0f;
        SetFrontWidth(frontWidth);
        mark.SetColor(darkColor);
        textName.SetColor(darkColor);
        pointer.SetNormal();
    }