Пример #1
0
 // Token: 0x06004DEA RID: 19946 RVA: 0x0013662C File Offset: 0x0013482C
 public void AddWidget(global::UIWidget w)
 {
     if (w != null)
     {
         global::UINode uinode = this.AddTransform(w.cachedTransform);
         if (uinode != null)
         {
             uinode.widget = w;
             if (!this.mWidgets.Contains(w))
             {
                 this.mWidgets.Add(w);
                 if (!this.mChanged.Contains(w.material))
                 {
                     this.mChanged.Add(w.material);
                     this.mChangedLastFrame = true;
                 }
                 this.mDepthChanged = true;
             }
         }
         else
         {
             Debug.LogError("Unable to find an appropriate UIRoot for " + global::NGUITools.GetHierarchy(w.gameObject) + "\nPlease make sure that there is at least one game object above this widget!", w.gameObject);
         }
     }
 }
Пример #2
0
    // Token: 0x0600491E RID: 18718 RVA: 0x00116C48 File Offset: 0x00114E48
    protected void Init()
    {
        this.mInitDone = true;
        if (this.tweenTarget == null)
        {
            this.tweenTarget = base.gameObject;
        }
        global::UIWidget component = this.tweenTarget.GetComponent <global::UIWidget>();

        if (component != null)
        {
            this.mColor = component.color;
        }
        else
        {
            Renderer renderer = this.tweenTarget.renderer;
            if (renderer != null)
            {
                this.mColor = renderer.material.color;
            }
            else
            {
                Light light = this.tweenTarget.light;
                if (light != null)
                {
                    this.mColor = light.color;
                }
                else
                {
                    Debug.LogWarning(global::NGUITools.GetHierarchy(base.gameObject) + " has nothing for UIButtonColor to color", this);
                    base.enabled = false;
                }
            }
        }
    }
Пример #3
0
 // Token: 0x060049CA RID: 18890 RVA: 0x0011B20C File Offset: 0x0011940C
 private void OnSelect(bool isSelected)
 {
     if (!isSelected && this.mChild != null)
     {
         this.mLabelList.Clear();
         this.handleEvents = false;
         if (this.isAnimated)
         {
             global::UIWidget[] componentsInChildren = this.mChild.GetComponentsInChildren <global::UIWidget>();
             int i   = 0;
             int num = componentsInChildren.Length;
             while (i < num)
             {
                 global::UIWidget uiwidget = componentsInChildren[i];
                 Color            color    = uiwidget.color;
                 color.a = 0f;
                 global::TweenColor.Begin(uiwidget.gameObject, 0.15f, color).method = global::UITweener.Method.EaseOut;
                 i++;
             }
             global::NGUITools.SetAllowClickChildren(this.mChild, false);
             global::UpdateManager.AddDestroy(this.mChild, 0.15f);
         }
         else
         {
             Object.Destroy(this.mChild);
         }
         this.mBackground = null;
         this.mHighlight  = null;
         this.mChild      = null;
     }
 }
Пример #4
0
    // Token: 0x060049CB RID: 18891 RVA: 0x0011B2E0 File Offset: 0x001194E0
    private void AnimateColor(global::UIWidget widget)
    {
        Color color = widget.color;

        widget.color = new Color(color.r, color.g, color.b, 0f);
        global::TweenColor.Begin(widget.gameObject, 0.15f, color).method = global::UITweener.Method.EaseOut;
    }
    // Token: 0x06002AFA RID: 11002 RVA: 0x0009FB10 File Offset: 0x0009DD10
    public void Bind(global::BlueprintDataBlock.IngredientEntry ingredient, int needAmount, int haveAmount)
    {
        global::ItemDataBlock ingredient2 = ingredient.Ingredient;
        Color color;

        if (needAmount <= haveAmount)
        {
            this.checkIcon.enabled = true;
            this.xIcon.enabled     = false;
            color = Color.green;
        }
        else
        {
            this.checkIcon.enabled = false;
            this.xIcon.enabled     = true;
            color = Color.red;
        }
        global::UIWidget uiwidget = this.need;
        Color            color2   = color;

        this.have.color    = color2;
        uiwidget.color     = color2;
        this.itemName.text = ingredient2.name;
        this.need.text     = needAmount.ToString("N0");
        this.have.text     = haveAmount.ToString("N0");
    }
 // Token: 0x06004B9E RID: 19358 RVA: 0x001276E8 File Offset: 0x001258E8
 public static void WidgetDisabled(global::UIWidget widget)
 {
     if (global::UIWidget.Global.noGlobal)
     {
         return;
     }
     global::UIWidget.Global.g.enabledWidgets.Remove(widget);
 }
 // Token: 0x06004B9D RID: 19357 RVA: 0x001276CC File Offset: 0x001258CC
 public static void WidgetEnabled(global::UIWidget widget)
 {
     if (global::UIWidget.Global.noGlobal)
     {
         return;
     }
     global::UIWidget.Global.g.enabledWidgets.Add(widget);
 }
