public void AddSubHandle(Component comp, Handle parent, Handle.Type type, float time)
        {
            int maxId = 0;

            foreach (var h in m_handles)
            {
                if (maxId <= h.m_id)
                {
                    maxId = h.m_id + 1;
                }
            }

            Handle handleTo = GetByTime(time);
            bool   isExpand = handleTo == null ? true : handleTo.m_seqIsExpand;


            Handle sub = new Handle();

            sub.m_id         = maxId;
            sub.m_delay      = time;
            sub.m_isRealtime = parent.m_isRealtime;
            sub.m_rate       = parent.m_rate;
            sub.SetType(type);
            sub.m_seqIsExpand       = isExpand;
            sub.m_seqIsShow         = true;
            sub.m_isDurationInvalid = handleTo == null ? sub.m_isDurationInvalid : handleTo.m_isDurationInvalid;
            m_handles.Add(sub);
            Sort(this, parent);
        }
Beispiel #2
0
        //增加独有处理
        public void AddPrivateHandle(int state, Handle.Type type)
        {
            State  s = m_states[state];
            Handle h = new Handle();

            h.m_duration      = m_duration;
            h.m_isRealtime    = m_isRealtime;
            h.m_isUseNowStart = true;
            h.SetType(type);
            s.privateHandles.Add(h);
            EditorUtil.SetDirty(this);
        }
Beispiel #3
0
        //增加共有处理
        public void AddPublicHandle(Handle.Type type)
        {
            foreach (State state in m_states)
            {
                Handle h = new Handle();
                h.m_duration      = m_duration;
                h.m_isRealtime    = IsRealTime;
                h.m_isUseNowStart = true;
                h.SetType(type);
                state.publicHandles.Add(h);
            }

            EditorUtil.SetDirty(this);
        }
Beispiel #4
0
 static int SetType(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UI.Handle      obj  = (UI.Handle)ToLua.CheckObject(L, 1, typeof(UI.Handle));
         UI.Handle.Type arg0 = (UI.Handle.Type)ToLua.CheckObject(L, 2, typeof(UI.Handle.Type));
         obj.SetType(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #5
0
        //增加状态
        public void AddState()
        {
            State state = new State("");

            //复制共有处理的共有的属性
            if (m_states.Count != 0)
            {
                m_states[0].DoAllHandle(false, hOld =>
                {
                    Handle h          = new Handle();
                    h.m_go            = hOld.m_go;
                    h.m_duration      = hOld.m_duration;
                    h.m_isRealtime    = hOld.m_isRealtime;
                    h.m_isUseNowStart = hOld.m_isUseNowStart;
                    h.SetType(hOld.m_type);
                    state.publicHandles.Add(h);
                });
            }
            state.name = "状态";
            m_states.Add(state);
            EditorUtil.SetDirty(this);
        }