Skip to content

Commit

Permalink
A few warnings about obsolete things were removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Deadcows committed Feb 21, 2019
1 parent 31f5f13 commit 1095918
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Extensions/EditorExtensions/MyEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace MyBox.EditorTools
{
public static class MyEditor
{
#pragma warning disable 618
#region Hierarchy Management

/// <summary>
Expand Down Expand Up @@ -67,8 +68,13 @@ private static void ObjectRename()
EditorApplication.update -= ObjectRename;
var type = typeof(EditorWindow).Assembly.GetType("UnityEditor.SceneHierarchyWindow");
var hierarchyWindow = EditorWindow.GetWindow(type);
var rename = type.GetMethod("RenameGO", BindingFlags.Instance | BindingFlags.NonPublic);
rename.Invoke(hierarchyWindow, null);
var renameMethod = type.GetMethod("RenameGO", BindingFlags.Instance | BindingFlags.NonPublic);
if (renameMethod == null)
{
Debug.LogError("RenameGO method is obsolete?");
return;
}
renameMethod.Invoke(hierarchyWindow, null);
}
}

Expand All @@ -85,6 +91,7 @@ private static void ObjectRename()
public static void ApplyPrefab(GameObject instance)
{
var instanceRoot = PrefabUtility.FindRootGameObjectWithSameParentPrefab(instance);

var targetPrefab = PrefabUtility.GetCorrespondingObjectFromSource(instanceRoot);

if (instanceRoot == null || targetPrefab == null)
Expand All @@ -94,6 +101,7 @@ public static void ApplyPrefab(GameObject instance)
}

PrefabUtility.ReplacePrefab(instanceRoot, targetPrefab, ReplacePrefabOptions.ConnectToPrefab);

}

/// <summary>
Expand Down Expand Up @@ -147,6 +155,7 @@ private static GUIContent[] GetTextures(string baseName, string postFix, int sta
}

#endregion
#pragma warning restore 618
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace MyBox.Internal
{
#pragma warning disable 618
public class JsonDataSettingsTransfer : IPostprocessBuild
{
public int callbackOrder
Expand All @@ -30,6 +31,7 @@ private void OnBuild(string path)
foreach (var setting in settings)
{
var filename = Path.GetFileName(setting);
if (filename == null) continue;
var newFilepath = Path.Combine(buildPath, filename);
File.Copy(setting, newFilepath);
}
Expand Down Expand Up @@ -57,6 +59,7 @@ private string[] SettingsFileNames(string path)
return Directory.GetFiles(path).Where(p => p.EndsWith(".json")).ToArray();
}
}
#pragma warning restore 618
}

#endif
2 changes: 2 additions & 0 deletions Types/GUID/GuidComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace MyBox
{
#pragma warning disable 618
// This component gives a GameObject a stable, non-replicatable Globally Unique IDentifier.
// It can be used to reference a specific instance of an object no matter where it is.
// This can also be used for other systems, such as Save/Load game
Expand Down Expand Up @@ -142,4 +143,5 @@ public void OnDestroy()
GuidManager.Remove(guid);
}
}
#pragma warning restore 618
}

0 comments on commit 1095918

Please sign in to comment.