Пример #8
0
    // Token: 0x060049CC RID: 18892 RVA: 0x0011B330 File Offset: 0x00119530
    private void AnimatePosition(global::UIWidget widget, bool placeAbove, float bottom)
    {
        Vector3 localPosition  = widget.cachedTransform.localPosition;
        Vector3 localPosition2 = (!placeAbove) ? new Vector3(localPosition.x, 0f, localPosition.z) : new Vector3(localPosition.x, bottom, localPosition.z);

        widget.cachedTransform.localPosition = localPosition2;
        GameObject gameObject = widget.gameObject;

        global::TweenPosition.Begin(gameObject, 0.15f, localPosition).method = global::UITweener.Method.EaseOut;
    }
 // Token: 0x06004B82 RID: 19330 RVA: 0x00126B90 File Offset: 0x00124D90
 public static int CompareFunc(global::UIWidget left, global::UIWidget right)
 {
     if (left.mDepth > right.mDepth)
     {
         return(1);
     }
     if (left.mDepth < right.mDepth)
     {
         return(-1);
     }
     return(0);
 }
Пример #10
0
 // Token: 0x06004B9B RID: 19355 RVA: 0x00127620 File Offset: 0x00125820
 public static void RegisterWidget(global::UIWidget widget)
 {
     if (global::UIWidget.Global.noGlobal)
     {
         return;
     }
     global::UIGlobal.EnsureGlobal();
     if (widget.globalIndex == -1)
     {
         widget.globalIndex = global::UIWidget.Global.g.allWidgets.Count;
         global::UIWidget.Global.g.allWidgets.Add(widget);
     }
 }
Пример #11
0
    // Token: 0x06004E85 RID: 20101 RVA: 0x00144D60 File Offset: 0x00142F60
    private void SetAlpha(float val)
    {
        int i   = 0;
        int num = this.mWidgets.Length;

        while (i < num)
        {
            global::UIWidget uiwidget = this.mWidgets[i];
            Color            color    = uiwidget.color;
            color.a        = val;
            uiwidget.color = color;
            i++;
        }
    }
Пример #12
0
        static StackObject *ResizeCollider_13(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            global::UIWidget instance_of_this_method = (global::UIWidget)typeof(global::UIWidget).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            __intp.Free(ptr_of_this_method);

            instance_of_this_method.ResizeCollider();

            return(__ret);
        }
