Example #1
0
        public override bool OnAction()
        {
            AddComponentWindow.SendUsabilityAnalyticsEvent(new AddComponentWindow.AnalyticsEventData
            {
                name        = name,
                filter      = AddComponentWindow.s_AddComponentWindow.searchString,
                isNewScript = false
            });

            var gos = AddComponentWindow.s_AddComponentWindow.m_GameObjects;

            EditorApplication.ExecuteMenuItemOnGameObjects(m_MenuPath, gos);
            return(true);
        }
        private void OnItemSelected(AdvancedDropdownItem item)
        {
            if (item is ComponentDropdownItem cdi)
            {
                SendUsabilityAnalyticsEvent(new AnalyticsEventData
                {
                    name        = name,
                    filter      = searchString,
                    isNewScript = false
                });

                var gos = m_GameObjects;
                EditorApplication.ExecuteMenuItemOnGameObjects(cdi.menuPath, gos);
            }
        }