Example #1
0
 private static void SetTexture(UITextureData data, bool set)
 {
     if (set)
     {
         TextureData textureData = textureList[data.id];
         data.texture.mainTexture = textureData.texture;
     }
     else
     {
         data.texture.mainTexture = null;
     }
 }
Example #2
0
        private void OnEnable()
        {
            if (uiData == null)
            {
                return;
            }

            if (lowLayerAlpha < 1)
            {
                UIManager.SetLessLayerUIAlpha(layer, lowLayerAlpha);
            }

            UIManager.ProcessUIAlpha(this);

            UISpriteData data = null;

            for (int i = 0, count = uiData.sprites.Count; i < count; i++)
            {
                data = uiData.sprites[i];
                SetAtlas(data, true);
            }

            UITextureData utd = null;

            for (int i = 0, count = uiData.textures.Count; i < count; i++)
            {
                utd = uiData.textures[i];
                SetTexture(utd, true);
            }

#if JSSCRIPT
            jsRepresentClass.CallFunctionByFunName("OnEnable", this);
#elif LUASCRIPT
            if (lua_OnEnable == null)
            {
                lua_OnEnable = LuaManager.GetFunction(name + ".OnEnable");
            }
            if (lua_OnEnable != null)
            {
                LuaManager.CallFunc_V(lua_OnEnable, this);
            }
#endif
        }