Example #1
0
        internal static void ShowUsage(string path, string[] gameObjectPath)
        {
            path = FileUtility.MakeRelativeToProjectPath(path);
            if (path == null)
            {
                return;
            }

            path = FileUtility.NormalizeWindowsToUnix(path);
            var extension = Path.GetExtension(path).ToLower();

            EditorUtility.FocusProjectWindow();

            switch (extension)
            {
            case ".unity":
                ShowSceneUsage(path, gameObjectPath);
                break;

            default:
                var asset = AssetDatabase.LoadMainAssetAtPath(path);
                Selection.activeObject = asset;
                EditorGUIUtility.PingObject(asset);
                break;
            }
        }
        private static void CheckLegacyAssemblies()
        {
            var checkList = new HashSet <string>(new[] { KnownAssemblies.UnityVS, KnownAssemblies.Messaging, KnownAssemblies.Bridge });

            try
            {
                var assemblies = AppDomain
                                 .CurrentDomain
                                 .GetAssemblies()
                                 .Where(a => checkList.Contains(a.GetName().Name));

                foreach (var assembly in assemblies)
                {
                    // for now we only want to warn against local assemblies, do not check externals.
                    var relativePath = FileUtility.MakeRelativeToProjectPath(assembly.Location);
                    if (relativePath == null)
                    {
                        continue;
                    }

                    Debug.LogWarning($"Project contains legacy assembly that could interfere with the Visual Studio Package. You should delete {relativePath}");
                }
            }
            catch (Exception)
            {
                // abandon legacy check
            }
        }