コード例 #1
0
        public static string MethodNamePopup(GameObject gameobject, MonoBehaviour behaviour, int maxParameters, bool coroutinesOnly)
        {
            int indentLevel = EditorGUI.get_indentLevel();

            EditorGUI.set_indentLevel(0);
            List <string> list = new List <string>();

            list.Add(Strings.get_Label_None());
            List <string> list2 = list;

            if (gameobject != null)
            {
                if (behaviour == null)
                {
                    MonoBehaviour[] components = gameobject.GetComponents <MonoBehaviour>();
                    for (int i = 0; i < components.Length; i++)
                    {
                        MonoBehaviour behaviour2 = components[i];
                        list2.AddRange(SkillEditorGUILayout.GetMethodNames(behaviour2, maxParameters, coroutinesOnly));
                    }
                }
                else
                {
                    list2.AddRange(SkillEditorGUILayout.GetMethodNames(behaviour, maxParameters, coroutinesOnly));
                }
            }
            int num = EditorGUILayout.Popup(-1, list2.ToArray(), new GUILayoutOption[]
            {
                GUILayout.MaxWidth(20f)
            });

            EditorGUI.set_indentLevel(indentLevel);
            if (num <= 0)
            {
                return("");
            }
            return(list2.get_Item(num));
        }