//tips
嶋津様打ち合わせ
webrtc,Shopifyを触ってみてもいいかも。
//vivox理解
ビルドの問題をもう少し調べていく。
インポート時の他モジュールとのファイルの重複でもエラーになる場合もあるよう。
https://teratail.com/questions/102139
Assembly-CSharp はadfを定義していないスクリプトがすべて押し込められる、いわゆる「全部入り」のアセンブリのこと。
Assembly Definitionという機能により「C#のビルドファイル(アセンブリ)を分割して出力する」ことができる。
Assembly Definitionを利用していないのでひとまとめのセットとなっているはず。
https://qiita.com/toRisouP/items/d206af3029c7d80326ed
https://docs.unity3d.com/ja/2018.4/Manual/ScriptCompileOrderFolders.html
現在エラー要因となっているAssembly-CSharp.dll の重複をフォルダから調べた。
/Users/akihironakamura/Desktop/Unity2018/BlockchainTest/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll
/Users/akihironakamura/Desktop/Unity2018/BlockchainTest/Temp/StagingArea/の下にはアプリデータしかない。
Data/Managed/Assembly-CSharp.dll は存在していないはず。右クリックでコンテンツの中身を見たがこれは存在しなかった。
アプリ自体は生成されるが、機能しない。
公式に問い合わせるしかないよう。
I tried to figure out below building errors, but I couldn't get to know how to fix it.
I checked my file and I confirmed that there is nothing under StagingArea/Data/Managed file.
App was built but didn't work.
I think scripts compile process would get trouble.
Could you tell me how to deal this problem?
Thank you.
<Error Contents>
1.
Trying to add file
/Users/akihironakamura/Desktop/Unity2018/BlockchainTest/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll
to the list of ouptut files in the build report, but a file at that path has already been added.
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
2.
ArgumentException:
An item with the same key has already been added. Key: /Users/akihironakamura/Desktop/vtest0731.app/Contents/Resources/Data/Managed/Assembly-CSharp.dll
System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
UnityEditor.PackageManager.Packages.GetForAssemblyFilePaths (System.Collections.Generic.List`1[T] assemblyPaths) (at /Users/builduser/buildslave/unity/build/Modules/PackageManager/Editor/Managed/PackageManager.cs:86)
UnityEditor.BuildEventsHandlerPostProcess.ReportBuildPackageIds (UnityEditor.Build.Reporting.BuildFile[] buildFiles) (at /Users/builduser/buildslave/unity/build/Modules/UnityEditorAnalyticsEditor/BuildEventsHandler.cs:72)
UnityEditor.BuildEventsHandlerPostProcess.OnPostprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at /Users/builduser/buildslave/unity/build/Modules/UnityEditorAnalyticsEditor/BuildEventsHandler.cs:49)
UnityEditor.Build.BuildPipelineInterfaces+<OnBuildPostProcess>c__AnonStorey2.<>m__1 (UnityEditor.Build.IPostprocessBuildWithReport bpp) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:398)
UnityEditor.Build.BuildPipelineInterfaces.InvokeCallbackInterfacesPair[T1,T2] (System.Collections.Generic.List`1[T] oneInterfaces, System.Action`1[T] invocationOne, System.Collections.Generic.List`1[T] twoInterfaces, System.Action`1[T] invocationTwo, System.Boolean exitOnFailure) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:356)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun() (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindow.cs:167)
My Environment:
mac 11.4
unity2018.4.20f
vivox v5
build platform:PC,Mac
//パネルの表示のずれの修正の件
パネルの横バーの表示がleft to right に設定しているのに、右にずれており、問題が何か探っていたら、横バーのvalueの値がmaxになっていたため右側しか映らず、左端文字が切れていることがわかった。
Valueをminに設定したら解決。
//参照渡しの確認
スクリプトの中でメソッド内で他の部分で定義した値を使用するために引数を追加する部分を見つけたので理解を深める。
変数には値型と参照型があり、引数に参照型変数を渡し呼び出す場合には、メソッドの引数の部分にも定義を記述する必要がある。
構造体(struct)で宣言された型は値型となり、intやfloatといった整数型があり、値型はローカル変数の場合はスタックに値が置かれる。
クラス(class)で宣言された型は参照型になり、string、List、配列などがそれに当たる。ヒープ領域に実体(インスタンス)があり、スタックにはそこへの参照のみが入っている。
このスタックとヒープは、メソッドの名前のことでなく、以前に記載したメモリ管理部分のことであり、structのインスタンス保存方法が、classの保存方法より変数コピー分無駄に作成することになってしまうという問題のところで述べた。
詳細は下記参照。
参照渡しは下記例が非常にわかりやすかったので記載。
ChangeArrayValueメソッドで配列のintArrayを実行するために、ChangeArrayValueの定義の部分に(int[] tempIntArray) を追加している。
考え方としてはメソッドを実行したい引数のタイプに応じて、メソッド定義の引数部分に記述を加える。
public class PassByReference : MonoBehaviour
{
void Start()
{
int[] intArray = new int[] { 0, 1, 2, 3 };
// 引数に参照型変数を渡し呼び出す
ChangeArrayValue(intArray);
foreach (var item in intArray) {
Debug.Log("メソッド呼び出し後配列要素: " + item);
}
}
void ChangeArrayValue(int[] tempIntArray) {
tempIntArray[0] = 5;
}
}
参考:https://gametukurikata.com/csharp/passbyvalueandpassbyreference