Unity Cloud BuildでできあがったiOS版ビルドがインストールできない
Unity Cloud Buildで出来上がったiOSバイナリをインストールしようとしたのですが、「Detect Device」というボタンを押すと、また同じ「Detect Device」のボタンのあるページに戻ってきて一向にインストールできないという現象に遭遇。
たまに 404 Page not found になるときも。
プロヴィジョニングファイルを更新してみたり、ブラウザや端末を再起動してみたり、他のブラウザを試してみたりしたけどうまくいかず。
MacOS CatalinaでiTunesがなくなったけどどうやってiPhoneのUDIDを確認するの?
ERROR ITMS-90503 と出てアプリをApp Storeにアップロードできない
フルメッセージとしては以下のようなのが出た。
ERROR ITMS-90503: "Invalid Bundle. You've included the "arm64" value for the UIRequiredDeviceCapabilities key in your Xcode project, indicating that your app may only support 64-bit. Your binary, 'com.nukenin.hogehoge', must only contain the 64-bit architecture slice. Learn more (https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW3)."
以下の動画にUnityでの対策が載っていた
youtu.be
Player Settings の ArchitectureがUniversalになっているところをarm64に設定すると良いらしい。
調べてみると、armv7を使っていたiPhoneは2013年発売のiPhone 5cまでで、それ以降はarm64のようなので、ほぼ問題ないでしょう。
forum.unity.com
↑これをみると、 2019.4.13f1で直るっぽいことが書いてあった。
追記
arm64に設定しても、ビルド中に何故かUniversalに変更されてしまう...
どうも、自分の入れているあるパブリッシャーから提供されたプラグインの中で、
PlayerSettings.SetArchitecture(BuildTargetGroup.iOS, 2);
とされている部分があったのでこれが原因っぽい。
今回は、XCodeで、Required device capabilites からarm64を取り除くことで一応解決できた。
Asperiteでつくったaseファイル内にあるアニメーションをレガシーにする。
AseFileImporter.csのGenerateAnimationsの中でテキトーにanimationClip.legacy = true;
してしまえばいけました。
子供のTrasnformをsortする拡張
Trasnformをsortしたいことがしばしばあったので書いてみました。
もっと軽量にできそうだけどざっくり。
public static class TransformExtensions { private class Comparer : IComparer<Transform> { public Func<Transform, Transform, int> func; public Comparer(Func<Transform, Transform, int> func) { this.func = func; } public int Compare(Transform a, Transform b) { return this.func(a, b); } } public static void SortChildren(this Transform t, Func<Transform, Transform, int> func) { Transform[] children = new Transform[t.childCount]; for (int i = 0; i < children.Length; i++) { children[i] = t.GetChild(i); } var comparer = new Comparer(func); Array.Sort(children, comparer); foreach (var child in children) { child.SetAsLastSibling(); } } }
使い方としては、たとえばsortTransformというtransform以下のHogeというコンポーネントのindexでソートする場合、
sortTransform.SortChildren((a, b) => { return a.GetComponent<Hoge>().index - b.GetComponent<Hoge>().index;});
DOTweenのSequenceでSetLoops(-1)しようとしても一回しか再生されない
これはハマった。
警告なり、エラーなり出して欲しい。
代わりにAppendCallbackを使ってその中でTweenするようにするのが定石っぽい。
このなかの回答でSequenceは固定のVideoClipのようなもので動的なものではないと書いてある。これ、言っている意味がわからなかったけど、おそらくSetLoops()はループが終わる度にもう一度Tweenを追加するような仕組みになっているんだと思われる。
なので固定のVideoClipのようなSequenceでは使えないと。