예제 #1
0
    static int GetFloat(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(UnityGameFramework.Runtime.SettingComponent), typeof(string)))
            {
                UnityGameFramework.Runtime.SettingComponent obj = (UnityGameFramework.Runtime.SettingComponent)ToLua.ToObject(L, 1);
                string arg0 = ToLua.ToString(L, 2);
                float  o    = obj.GetFloat(arg0);
                LuaDLL.lua_pushnumber(L, o);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(UnityGameFramework.Runtime.SettingComponent), typeof(string), typeof(float)))
            {
                UnityGameFramework.Runtime.SettingComponent obj = (UnityGameFramework.Runtime.SettingComponent)ToLua.ToObject(L, 1);
                string arg0 = ToLua.ToString(L, 2);
                float  arg1 = (float)LuaDLL.lua_tonumber(L, 3);
                float  o    = obj.GetFloat(arg0, arg1);
                LuaDLL.lua_pushnumber(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityGameFramework.Runtime.SettingComponent.GetFloat"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
            public override void Initialize(params object[] args)
            {
                m_DebuggerComponent = GameEntry.GetComponent <DebuggerComponent>();
                if (m_DebuggerComponent == null)
                {
                    Log.Fatal("Debugger component is invalid.");
                    return;
                }

                m_SettingComponent = GameEntry.GetComponent <SettingComponent>();
                if (m_SettingComponent == null)
                {
                    Log.Fatal("Setting component is invalid.");
                    return;
                }

                m_LastIconX        = m_SettingComponent.GetFloat("Debugger.Icon.X", 10f);
                m_LastIconY        = m_SettingComponent.GetFloat("Debugger.Icon.Y", 10f);
                m_LastWindowX      = m_SettingComponent.GetFloat("Debugger.Window.X", 10f);
                m_LastWindowY      = m_SettingComponent.GetFloat("Debugger.Window.Y", 10f);
                m_LastWindowWidth  = m_SettingComponent.GetFloat("Debugger.Window.Width", 480f);
                m_LastWindowHeight = m_SettingComponent.GetFloat("Debugger.Window.Height", 360f);
                m_DebuggerComponent.WindowScale = m_LastWindowScale = m_SettingComponent.GetFloat("Debugger.Window.Scale", 1f);
                m_DebuggerComponent.IconRect    = new Rect(m_LastIconX, m_LastIconY, 60f, 60f);
                m_DebuggerComponent.WindowRect  = new Rect(m_LastWindowX, m_LastWindowY, m_LastWindowWidth, m_LastWindowHeight);
            }