Esempio n. 1
0
 void Awake()
 {
     uiButton       = GetComponent <UIButton>();
     uiButtonScale  = GetComponent <UIButtonScale>();
     uiButtonOffset = GetComponent <UIButtonOffset>();
     uiButtonSound  = GetComponent <UIButtonSound>();
 }
Esempio n. 2
0
            public CheckBoxDuplicate(GameObject parentPanel, UICheckbox source)
            {
                Object = NGUITools.AddChild(parentPanel, source.gameObject);
                foreach (var component in Object.GetComponents <Component>())
                {
                    switch (component)
                    {
                    case BoxCollider boxCollider:
                        Collider = boxCollider;
                        break;

                    case UICheckbox checkBox:
                        Checkbox = checkBox;
                        break;

                    case UIButton button:
                        Button = button;
                        break;

                    case UIButtonSound buttonSound:
                        ButtonSound = buttonSound;
                        break;
                    }
                }
            }
Esempio n. 3
0
    private void Select(UILabel lbl, bool instant)
    {
        this.Highlight(lbl, instant);
        this.selection = lbl.gameObject.GetComponent <UIEventListener>().parameter as string;
        UIButtonSound[] components = base.GetComponents <UIButtonSound>();
        int             num        = 0;
        int             length     = (int)components.Length;

        while (num < length)
        {
            UIButtonSound uIButtonSound = components[num];
            if (uIButtonSound.trigger == UIButtonSound.Trigger.OnClick)
            {
                NGUITools.PlaySound(uIButtonSound.audioClip, uIButtonSound.volume, 1f);
            }
            num++;
        }
    }
Esempio n. 4
0
    private void Select(UILabel lbl, bool instant)
    {
        Highlight(lbl, instant);
        UIEventListener component = lbl.gameObject.GetComponent <UIEventListener>();

        selection = (component.parameter as string);
        UIButtonSound[] components = GetComponents <UIButtonSound>();
        int             i          = 0;

        for (int num = components.Length; i < num; i++)
        {
            UIButtonSound uIButtonSound = components[i];
            if (uIButtonSound.trigger == UIButtonSound.Trigger.OnClick)
            {
                NGUITools.PlaySound(uIButtonSound.audioClip, uIButtonSound.volume, 1f);
            }
        }
    }
Esempio n. 5
0
    /// <summary>
    /// Select the specified label.
    /// </summary>

    void Select(UILabel lbl, bool instant)
    {
        Highlight(lbl, instant);

        UIEventListener listener = lbl.gameObject.GetComponent <UIEventListener>();

        selection = listener.parameter as string;

        UIButtonSound[] sounds = GetComponents <UIButtonSound>();

        for (int i = 0, imax = sounds.Length; i < imax; ++i)
        {
            UIButtonSound snd = sounds[i];

            if (snd.trigger == UIButtonSound.Trigger.OnClick)
            {
                NGUITools.PlaySound(snd.audioClip, snd.volume, 1f);
            }
        }
    }
Esempio n. 6
0
    private void Select(UILabel lbl, bool instant)
    {
        this.Highlight(lbl, instant);
        UIEventListener component = lbl.gameObject.GetComponent <UIEventListener>();

        this.selection = component.parameter as string;
        UIButtonSound[] components = base.GetComponents <UIButtonSound>();
        int             index      = 0;
        int             length     = components.Length;

        while (index < length)
        {
            UIButtonSound sound = components[index];
            if (sound.trigger == UIButtonSound.Trigger.OnClick)
            {
                NGUITools.PlaySound(sound.audioClip, sound.volume, 1f);
            }
            index++;
        }
    }
Esempio n. 7
0
 // Use this for initialization
 void Start()
 {
     _buttonScale=gameObject.GetComponentInChildren<UIButtonScale>();
     _buttonSound=gameObject.GetComponentInChildren<UIButtonSound>();
     _sprite=gameObject.GetComponentInChildren<UISprite>();
 }
Esempio n. 8
0
 // Use this for initialization
 void Start()
 {
     _checkBox=gameObject.GetComponentInChildren<UICheckbox>();
     _buttonScle=gameObject.GetComponentInChildren<UIButtonScale>();
     _buttonSound=gameObject.GetComponentInChildren<UIButtonSound>();
 }
Esempio n. 9
0
 void Start()
 {
     if (target == null) target = GetComponentInChildren<UISprite>();
     _buttonScle=gameObject.GetComponentInChildren<UIButtonScale>();
     _buttonSound=gameObject.GetComponentInChildren<UIButtonSound>();
 }