Ejemplo n.º 1
0
        //共有操作的操作对象
        void DrawPublicGo()
        {
            if (m_cur.m_states.Count == 0)
            {
                return;
            }
            if (!EditorUtil.DrawHeader("共有操作的操作对象"))
            {
                return;
            }
            using (new AutoContent())
            {
                StateHandle.State s = m_cur.m_states[0];
                for (int i = 0; i < s.publicHandles.Count; ++i)
                {
                    Handle h = s.publicHandles[i];
                    if (h.CurHandle == null)
                    {
                        //Debuger.LogError("没有处理");
                        continue;
                    }
                    using (new AutoBeginHorizontal())
                    {
                        //游戏对象改变
                        if (h.CurHandle.OnDrawGo(m_cur, h, h.CurTypeName))
                        {
                            for (int j = 0; j < m_cur.m_states.Count; ++j)
                            {
                                StateHandle.State s2 = m_cur.m_states[j];
                                Handle            h2 = s2.publicHandles[i];
                                h2.m_go = h.m_go;
                                h2.CurHandle.OnReset(h2, false, true);
                            }
                            EditorUtil.SetDirty(m_cur);
                        }
                        //删除
                        if (GUILayout.Button("删除", GUILayout.Width(40)))
                        {
                            m_cur.RemovePublicHandle(i);
                            return;
                        }
                    }
                }

                //增加共有操作
                int type = UnityEditor.EditorGUILayout.Popup("增加共有操作", -1, Handle.TypeName);
                if (type != -1 && type != 0)
                {
                    m_cur.AddPublicHandle((Handle.Type)type);
                }
            }
        }
Ejemplo n.º 2
0
 static int AddPublicHandle(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UI.StateHandle obj  = (UI.StateHandle)ToLua.CheckObject(L, 1, typeof(UI.StateHandle));
         UI.Handle.Type arg0 = (UI.Handle.Type)ToLua.CheckObject(L, 2, typeof(UI.Handle.Type));
         obj.AddPublicHandle(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }