Inheritance: UnityEngine.MonoBehaviour
 static public int get_PreloadPackages(IntPtr l)
 {
     try {
         FairyGUI.UIConfig self = (FairyGUI.UIConfig)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.PreloadPackages);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int Load(IntPtr l)
 {
     try {
         FairyGUI.UIConfig self = (FairyGUI.UIConfig)checkSelf(l);
         self.Load();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int ApplyModifiedProperties(IntPtr l)
 {
     try {
         FairyGUI.UIConfig self = (FairyGUI.UIConfig)checkSelf(l);
         self.ApplyModifiedProperties();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Esempio n. 4
0
 static int ApplyModifiedProperties(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         FairyGUI.UIConfig obj = (FairyGUI.UIConfig)ToLua.CheckObject(L, 1, typeof(FairyGUI.UIConfig));
         obj.ApplyModifiedProperties();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 5
0
 static int Load(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         FairyGUI.UIConfig obj = (FairyGUI.UIConfig)ToLua.CheckObject(L, 1, typeof(FairyGUI.UIConfig));
         obj.Load();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static public int set_PreloadPackages(IntPtr l)
 {
     try {
         FairyGUI.UIConfig self = (FairyGUI.UIConfig)checkSelf(l);
         System.Collections.Generic.List <System.String> v;
         checkType(l, 2, out v);
         self.PreloadPackages = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Esempio n. 7
0
    static int set_PreloadPackages(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.UIConfig obj = (FairyGUI.UIConfig)o;
            System.Collections.Generic.List <string> arg0 = (System.Collections.Generic.List <string>)ToLua.CheckObject(L, 2, typeof(System.Collections.Generic.List <string>));
            obj.PreloadPackages = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index PreloadPackages on a nil value" : e.Message));
        }
    }
Esempio n. 8
0
    static int get_PreloadPackages(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.UIConfig obj = (FairyGUI.UIConfig)o;
            System.Collections.Generic.List <string> ret = obj.PreloadPackages;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index PreloadPackages on a nil value" : e.Message));
        }
    }
Esempio n. 9
0
    static int get_Items(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.UIConfig obj = (FairyGUI.UIConfig)o;
            System.Collections.Generic.List <FairyGUI.UIConfig.ConfigValue> ret = obj.Items;
            ToLua.PushSealed(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Items on a nil value"));
        }
    }
Esempio n. 10
0
    static int set_Items(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.UIConfig obj = (FairyGUI.UIConfig)o;
            System.Collections.Generic.List <FairyGUI.UIConfig.ConfigValue> arg0 = (System.Collections.Generic.List <FairyGUI.UIConfig.ConfigValue>)ToLua.CheckObject(L, 2, typeof(System.Collections.Generic.List <FairyGUI.UIConfig.ConfigValue>));
            obj.Items = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Items on a nil value"));
        }
    }
Esempio n. 11
0
        private void __click()
        {
            if (sound != null)
            {
                Stage.inst.PlayOneShotSound(sound, soundVolumeScale);
            }

            // FairyGUI修改:添加按钮声音
            if (UIConfig.playSoundFunc != null)
            {
                if (_soundId == -1)
                {
                    UIConfig.playSoundFunc(UIConfig.defaultButtonSoundID, null, UIConfig.defaultButtonSoundVolume);
                }
                else if (_soundId != 0)
                {
                    UIConfig.playSoundFunc(_soundId, null, UIConfig.defaultButtonSoundVolume);
                }
            }

            if (_mode == ButtonMode.Check)
            {
                if (changeStateOnClick)
                {
                    this.selected = !_selected;
                    onChanged.Call();
                }
            }
            else if (_mode == ButtonMode.Radio)
            {
                if (changeStateOnClick && !_selected)
                {
                    this.selected = true;
                    onChanged.Call();
                }
            }
            else
            {
                if (_relatedController != null)
                {
                    _relatedController.selectedPageId = pageOption.id;
                }
            }
        }
Esempio n. 12
0
        public void Play()
        {
            if (audioClip == null)
            {
                if (UIConfig.soundLoader == null || sound.StartsWith(UIPackage.URL_PREFIX))
                {
                    audioClip = UIPackage.GetItemAssetByURL(sound) as AudioClip;
                }
                else
                {
                    audioClip = UIConfig.soundLoader(sound);
                }
            }

            if (audioClip != null)
            {
                Stage.inst.PlayOneShotSound(audioClip, volume);
            }
        }
Esempio n. 13
0
        /// <summary>
        /// 当发生二进制重载时,或用户点击刷新菜单
        /// </summary>
        public static void Reload()
        {
            if (Application.isPlaying)
            {
                return;
            }

            UIConfig.ClearResourceRefs();
            UIConfig[] configs = GameObject.FindObjectsOfType <UIConfig>();
            foreach (UIConfig config in configs)
            {
                config.Load();
            }

            packageListReady = true;

            int cnt = _targets.Count;

            for (int i = 0; i < cnt; i++)
            {
                EMRenderTarget panel = _targets[i];
                panel.EM_Reload();
            }
        }
        void InitDefaultValue(UIConfig.ConfigKey key, UIConfig.ConfigValue value)
        {
            switch ((UIConfig.ConfigKey)key)
            {
                case UIConfig.ConfigKey.ButtonSoundVolumeScale:
                    value.f = 1;
                    break;

                case UIConfig.ConfigKey.ClickDragSensitivity:
                    value.i = 2;
                    break;

                case UIConfig.ConfigKey.DefaultComboBoxVisibleItemCount:
                    value.i = 10;
                    break;

                case UIConfig.ConfigKey.DefaultScrollBarDisplay:
                    value.i = (int)ScrollBarDisplayType.Default;
                    break;

                case UIConfig.ConfigKey.DefaultScrollBounceEffect:
                case UIConfig.ConfigKey.DefaultScrollTouchEffect:
                    value.b = true;
                    break;

                case UIConfig.ConfigKey.DefaultScrollSpeed:
                    value.i = 25;
                    break;

                case UIConfig.ConfigKey.ModalLayerColor:
                    value.c = new Color(0f, 0f, 0f, 0.4f);
                    break;

                case UIConfig.ConfigKey.RenderingTextBrighterOnDesktop:
                    value.b = true;
                    break;

                case UIConfig.ConfigKey.TouchDragSensitivity:
                    value.i = 10;
                    break;

                case UIConfig.ConfigKey.TouchScrollSensitivity:
                    value.i = 20;
                    break;

                case UIConfig.ConfigKey.InputCaretSize:
                    value.i = 1;
                    break;

                case UIConfig.ConfigKey.InputHighlightColor:
                    value.c = new Color32(255, 223, 141, 128);
                    break;
            }
        }
Esempio n. 15
0
        void ApplyValue(TransitionItem item, TransitionValue value)
        {
            item.target._gearLocked = true;

            switch (item.type)
            {
            case TransitionActionType.XY:
                if (item.target == _owner)
                {
                    float f1, f2;
                    if (!value.b1)
                    {
                        f1 = item.target.x;
                    }
                    else
                    {
                        f1 = value.f1 + _ownerBaseX;
                    }
                    if (!value.b2)
                    {
                        f2 = item.target.y;
                    }
                    else
                    {
                        f2 = value.f2 + _ownerBaseY;
                    }
                    item.target.SetXY(f1, f2);
                }
                else
                {
                    if (!value.b1)
                    {
                        value.f1 = item.target.x;
                    }
                    if (!value.b2)
                    {
                        value.f2 = item.target.y;
                    }
                    item.target.SetXY(value.f1, value.f2);
                }
                if (invalidateBatchingEveryFrame)
                {
                    _owner.InvalidateBatchingState(true);
                }
                break;

            case TransitionActionType.Size:
                if (!value.b1)
                {
                    value.f1 = item.target.width;
                }
                if (!value.b2)
                {
                    value.f2 = item.target.height;
                }
                item.target.SetSize(value.f1, value.f2);
                if (invalidateBatchingEveryFrame)
                {
                    _owner.InvalidateBatchingState(true);
                }
                break;

            case TransitionActionType.Pivot:
                item.target.SetPivot(value.f1, value.f2);
                if (invalidateBatchingEveryFrame)
                {
                    _owner.InvalidateBatchingState(true);
                }
                break;

            case TransitionActionType.Alpha:
                item.target.alpha = value.f1;
                break;

            case TransitionActionType.Rotation:
                item.target.rotation = value.f1;
                if (invalidateBatchingEveryFrame)
                {
                    _owner.InvalidateBatchingState(true);
                }
                break;

            case TransitionActionType.Scale:
                item.target.SetScale(value.f1, value.f2);
                if (invalidateBatchingEveryFrame)
                {
                    _owner.InvalidateBatchingState(true);
                }
                break;

            case TransitionActionType.Skew:
                item.target.skew = new Vector2(value.f1, value.f2);
                if (invalidateBatchingEveryFrame)
                {
                    _owner.InvalidateBatchingState(true);
                }
                break;

            case TransitionActionType.Color:
                ((IColorGear)item.target).color = value.c;
                break;

            case TransitionActionType.Animation:
                if (!value.b1)
                {
                    value.i = ((IAnimationGear)item.target).frame;
                }
                ((IAnimationGear)item.target).frame   = value.i;
                ((IAnimationGear)item.target).playing = value.b;
                break;

            case TransitionActionType.Visible:
                item.target.visible = value.b;
                break;

            case TransitionActionType.Transition:
                Transition trans = ((GComponent)item.target).GetTransition(value.s);
                if (trans != null)
                {
                    if (value.i == 0)
                    {
                        trans.Stop(false, true);
                    }
                    else if (trans.playing)
                    {
                        trans._totalTimes = value.i;
                    }
                    else
                    {
                        item.completed = false;
                        _totalTasks++;
                        if (_reversed)
                        {
                            trans.PlayReverse(value.i, 0, () => { __playTransComplete(item); });
                        }
                        else
                        {
                            trans.Play(value.i, 0, () => { __playTransComplete(item); });
                        }
                        if (_timeScale != 1)
                        {
                            trans.timeScale = _timeScale;
                        }
                    }
                }
                break;

            case TransitionActionType.Sound:
                AudioClip sound = UIConfig.LoadSound(value.s);
                if (sound != null)
                {
                    Stage.inst.PlayOneShotSound(sound, value.f1);
                }
                break;

            case TransitionActionType.Shake:
                item.startValue.f1 = 0;                         //offsetX
                item.startValue.f2 = 0;                         //offsetY
                item.startValue.f3 = item.value.f2;             //shakePeriod
                Timers.inst.AddUpdate(item.__Shake, this);
                _totalTasks++;
                item.completed = false;
                break;

            case TransitionActionType.ColorFilter:
                ColorFilter cf = item.target.filter as ColorFilter;
                if (cf == null)
                {
                    cf = new ColorFilter();
                    item.target.filter = cf;
                    item.filterCreated = true;
                }
                else
                {
                    cf.Reset();
                }
                cf.AdjustBrightness(value.f1);
                cf.AdjustContrast(value.f2);
                cf.AdjustSaturation(value.f3);
                cf.AdjustHue(value.f4);
                break;
            }

            item.target._gearLocked = false;
        }