public static void Copy(RawImageEx det, RawImage source) { det.texture = source.texture; det.uvRect = source.uvRect; det.maskable = source.maskable; det.onCullStateChanged = source.onCullStateChanged; det.color = source.color; det.material = source.material; det.raycastTarget = source.raycastTarget; det.enabled = source.enabled; }
static int SetTexture(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); RawImageEx obj = (RawImageEx)ToLua.CheckObject <RawImageEx>(L, 1); UnityEngine.Texture arg0 = (UnityEngine.Texture)ToLua.CheckObject <UnityEngine.Texture>(L, 2); obj.SetTexture(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int SetTextureName(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); RawImageEx obj = (RawImageEx)ToLua.CheckObject <RawImageEx>(L, 1); string arg0 = ToLua.CheckString(L, 2); obj.SetTextureName(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int get_isRender(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); RawImageEx obj = (RawImageEx)o; bool ret = obj.isRender; LuaDLL.lua_pushboolean(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index isRender on a nil value")); } }
static int get_textureName(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); RawImageEx obj = (RawImageEx)o; string ret = obj.textureName; LuaDLL.lua_pushstring(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index textureName on a nil value")); } }
static int set_isRender(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); RawImageEx obj = (RawImageEx)o; bool arg0 = LuaDLL.luaL_checkboolean(L, 2); obj.isRender = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index isRender on a nil value")); } }
static private void RewriteUIPrefab(Transform node) { ImageEx _uisprite = node.GetComponent <ImageEx>(); if (_uisprite != null) { if (_uisprite.sprite != null) { string path = AssetDatabase.GetAssetPath(_uisprite.sprite); TextureImporter texImp = AssetImporter.GetAtPath(path) as TextureImporter; if (texImp != null) { _uisprite.SetInfo(texImp.spritePackingTag, _uisprite.sprite.name); } else { _uisprite.SetInfo(null, null); } _uisprite.sprite = null; } else { _uisprite.SetInfo(null, null); } } RawImageEx _uitexture = node.GetComponent <RawImageEx>(); if (_uitexture != null) { if (_uitexture.texture != null) { _uitexture.SetInfo(_uitexture.texture.name); _uitexture.texture = null; } else { _uitexture.SetInfo(null); } } ButtonEx _uibutton = node.GetComponent <ButtonEx>(); if (_uibutton != null) { if (_uibutton.spriteState.highlightedSprite != null) { string path = AssetDatabase.GetAssetPath(_uibutton.spriteState.highlightedSprite); TextureImporter texImp = AssetImporter.GetAtPath(path) as TextureImporter; if (texImp != null) { _uibutton.SetButtonInfo(1, texImp.spritePackingTag, _uibutton.spriteState.highlightedSprite.name); } else { _uibutton.SetButtonInfo(1, null, null); } } else { _uibutton.SetButtonInfo(1, null, null); } if (_uibutton.spriteState.pressedSprite != null) { string path = AssetDatabase.GetAssetPath(_uibutton.spriteState.pressedSprite); TextureImporter texImp = AssetImporter.GetAtPath(path) as TextureImporter; if (texImp != null) { _uibutton.SetButtonInfo(2, texImp.spritePackingTag, _uibutton.spriteState.pressedSprite.name); } else { _uibutton.SetButtonInfo(2, null, null); } } else { _uibutton.SetButtonInfo(2, null, null); } if (_uibutton.spriteState.disabledSprite != null) { string path = AssetDatabase.GetAssetPath(_uibutton.spriteState.disabledSprite); TextureImporter texImp = AssetImporter.GetAtPath(path) as TextureImporter; if (texImp != null) { _uibutton.SetButtonInfo(3, texImp.spritePackingTag, _uibutton.spriteState.disabledSprite.name); } else { _uibutton.SetButtonInfo(3, null, null); } } else { _uibutton.SetButtonInfo(3, null, null); } _uibutton.spriteState = new SpriteState(); } TextEx _uitext = node.GetComponent <TextEx>(); if (_uitext != null) { if (_uitext.font != null) { if (_uitext.font.name.Equals("Arial")) { //_uitext.SetInfo("DFYuanW7"); } else { _uitext.SetInfo(_uitext.font.name); _uitext.font = null; } } else { _uitext.SetInfo(null); } } for (int i = 0; i < node.childCount; ++i) { RewriteUIPrefab(node.GetChild(i)); } }