//this source code was auto-generated by tolua#, do not modify it
using System;
using LuaInterface;

public class SpriteManagerWrap
{
	public static void Register(LuaState L)
	{
		L.BeginClass(typeof(SpriteManager), typeof(System.Object));
		L.RegFunction("Init", Init);
		L.RegFunction("GetSprite", GetSprite);
		L.RegFunction("SetSprite", SetSprite);
		L.RegFunction("New", _CreateSpriteManager);
		L.RegFunction("__tostring", ToLua.op_ToString);
		L.RegVar("instance", get_instance, null);
		L.EndClass();
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int _CreateSpriteManager(IntPtr L)
	{
		try
		{
			int count = LuaDLL.lua_gettop(L);

			if (count == 0)
			{
				SpriteManager obj = new SpriteManager();
				ToLua.PushObject(L, obj);
				return 1;
			}
			else
			{
				return LuaDLL.luaL_throw(L, "invalid arguments to ctor method: SpriteManager.New");
			}
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int Init(IntPtr L)
	{
		try
		{
			ToLua.CheckArgsCount(L, 1);
			SpriteManager obj = (SpriteManager)ToLua.CheckObject(L, 1, typeof(SpriteManager));
			obj.Init();
			return 0;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int GetSprite(IntPtr L)
	{
		try
		{
			ToLua.CheckArgsCount(L, 2);
			SpriteManager obj = (SpriteManager)ToLua.CheckObject(L, 1, typeof(SpriteManager));
			string arg0 = ToLua.CheckString(L, 2);
			UnityEngine.Sprite o = obj.GetSprite(arg0);
			ToLua.Push(L, o);
			return 1;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int SetSprite(IntPtr L)
	{
		try
		{
			int count = LuaDLL.lua_gettop(L);

			if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(SpriteManager), typeof(UnityEngine.UI.Image), typeof(string)))
			{
				SpriteManager obj = (SpriteManager)ToLua.ToObject(L, 1);
				UnityEngine.UI.Image arg0 = (UnityEngine.UI.Image)ToLua.ToObject(L, 2);
				string arg1 = ToLua.ToString(L, 3);
				obj.SetSprite(arg0, arg1);
				return 0;
			}
			else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(SpriteManager), typeof(UnityEngine.UI.Button), typeof(string)))
			{
				SpriteManager obj = (SpriteManager)ToLua.ToObject(L, 1);
				UnityEngine.UI.Button arg0 = (UnityEngine.UI.Button)ToLua.ToObject(L, 2);
				string arg1 = ToLua.ToString(L, 3);
				obj.SetSprite(arg0, arg1);
				return 0;
			}
			else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(SpriteManager), typeof(UnityEngine.UI.RawImage), typeof(string)))
			{
				SpriteManager obj = (SpriteManager)ToLua.ToObject(L, 1);
				UnityEngine.UI.RawImage arg0 = (UnityEngine.UI.RawImage)ToLua.ToObject(L, 2);
				string arg1 = ToLua.ToString(L, 3);
				obj.SetSprite(arg0, arg1);
				return 0;
			}
			else
			{
				return LuaDLL.luaL_throw(L, "invalid arguments to method: SpriteManager.SetSprite");
			}
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int get_instance(IntPtr L)
	{
		try
		{
			ToLua.PushObject(L, SpriteManager.instance);
			return 1;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}
}