Пример #13
0
        static StackObject *get_pivot_15(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            global::UIWidget instance_of_this_method = (global::UIWidget)typeof(global::UIWidget).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.pivot;

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
Пример #14
0
    // Token: 0x06004DF7 RID: 19959 RVA: 0x00137160 File Offset: 0x00135360
    private void Fill(global::UIMaterial mat)
    {
        int i = this.mWidgets.Count;

        while (i > 0)
        {
            if (this.mWidgets[--i] == null)
            {
                this.mWidgets.RemoveAt(i);
            }
        }
        int j     = 0;
        int count = this.mWidgets.Count;

        while (j < count)
        {
            global::UIWidget uiwidget = this.mWidgets[j];
            if (uiwidget.visibleFlag == 1 && uiwidget.material == mat)
            {
                global::UINode node = this.GetNode(uiwidget.cachedTransform);
                if (node != null)
                {
                    uiwidget.WriteToBuffers(this.mCacheBuffer);
                }
                else
                {
                    Debug.LogError("No transform found for " + global::NGUITools.GetHierarchy(uiwidget.gameObject), this);
                }
            }
            j++;
        }
        if (this.mCacheBuffer.vSize > 0)
        {
            global::UIDrawCall current = this.GetDrawCall(mat, true).Current;
            current.depthPass          = this.depthPass;
            current.panelPropertyBlock = this.propertyBlock;
            current.Set(this.mCacheBuffer);
        }
        else
        {
            global::UIDrawCall.Iterator drawCall = this.GetDrawCall(mat, false);
            if (drawCall.Has)
            {
                this.Delete(ref drawCall);
            }
        }
        this.mCacheBuffer.Clear();
    }
Пример #15
0
    // Token: 0x060049CD RID: 18893 RVA: 0x0011B3A8 File Offset: 0x001195A8
    private void AnimateScale(global::UIWidget widget, bool placeAbove, float bottom)
    {
        GameObject gameObject      = widget.gameObject;
        Transform  cachedTransform = widget.cachedTransform;
        float      num             = (float)this.font.size * this.textScale + this.mBgBorder * 2f;
        Vector3    localScale      = cachedTransform.localScale;

        cachedTransform.localScale = new Vector3(localScale.x, num, localScale.z);
        global::TweenScale.Begin(gameObject, 0.15f, localScale).method = global::UITweener.Method.EaseOut;
        if (placeAbove)
        {
            Vector3 localPosition = cachedTransform.localPosition;
            cachedTransform.localPosition = new Vector3(localPosition.x, localPosition.y - localScale.y + num, localPosition.z);
            global::TweenPosition.Begin(gameObject, 0.15f, localPosition).method = global::UITweener.Method.EaseOut;
        }
    }
Пример #16
0
 // Token: 0x06004DEB RID: 19947 RVA: 0x001366DC File Offset: 0x001348DC
 public void RemoveWidget(global::UIWidget w)
 {
     if (w != null)
     {
         global::UINode node = this.GetNode(w.cachedTransform);
         if (node != null)
         {
             if (node.visibleFlag == 1 && !this.mChanged.Contains(w.material))
             {
                 this.mChanged.Add(w.material);
                 this.mChangedLastFrame = true;
             }
             this.RemoveTransform(w.cachedTransform);
         }
         this.mWidgets.Remove(w);
     }
 }
Пример #17
0
        static StackObject *get_depth_4(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            global::UIWidget instance_of_this_method = (global::UIWidget)typeof(global::UIWidget).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.depth;

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method;
            return(__ret + 1);
        }
Пример #18
0
    // Token: 0x06004DF5 RID: 19957 RVA: 0x00136F10 File Offset: 0x00135110
    private void UpdateWidgets()
    {
        int i     = 0;
        int count = this.mChildren.Count;

        while (i < count)
        {
            global::UINode   uinode = (global::UINode)this.mChildren[i];
            global::UIWidget widget = uinode.widget;
            if (uinode.visibleFlag == 1 && widget != null && widget.UpdateGeometry(ref this.mWorldToLocal, uinode.changeFlag == 1, this.generateNormals) && !this.mChanged.Contains(widget.material))
            {
                this.mChanged.Add(widget.material);
                this.mChangedLastFrame = true;
            }
            uinode.changeFlag = 0;
            i++;
        }
    }
Пример #19
0
        static StackObject *set_height_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Int32 @value = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            global::UIWidget instance_of_this_method = (global::UIWidget)typeof(global::UIWidget).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            __intp.Free(ptr_of_this_method);

            instance_of_this_method.height = value;

            return(__ret);
        }
Пример #20
0
 // Token: 0x06004B9C RID: 19356 RVA: 0x0012765C File Offset: 0x0012585C
 public static void UnregisterWidget(global::UIWidget widget)
 {
     if (global::UIWidget.Global.noGlobal)
     {
         return;
     }
     if (widget.globalIndex != -1)
     {
         global::UIWidget.Global.g.allWidgets.RemoveAt(widget.globalIndex);
         int i     = widget.globalIndex;
         int count = global::UIWidget.Global.g.allWidgets.Count;
         while (i < count)
         {
             global::UIWidget.Global.g.allWidgets[i].globalIndex = i;
             i++;
         }
         widget.globalIndex = -1;
     }
 }
Пример #21
0
        static StackObject *set_shader_17(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Shader @value = (UnityEngine.Shader) typeof(UnityEngine.Shader).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            global::UIWidget instance_of_this_method = (global::UIWidget)typeof(global::UIWidget).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            __intp.Free(ptr_of_this_method);

            instance_of_this_method.shader = value;

            return(__ret);
        }
Пример #22
0
        static StackObject *Add_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            global::UIWidget @item = (global::UIWidget)typeof(global::UIWidget).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Collections.Generic.List <global::UIWidget> instance_of_this_method = (System.Collections.Generic.List <global::UIWidget>) typeof(System.Collections.Generic.List <global::UIWidget>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Add(@item);

            return(__ret);
        }
