| | 1 | | namespace DCL |
| | 2 | | { |
| | 3 | | [System.Serializable] |
| | 4 | | public class SceneMetricsModel |
| | 5 | | { |
| | 6 | | public int meshes; |
| | 7 | | public int bodies; |
| | 8 | | public int materials; |
| | 9 | | public int textures; |
| | 10 | | public int triangles; |
| | 11 | | public int entities; |
| | 12 | | public float sceneHeight; |
| | 13 | |
|
| 807 | 14 | | public SceneMetricsModel Clone() { return (SceneMetricsModel) MemberwiseClone(); } |
| | 15 | |
|
| | 16 | | public static bool operator >(SceneMetricsModel lhs, SceneMetricsModel rhs) |
| | 17 | | { |
| 266 | 18 | | int lhsValue = lhs.meshes + lhs.bodies + lhs.materials + lhs.textures + lhs.triangles + lhs.entities; |
| 266 | 19 | | int rhsValue = rhs.meshes + rhs.bodies + rhs.materials + rhs.textures + rhs.triangles + rhs.entities; |
| | 20 | |
|
| 266 | 21 | | return lhsValue > rhsValue; |
| | 22 | | } |
| | 23 | |
|
| | 24 | | public static bool operator <(SceneMetricsModel lhs, SceneMetricsModel rhs) |
| | 25 | | { |
| 1 | 26 | | int lhsValue = lhs.meshes + lhs.bodies + lhs.materials + lhs.textures + lhs.triangles + lhs.entities; |
| 1 | 27 | | int rhsValue = rhs.meshes + rhs.bodies + rhs.materials + rhs.textures + rhs.triangles + rhs.entities; |
| | 28 | |
|
| 1 | 29 | | return lhsValue < rhsValue; |
| | 30 | | } |
| | 31 | |
|
| | 32 | | public static SceneMetricsModel operator -(SceneMetricsModel lhs, SceneMetricsModel rhs) |
| | 33 | | { |
| 1 | 34 | | SceneMetricsModel result = lhs.Clone(); |
| 1 | 35 | | result.bodies -= rhs.bodies; |
| 1 | 36 | | result.entities -= rhs.entities; |
| 1 | 37 | | result.materials -= rhs.materials; |
| 1 | 38 | | result.textures -= rhs.textures; |
| 1 | 39 | | result.meshes -= rhs.meshes; |
| 1 | 40 | | result.triangles -= rhs.triangles; |
| 1 | 41 | | return result; |
| | 42 | | } |
| | 43 | |
|
| | 44 | | public static SceneMetricsModel operator +(SceneMetricsModel lhs, SceneMetricsModel rhs) |
| | 45 | | { |
| 0 | 46 | | SceneMetricsModel result = lhs.Clone(); |
| 0 | 47 | | result.bodies += rhs.bodies; |
| 0 | 48 | | result.entities += rhs.entities; |
| 0 | 49 | | result.materials += rhs.materials; |
| 0 | 50 | | result.textures += rhs.textures; |
| 0 | 51 | | result.meshes += rhs.meshes; |
| 0 | 52 | | result.triangles += rhs.triangles; |
| 0 | 53 | | return result; |
| | 54 | | } |
| | 55 | |
|
| | 56 | | public override string ToString() |
| | 57 | | { |
| 267 | 58 | | return $"Textures: {textures} - Triangles: {triangles} - Materials: {materials} - Meshes: {meshes} - Bodies: |
| | 59 | | } |
| | 60 | | } |
| | 61 | | } |