示例#1
0
 public static void Open(EventManagerEx manager)
 {
     mWindow = EditorWindow.GetWindow <EventManagerExWindow>();
     mWindow.titleContent = new UnityEngine.GUIContent("  添加音效拓展工具  ");
     mWindow.position     = new Rect((Screen.currentResolution.width - 640) / 2, (Screen.currentResolution.height - 480) / 2, 640, 480);
     mWindow.InitWindow(manager);
 }
示例#2
0
    private void InitWindow(EventManagerEx manager)
    {
        eventManager = manager;
        groupsList   = new List <GroupComponent>();
        var groups = eventManager.GetComponentsInChildren <GroupComponent>(true);

        for (int i = 0; i < groups.Length; ++i)
        {
            var temp = groups[i].transform.Find("Template");
            if (temp != null)
            {
                groupsList.Add(groups[i]);
            }
        }
        folds            = new bool[maxCount];
        selectIndexs     = new int[maxCount];
        lastSelectIndexs = new int[maxCount];
        for (int i = 0; i < lastSelectIndexs.Length; ++i)
        {
            lastSelectIndexs[i] = -1;
        }
        eventNames = new string[maxCount];
    }
示例#3
0
 private void OnEnable()
 {
     this.eventManager = (base.target as EventManagerEx);
     this.undoManager  = new EditorUndoManager(this.eventManager, this.eventManager.name);
 }
示例#4
0
    public static string BuildEventName(string eventName, EventManagerEx eventManager, EventListComponent[] eventListComponents)
    {
        GUILayout.BeginVertical(new GUILayoutOption[0]);
        GUILayout.BeginHorizontal(new GUILayoutOption[0]);
        GUILayout.Label("Event Name:", new GUILayoutOption[0]);
        if (eventName == "DynamicMixer" || eventName == "AudioMixer")
        {
            eventName = "_UnSet_";
        }
        List <string> list = new List <string>();

        list.Add("_UnSet_");
        if (eventManager != null)
        {
            if (eventManager._eventList[0] == "UnSet")
            {
                eventManager._eventList[0] = "_UnSet_";
            }
            list = new List <string>(eventManager._eventList.ToArray());
        }
        if (eventListComponents != null)
        {
            for (int i = 0; i < eventListComponents.Length; i++)
            {
                for (int j = 0; j < eventListComponents[i]._eventList.Count; j++)
                {
                    list.Add(eventListComponents[i]._eventList[j]);
                }
            }
        }
        int num = -1;

        for (int k = 0; k < list.Count; k++)
        {
            if (list[k] == eventName)
            {
                num = k;
                break;
            }
        }
        if (num >= 0)
        {
            string[] array = list.ToArray();
            int      num2  = EditorGUILayout.Popup(num, array, new GUILayoutOption[0]);
            if (num2 != num)
            {
                eventName = array[num2];
            }
        }
        else
        {
            Color backgroundColor = GUI.backgroundColor;
            GUI.backgroundColor = Color.green;
            GUILayout.Label(eventName, "Box", new GUILayoutOption[]
            {
                GUILayout.ExpandWidth(true)
            });
            GUI.backgroundColor = backgroundColor;
            if (GUILayout.Button("Clear", new GUILayoutOption[]
            {
                GUILayout.MaxWidth(45f)
            }))
            {
                eventName = "_UnSet_";
            }
        }
        GUILayout.EndHorizontal();
        GUILayout.EndVertical();
        GUILayout.Space(5f);
        return(eventName);
    }