Пример #23
0
    // Token: 0x06004A5A RID: 19034 RVA: 0x0011F0EC File Offset: 0x0011D2EC
    private static void FillWidgetListWithChildren(Transform trans, ref global::NGUIMath.WidgetList list, ref bool madeList)
    {
        global::UIWidget component = trans.GetComponent <global::UIWidget>();

        if (component)
        {
            if (!madeList)
            {
                list     = global::NGUIMath.WidgetList.Generate();
                madeList = true;
            }
            list.Add(component);
        }
        int childCount = trans.childCount;

        while (childCount-- > 0)
        {
            global::NGUIMath.FillWidgetListWithChildren(trans.GetChild(childCount), ref list, ref madeList);
        }
    }
Пример #24
0
    // Token: 0x06004A9D RID: 19101 RVA: 0x00120B0C File Offset: 0x0011ED0C
    public static void MakePixelPerfect(Transform t)
    {
        global::UIWidget component = t.GetComponent <global::UIWidget>();

        if (component != null)
        {
            component.MakePixelPerfect();
        }
        else
        {
            t.localPosition = global::NGUITools.Round(t.localPosition);
            t.localScale    = global::NGUITools.Round(t.localScale);
            int i          = 0;
            int childCount = t.childCount;
            while (i < childCount)
            {
                global::NGUITools.MakePixelPerfect(t.GetChild(i));
                i++;
            }
        }
    }
Пример #25
0
        static StackObject *get_localCenter_16(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            global::UIWidget instance_of_this_method = (global::UIWidget)typeof(global::UIWidget).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.localCenter;

            if (ILRuntime.Runtime.Generated.CLRBindings.s_UnityEngine_Vector3_Binding_Binder != null)
            {
                ILRuntime.Runtime.Generated.CLRBindings.s_UnityEngine_Vector3_Binding_Binder.PushValue(ref result_of_this_method, __intp, __ret, __mStack);
                return(__ret + 1);
            }
            else
            {
                return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
            }
        }
 // Token: 0x06004DCA RID: 19914 RVA: 0x00135D8C File Offset: 0x00133F8C
 private void OnLocalize(global::Localization loc)
 {
     if (this.mLanguage != loc.currentLanguage)
     {
         global::UIWidget component = base.GetComponent <global::UIWidget>();
         global::UILabel  uilabel   = component as global::UILabel;
         global::UISprite uisprite  = component as global::UISprite;
         if (string.IsNullOrEmpty(this.mLanguage) && string.IsNullOrEmpty(this.key) && uilabel != null)
         {
             this.key = uilabel.text;
         }
         string text = (!string.IsNullOrEmpty(this.key)) ? loc.Get(this.key) : loc.Get(component.name);
         if (uilabel != null)
         {
             uilabel.text = text;
         }
         else if (uisprite != null)
         {
             uisprite.spriteName = text;
             uisprite.MakePixelPerfect();
         }
         this.mLanguage = loc.currentLanguage;
     }
 }
Пример #27
0
    // Token: 0x06004DE5 RID: 19941 RVA: 0x001363BC File Offset: 0x001345BC
    public bool IsVisible(global::UIWidget w)
    {
        if (!w.enabled || !w.gameObject.activeInHierarchy || w.color.a < 0.001f)
        {
            return(false);
        }
        if (this.mClipping == global::UIDrawCall.Clipping.None)
        {
            return(true);
        }
        Vector2 relativeSize = w.relativeSize;
        Vector2 vector       = Vector2.Scale(w.pivotOffset, relativeSize);
        Vector2 vector2      = vector;

        vector.x += relativeSize.x;
        vector.y -= relativeSize.y;
        Transform cachedTransform = w.cachedTransform;
        Vector3   a = cachedTransform.TransformPoint(vector);
        Vector3   b = cachedTransform.TransformPoint(new Vector2(vector.x, vector2.y));
        Vector3   c = cachedTransform.TransformPoint(new Vector2(vector2.x, vector.y));
        Vector3   d = cachedTransform.TransformPoint(vector2);

        return(this.IsVisible(a, b, c, d));
    }
Пример #28
0
 // Token: 0x060049CE RID: 18894 RVA: 0x0011B464 File Offset: 0x00119664
 private void Animate(global::UIWidget widget, bool placeAbove, float bottom)
 {
     this.AnimateColor(widget);
     this.AnimatePosition(widget, placeAbove, bottom);
 }