-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[2017.2.1.4] Fix building on Unity 5.6 and 2017.1 #1963
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -489,13 +489,16 @@ private List<Vector3> GetBounds() | |
BoundingBox.GetMeshFilterBoundsPoints(clone, bounds, mask); | ||
Vector3 centroid = boxInstance.TargetBoundsCenter; | ||
GameObject.Destroy(clone); | ||
#if UNITY_2017_1_OR_NEWER | ||
Matrix4x4 m = Matrix4x4.Rotate(objectToBound.transform.rotation); | ||
for (int i = 0; i < bounds.Count; ++i) | ||
{ | ||
bounds[i] = m.MultiplyPoint(bounds[i]); | ||
bounds[i] += boxInstance.TargetBoundsCenter; | ||
} | ||
|
||
#else | ||
#warning "GetBounds() using rotation is not supported on this version of Unity. Recommend updating to 2017.1 or newer." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if we should warn people about this, in this way. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair enough. I can remove those. |
||
#endif // UNITY_2017_1_OR_NEWER | ||
return bounds; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ namespace HoloToolkit.Unity | |
{ | ||
public static class SpriteAtlasExtensions | ||
{ | ||
// SpriteAtlast requires Unity 2017.1 or later | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: typo: SpriteAtlast |
||
#if UNITY_2017_1_OR_NEWER | ||
public const string SpritePackables = "m_EditorData.packables"; | ||
|
||
public static void SetSprites(this SpriteAtlas spriteAtlas, IList<Sprite> sprites) | ||
|
@@ -31,5 +33,6 @@ public static bool ContainsSprite(this SpriteAtlas spriteAtlas, Sprite sprite) | |
} | ||
return false; | ||
} | ||
#endif // UNITY_2017_1_OR_NEWER | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we should warn people about this, in this way.