Exemplo n.º 1
0
    static int RemoveSubHandle(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(UI.SequenceHandle), typeof(UnityEngine.Component), typeof(UI.Handle), typeof(float)))
            {
                UI.SequenceHandle     obj  = (UI.SequenceHandle)ToLua.ToObject(L, 1);
                UnityEngine.Component arg0 = (UnityEngine.Component)ToLua.ToObject(L, 2);
                UI.Handle             arg1 = (UI.Handle)ToLua.ToObject(L, 3);
                float arg2 = (float)LuaDLL.lua_tonumber(L, 4);
                obj.RemoveSubHandle(arg0, arg1, arg2);
                return(0);
            }
            else if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(UI.SequenceHandle), typeof(UnityEngine.Component), typeof(UI.Handle), typeof(UI.Handle)))
            {
                UI.SequenceHandle     obj  = (UI.SequenceHandle)ToLua.ToObject(L, 1);
                UnityEngine.Component arg0 = (UnityEngine.Component)ToLua.ToObject(L, 2);
                UI.Handle             arg1 = (UI.Handle)ToLua.ToObject(L, 3);
                UI.Handle             arg2 = (UI.Handle)ToLua.ToObject(L, 4);
                obj.RemoveSubHandle(arg0, arg1, arg2);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UI.SequenceHandle.RemoveSubHandle"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Exemplo n.º 2
0
        //绘制窗口时调用
        void OnGUI()
        {
            if (m_comp == null || m_handle == null || m_handle.m_type != Handle.Type.sequence)
            {
                this.ShowNotification(new GUIContent("空指针或处理的类型不是序列了。请设置正确后再打开编辑器"));
                return;
            }
            this.RemoveNotification();

            if (m_handle.m_go == null && m_comp.GetComponent <SequenceHandle>() != null)
            {
                m_handle.m_go = m_comp.gameObject;
                EditorUtil.SetDirty(m_comp.gameObject);
            }

            if (m_handle.m_go == null)
            {
                if (GUILayout.Button("原对象上创建一个SequenceHandle", GUILayout.Height(50)))
                {
                    m_comp.AddComponentIfNoExist <SequenceHandle>();
                    EditorUtil.SetDirty(m_comp.gameObject);
                }
                this.ShowNotification(new GUIContent("找不到SequenceHandle"));
                return;
            }
            //每次都重新获取下吧
            m_seq        = m_handle.CurHandle as HandleSequence;
            m_subHandles = m_handle.m_go.GetComponent <SequenceHandle>();

            //工具栏
            DrawTopToolbar();

            using (new AutoBeginHorizontal())
            {
                //左边序列控件属性区
                DrawLeftInfo();

                //右边时间轴
                GUIStyle style    = GUI.skin.box;//先收窄box的边距
                GUIStyle boxStyle = new GUIStyle(style);
                boxStyle.margin = new RectOffset(0, 0, 2, 2);
                GUI.skin.box    = boxStyle;
                DrawRightTimeLine();
                GUI.skin.box = style;
            }

            //下边子处理详细页面
            DrawBottomSubHandles();


            //ProcessHotkeys();*/
        }
Exemplo n.º 3
0
 static int ResetId(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UI.SequenceHandle obj = (UI.SequenceHandle)ToLua.CheckObject(L, 1, typeof(UI.SequenceHandle));
         obj.ResetId();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 4
0
 static int ToggleExpand(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UI.SequenceHandle obj  = (UI.SequenceHandle)ToLua.CheckObject(L, 1, typeof(UI.SequenceHandle));
         float             arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
         obj.ToggleExpand(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 5
0
 static int Sort(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         UI.SequenceHandle     obj  = (UI.SequenceHandle)ToLua.CheckObject(L, 1, typeof(UI.SequenceHandle));
         UnityEngine.Component arg0 = (UnityEngine.Component)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.Component));
         UI.Handle             arg1 = (UI.Handle)ToLua.CheckObject(L, 3, typeof(UI.Handle));
         obj.Sort(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 6
0
 static int GetSubHandle(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UI.SequenceHandle obj = (UI.SequenceHandle)ToLua.CheckObject(L, 1, typeof(UI.SequenceHandle));
         int       arg0        = (int)LuaDLL.luaL_checknumber(L, 2);
         UI.Handle o           = obj.GetSubHandle(arg0);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 7
0
 static int SetDurationInvalid(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         UI.SequenceHandle obj  = (UI.SequenceHandle)ToLua.CheckObject(L, 1, typeof(UI.SequenceHandle));
         float             arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
         bool arg1 = LuaDLL.luaL_checkboolean(L, 3);
         obj.SetDurationInvalid(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 8
0
 static int GetAllByTime(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UI.SequenceHandle obj  = (UI.SequenceHandle)ToLua.CheckObject(L, 1, typeof(UI.SequenceHandle));
         float             arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
         System.Collections.Generic.List <UI.Handle> o = obj.GetAllByTime(arg0);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 9
0
        public void Start(Handle h)
        {
            if (h.m_go == null)
            {
                return;
            }
            SequenceHandle seq = h.m_go.GetComponent <SequenceHandle>();

            if (seq == null)
            {
                return;
            }
            foreach (var sub in seq.m_handles)
            {
                sub.Start();
            }
        }
Exemplo n.º 10
0
        public void SetTime(Handle h, float time)
        {
            if (h.m_go == null)
            {
                return;
            }
            SequenceHandle seq = h.m_go.GetComponent <SequenceHandle>();

            if (seq == null)
            {
                return;
            }
            foreach (var sub in seq.m_handles)
            {
                sub.SetTime(time, false, false, true);
            }
        }
Exemplo n.º 11
0
    static int set_m_handles(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UI.SequenceHandle obj = (UI.SequenceHandle)o;
            System.Collections.Generic.List <UI.Handle> arg0 = (System.Collections.Generic.List <UI.Handle>)ToLua.CheckObject(L, 2, typeof(System.Collections.Generic.List <UI.Handle>));
            obj.m_handles = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index m_handles on a nil value" : e.Message));
        }
    }
Exemplo n.º 12
0
    static int get_MaxCount(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UI.SequenceHandle obj = (UI.SequenceHandle)o;
            int ret = obj.MaxCount;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index MaxCount on a nil value" : e.Message));
        }
    }
Exemplo n.º 13
0
    static int get_m_handles(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UI.SequenceHandle obj = (UI.SequenceHandle)o;
            System.Collections.Generic.List <UI.Handle> ret = obj.m_handles;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index m_handles on a nil value" : e.Message));
        }
    }
Exemplo n.º 14
0
 static int AddSubHandle(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 5);
         UI.SequenceHandle     obj  = (UI.SequenceHandle)ToLua.CheckObject(L, 1, typeof(UI.SequenceHandle));
         UnityEngine.Component arg0 = (UnityEngine.Component)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.Component));
         UI.Handle             arg1 = (UI.Handle)ToLua.CheckObject(L, 3, typeof(UI.Handle));
         UI.Handle.Type        arg2 = (UI.Handle.Type)ToLua.CheckObject(L, 4, typeof(UI.Handle.Type));
         float arg3 = (float)LuaDLL.luaL_checknumber(L, 5);
         obj.AddSubHandle(arg0, arg1, arg2, arg3);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 15
0
 static int OffsetTime(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 5);
         UI.SequenceHandle     obj  = (UI.SequenceHandle)ToLua.CheckObject(L, 1, typeof(UI.SequenceHandle));
         UnityEngine.Component arg0 = (UnityEngine.Component)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.Component));
         UI.Handle             arg1 = (UI.Handle)ToLua.CheckObject(L, 3, typeof(UI.Handle));
         System.Collections.Generic.List <UI.Handle> arg2 = (System.Collections.Generic.List <UI.Handle>)ToLua.CheckObject(L, 4, typeof(System.Collections.Generic.List <UI.Handle>));
         float arg3 = (float)LuaDLL.luaL_checknumber(L, 5);
         obj.OffsetTime(arg0, arg1, arg2, arg3);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 16
0
        //左边序列控件属性区
        void DrawLeftInfo()
        {
            using (new AutoBeginVertical(EditorStyles.objectFieldThumb, GUILayout.Width(wLeft), GUILayout.Height(hMiddle)))
            {
                using (new AutoLabelWidth(100))
                {
                    if (m_seq.DrawGoField <SequenceHandle>(m_comp, m_handle, "子处理的外部对象"))
                    {
                        m_subHandles = m_handle.m_go.GetComponent <SequenceHandle>();
                    }

                    EditorGUI.BeginChangeCheck();
                    float delay      = EditorGUILayout.FloatField("延迟", m_handle.m_delay);
                    float duration   = EditorGUILayout.FloatField("持续时间", m_handle.m_duration);
                    float rate       = EditorGUILayout.FloatField("倍速", m_handle.m_rate);
                    bool  isRealtime = EditorGUILayout.Toggle("真实时间", m_handle.m_isRealtime);
                    int   playType   = EditorGUILayout.Popup("类型", (int)m_handle.m_playType, Handle.PlayTypeName);
                    int   endCount   = m_handle.m_endCount;
                    if (m_handle.IsEndCountValid)
                    {
                        endCount = UnityEditor.EditorGUILayout.IntField("循环次数", m_handle.m_endCount);
                    }
                    if (EditorGUI.EndChangeCheck())
                    {
                        if (m_handle.m_isRealtime != isRealtime || m_handle.m_rate != rate)
                        {
                            m_handle.m_rate       = rate;
                            m_handle.m_isRealtime = isRealtime;
                            this.m_subHandles.SyncHandle(this.m_comp, this.m_handle);
                            EditorUtil.SetDirty(m_comp);
                            return;
                        }
                        EditorUtil.RegisterUndo("Handle Change", m_comp);
                        m_handle.m_delay    = delay;
                        m_handle.m_duration = duration;
                        m_handle.m_playType = (Handle.PlayType)playType;
                        m_handle.m_endCount = endCount;
                        EditorUtil.SetDirty(m_comp);
                    }
                }
            }
        }