Skip to content

Commit

Permalink
Added support for every version newer than 5
Browse files Browse the repository at this point in the history
Now the script also runs in Unity 2017
  • Loading branch information
ximera91 committed Jul 26, 2017
1 parent f1f0cc8 commit 3a8fa94
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ResourceChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ int GetBitsPerPixel(TextureFormat format)
return 8;
case TextureFormat.BGRA32:// Format returned by iPhone camera
return 32;
#if !UNITY_5_3_OR_NEWER
#if !UNITY_5 && !UNITY_5_3_OR_NEWER
case TextureFormat.ATF_RGB_DXT1:// Flash-specific RGB DXT1 compressed color texture format.
case TextureFormat.ATF_RGBA_JPG:// Flash-specific RGBA JPG-compressed color texture format.
case TextureFormat.ATF_RGB_JPG:// Flash-specific RGB JPG-compressed color texture format.
Expand Down Expand Up @@ -775,7 +775,7 @@ void CheckResources()
{
#if UNITY_4_6 || UNITY_4_5 || UNITY_4_4 || UNITY_4_3
UnityEditorInternal.AnimatorController ac = anim.runtimeAnimatorController as UnityEditorInternal.AnimatorController;
#elif UNITY_5_3_OR_NEWER
#elif UNITY_5 || UNITY_5_3_OR_NEWER
UnityEditor.Animations.AnimatorController ac = anim.runtimeAnimatorController as UnityEditor.Animations.AnimatorController;
#endif

Expand All @@ -788,7 +788,7 @@ void CheckResources()
#if UNITY_4_6 || UNITY_4_5 || UNITY_4_4 || UNITY_4_3
UnityEditorInternal.StateMachine sm = ac.GetLayer(x).stateMachine;
int cnt = sm.stateCount;
#elif UNITY_5_3_OR_NEWER
#elif UNITY_5 || UNITY_5_3_OR_NEWER
UnityEditor.Animations.AnimatorStateMachine sm = ac.layers[x].stateMachine;
int cnt = sm.states.Length;
#endif
Expand All @@ -798,7 +798,7 @@ void CheckResources()
#if UNITY_4_6 || UNITY_4_5 || UNITY_4_4 || UNITY_4_3
UnityEditorInternal.State state = sm.GetState(i);
Motion m = state.GetMotion();
#elif UNITY_5_3_OR_NEWER
#elif UNITY_5 || UNITY_5_3_OR_NEWER
UnityEditor.Animations.AnimatorState state = sm.states[i].state;
Motion m = state.motion;
#endif
Expand Down Expand Up @@ -928,7 +928,7 @@ void CheckResources()

private static GameObject[] GetAllRootGameObjects()
{
#if !UNITY_5_3_OR_NEWER
#if !UNITY_5 && !UNITY_5_3_OR_NEWER
return UnityEngine.SceneManagement.SceneManager.GetActiveScene().GetRootGameObjects().ToArray();
#else
List<GameObject> allGo = new List<GameObject>();
Expand Down

0 comments on commit 3a8fa94

Please sign in to comment.