facebook twitter hatena line email

「Unity/負荷軽減」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(対策方法)
(対策方法)
行19: 行19:
  
 
==対策方法==
 
==対策方法==
GameObject.Findは重い、GameObject.FindWithTagを使う
+
===GameObject.Findは重い、GameObject.FindWithTagを使う===
 
参考:https://squmarigames.com/2018/12/13/unity-beginner-find/
 
参考:https://squmarigames.com/2018/12/13/unity-beginner-find/
  
Json.netよりJson.Utilityを使う
+
===Json.netよりJson.Utilityを使う===
 
参考:https://yubeshicat.hatenablog.com/entry/2019/11/02/180914
 
参考:https://yubeshicat.hatenablog.com/entry/2019/11/02/180914

2021年5月26日 (水) 19:29時点における版

profiler確認

  1. unity/window/analytis/profilerで確認
  2. playボタンを押すと動作する

使用状況詳細確認

  1. profilerでCPU Usageを選択
  2. 左中段にある、cmbボタンを選択し、Hierarchyを選択。
  3. GC Allocなど確認できる。

実行中に使用状況を確認する場合

  1. play実行
  2. profilerでCPU Usageを選択
  3. 左中段にある、cmbボタンを選択し、Hierarchyを選択。
  4. グラフのどこかをクリックして、選択
  5. PlayerLoopのところを展開していく。

参考: https://light11.hatenadiary.com/entry/2019/09/19/000006

対策方法

GameObject.Findは重い、GameObject.FindWithTagを使う

参考:https://squmarigames.com/2018/12/13/unity-beginner-find/

Json.netよりJson.Utilityを使う

参考:https://yubeshicat.hatenablog.com/entry/2019/11/02/180914