Exemplo n.º 1
0
        //开始,如果结束那么返回true
        public void Start()
        {
            Clear();
            m_beginTime = Now;

            HandleSequence seqHandle = null;

            if (CurHandle != null)
            {
                if (_type == Type.sequence)
                {
                    seqHandle = CurHandle as HandleSequence;
                    seqHandle.Start(this);
                }
                else
                {
                    CurHandle.OnStart(this);
                }
            }

            if (CurHandle != null && m_isUseNowStart)
            {
                if (!ingore)
                {
                    CurHandle.OnUseNowStart(this);
                }
                m_isCatchUseNowStart = true;
            }

            if (IsEnd)
            {
                End();
            }
        }
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();*/
        }
 static int OnEnd(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UI.HandleSequence obj  = (UI.HandleSequence)ToLua.CheckObject(L, 1, typeof(UI.HandleSequence));
         UI.Handle         arg0 = (UI.Handle)ToLua.CheckObject(L, 2, typeof(UI.Handle));
         obj.OnEnd(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int OnUpdate(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         UI.HandleSequence obj  = (UI.HandleSequence)ToLua.CheckObject(L, 1, typeof(UI.HandleSequence));
         UI.Handle         arg0 = (UI.Handle)ToLua.CheckObject(L, 2, typeof(UI.Handle));
         float             arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
         obj.OnUpdate(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    static int get_IsDurationValid(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UI.HandleSequence obj = (UI.HandleSequence)o;
            bool ret = obj.IsDurationValid;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index IsDurationValid on a nil value" : e.Message));
        }
    }
 static int OnReset(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 4);
         UI.HandleSequence obj  = (UI.HandleSequence)ToLua.CheckObject(L, 1, typeof(UI.HandleSequence));
         UI.Handle         arg0 = (UI.Handle)ToLua.CheckObject(L, 2, typeof(UI.Handle));
         bool arg1 = LuaDLL.luaL_checkboolean(L, 3);
         bool arg2 = LuaDLL.luaL_checkboolean(L, 4);
         obj.OnReset(arg0, arg1, arg2);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    static int _CreateUI_HandleSequence(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

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