コード例 #1
0
    public static void ReplaceAtlas(global::UIAtlas before, global::UIAtlas after)
    {
        global::UISprite[] array = global::NGUITools.FindActive <global::UISprite>();
        int i   = 0;
        int num = array.Length;

        while (i < num)
        {
            global::UISprite uisprite = array[i];
            if (uisprite.atlas == before)
            {
                uisprite.atlas = after;
            }
            i++;
        }
        global::UILabel[] array2 = global::NGUITools.FindActive <global::UILabel>();
        int j    = 0;
        int num2 = array2.Length;

        while (j < num2)
        {
            global::UILabel uilabel = array2[j];
            if (uilabel.font != null && uilabel.font.atlas == before)
            {
                uilabel.font.atlas = after;
            }
            j++;
        }
    }
コード例 #2
0
        static StackObject *Instantiate_14(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.Transform @parent = (UnityEngine.Transform) typeof(UnityEngine.Transform).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            global::UISprite @original = (global::UISprite)typeof(global::UISprite).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            __intp.Free(ptr_of_this_method);


            var result_of_this_method = UnityEngine.Object.Instantiate <global::UISprite>(@original, @parent);

            object obj_result_of_this_method = result_of_this_method;

            if (obj_result_of_this_method is CrossBindingAdaptorType)
            {
                return(ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance));
            }
            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
コード例 #3
0
 // Token: 0x06004A5E RID: 19038 RVA: 0x0011F4CC File Offset: 0x0011D6CC
 public static global::AABBox CalculateRelativeInnerBounds(Transform root, global::UISprite sprite)
 {
     if (sprite is global::UISlicedSprite)
     {
         return(global::NGUIMath.CalculateRelativeInnerBounds(root, sprite as global::UISlicedSprite));
     }
     return(global::NGUIMath.CalculateRelativeWidgetBounds(root, sprite.cachedTransform));
 }
コード例 #4
0
    // Token: 0x06004A92 RID: 19090 RVA: 0x00120878 File Offset: 0x0011EA78
    public static global::UISprite AddSprite(GameObject go, global::UIAtlas atlas, string spriteName)
    {
        global::UIAtlas.Sprite sprite   = (!(atlas != null)) ? null : atlas.GetSprite(spriteName);
        global::UISprite       uisprite = (sprite != null && !(sprite.inner == sprite.outer)) ? global::NGUITools.AddWidget <global::UISlicedSprite>(go) : global::NGUITools.AddWidget <global::UISprite>(go);

        uisprite.atlas      = atlas;
        uisprite.spriteName = spriteName;
        return(uisprite);
    }
コード例 #5
0
        static StackObject *get_spriteName_1(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::UISprite instance_of_this_method = (global::UISprite)typeof(global::UISprite).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.spriteName;

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
コード例 #6
0
    // Token: 0x06004C0F RID: 19471 RVA: 0x00129890 File Offset: 0x00127A90
    public void MarkAsDirty()
    {
        global::UISprite[] array = global::NGUITools.FindActive <global::UISprite>();
        int i   = 0;
        int num = array.Length;

        while (i < num)
        {
            global::UISprite uisprite = array[i];
            if (global::UIAtlas.CheckIfRelated(this, uisprite.atlas))
            {
                global::UIAtlas atlas = uisprite.atlas;
                uisprite.atlas = null;
                uisprite.atlas = atlas;
            }
            i++;
        }
        global::UIFont[] array2 = global::Resources.FindObjectsOfTypeAll(typeof(global::UIFont)) as global::UIFont[];
        int j    = 0;
        int num2 = array2.Length;

        while (j < num2)
        {
            global::UIFont uifont = array2[j];
            if (global::UIAtlas.CheckIfRelated(this, uifont.atlas))
            {
                global::UIAtlas atlas2 = uifont.atlas;
                uifont.atlas = null;
                uifont.atlas = atlas2;
            }
            j++;
        }
        global::UILabel[] array3 = global::NGUITools.FindActive <global::UILabel>();
        int k    = 0;
        int num3 = array3.Length;

        while (k < num3)
        {
            global::UILabel uilabel = array3[k];
            if (uilabel.font != null && global::UIAtlas.CheckIfRelated(this, uilabel.font.atlas))
            {
                global::UIFont font = uilabel.font;
                uilabel.font = null;
                uilabel.font = font;
            }
            k++;
        }
    }
コード例 #7
0
        static StackObject *set_spriteName_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.String @value = (System.String) typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

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

            __intp.Free(ptr_of_this_method);

            instance_of_this_method.spriteName = value;

            return(__ret);
        }
コード例 #8
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::UISprite @item = (global::UISprite)typeof(global::UISprite).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::UISprite> instance_of_this_method = (System.Collections.Generic.List <global::UISprite>) typeof(System.Collections.Generic.List <global::UISprite>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Add(@item);

            return(__ret);
        }
コード例 #9
0
 // 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;
     }
 }