Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Allocators/IAllocator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
#if UNITY_EDITOR
using System.Collections.Generic;

namespace ProfilerDataExporter
{
Expand All @@ -9,4 +10,4 @@ public interface IAllocator<T>
void Free(IList<T> elements);
}
}

#endif
5 changes: 3 additions & 2 deletions Allocators/ListPool.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
#if UNITY_EDITOR
using System;
using System.Collections.Generic;

namespace ProfilerDataExporter
Expand All @@ -17,4 +18,4 @@ public override void Free(List<T> element)
}
}
}

#endif
5 changes: 3 additions & 2 deletions Allocators/ObjectPool.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
#if UNITY_EDITOR
using System;
using System.Collections.Generic;

namespace ProfilerDataExporter
Expand Down Expand Up @@ -57,4 +58,4 @@ public void Free(IList<T> elements)
}
}
}

#endif
5 changes: 3 additions & 2 deletions Factories/BaseFactory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
namespace ProfilerDataExporter
#if UNITY_EDITOR
namespace ProfilerDataExporter
{
public class BaseFactory<T> : IFactory<T>
where T : new()
Expand All @@ -10,4 +11,4 @@ public T Create()
}
}
}

#endif
5 changes: 3 additions & 2 deletions Factories/IFactory.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
namespace ProfilerDataExporter
#if UNITY_EDITOR
namespace ProfilerDataExporter
{
public interface IFactory<T>
{
T Create();
}
}

#endif
5 changes: 3 additions & 2 deletions Factories/ListFactory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
#if UNITY_EDITOR
using System;
using System.Collections.Generic;

namespace ProfilerDataExporter
Expand Down Expand Up @@ -28,4 +29,4 @@ public List<T> Create()
}
}
}

#endif
4 changes: 3 additions & 1 deletion FunctionTableState.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
#if UNITY_EDITOR
using System.Collections.Generic;
#if !UNITY_2019_1_OR_NEWER
using UnityEditorInternal.Profiling;
#endif
Expand Down Expand Up @@ -70,3 +71,4 @@ string TableGUILayout.ITableState.SortHeader
}
}
}
#endif
6 changes: 4 additions & 2 deletions ProfilerData.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
#if UNITY_EDITOR
using System;
using System.Collections.Generic;
using UnityEditorInternal;
#if !UNITY_2019_1_OR_NEWER
Expand Down Expand Up @@ -196,4 +197,5 @@ public void Clear()
value = string.Empty;
}
}
}
}
#endif
7 changes: 4 additions & 3 deletions ProfilerDataExporter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using UnityEngine;
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
#if !UNITY_2019_1_OR_NEWER
Expand Down Expand Up @@ -268,5 +269,5 @@ private void ExtractData(int firstFrameIndex, int lastFrameIndex, string selecte
profilerData.Clear();
}
}

}
}
#endif
6 changes: 4 additions & 2 deletions StatsCalculator/AvgStatsCalculator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
#if UNITY_EDITOR
using System.Collections.Generic;

namespace ProfilerDataExporter
{
Expand All @@ -14,4 +15,5 @@ protected override float AggregateValues(IList<float> values)
return sum / values.Count;
}
}
}
}
#endif
6 changes: 4 additions & 2 deletions StatsCalculator/MaxStatsCalculator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
#if UNITY_EDITOR
using System.Collections.Generic;

namespace ProfilerDataExporter
{
Expand All @@ -18,4 +19,5 @@ protected override float AggregateValues(IList<float> values)
return max;
}
}
}
}
#endif
6 changes: 4 additions & 2 deletions StatsCalculator/MinStatsCalculator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
#if UNITY_EDITOR
using System.Collections.Generic;

namespace ProfilerDataExporter
{
Expand All @@ -18,4 +19,5 @@ protected override float AggregateValues(IList<float> values)
return min;
}
}
}
}
#endif
6 changes: 4 additions & 2 deletions StatsCalculator/StatsCalculatorBase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
#if UNITY_EDITOR
using System;
using System.Collections.Generic;
using UnityEditorInternal;
#if !UNITY_2019_1_OR_NEWER
Expand Down Expand Up @@ -139,4 +140,5 @@ private FunctionDataValue GetValue(IList<FunctionData> framesData, ProfilerColum

protected abstract float AggregateValues(IList<float> values);
}
}
}
#endif
6 changes: 4 additions & 2 deletions StatsCalculator/StatsCalculatorProvider.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
#if UNITY_EDITOR
using System.Collections.Generic;

namespace ProfilerDataExporter
{
Expand All @@ -25,4 +26,5 @@ public static StatsCalculatorBase GetStatsCalculator(StatsType statsType)
return Calculators[statsType];
}
}
}
}
#endif
6 changes: 4 additions & 2 deletions StatsCalculator/SumStatsCalculator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
#if UNITY_EDITOR
using System.Collections.Generic;

namespace ProfilerDataExporter
{
Expand All @@ -14,4 +15,5 @@ protected override float AggregateValues(IList<float> values)
return sum;
}
}
}
}
#endif
2 changes: 2 additions & 0 deletions UnityWrappers/GUIClip.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if UNITY_EDITOR
using System;
using System.Reflection;
using UnityEngine;
Expand Down Expand Up @@ -36,3 +37,4 @@ public static Rect visibleRect
}
}
}
#endif
4 changes: 3 additions & 1 deletion UnityWrappers/SplitterGUILayout.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
#if UNITY_EDITOR
using System;
using System.Reflection;
using UnityEditor;
using UnityEngine;
Expand Down Expand Up @@ -192,3 +193,4 @@ public void ApplyOptions(GUILayoutOption[] options)
}
}
}
#endif
17 changes: 14 additions & 3 deletions UnityWrappers/SplitterState.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
#if UNITY_EDITOR
using System;
using System.Reflection;
using UnityEditor;
using UnityEngine;
Expand Down Expand Up @@ -28,7 +29,7 @@ public SplitterState(float[] relativeSizes, int[] minSizes, int[] maxSizes)
BindingFlags.DeclaredOnly |
BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.Instance | BindingFlags.CreateInstance, null, null, new object[] { relativeSizes, minSizes, maxSizes });
realSizes = (int[])RealSizesInfo.GetValue(splitter);
realSizes = Array.ConvertAll((float[])RealSizesInfo.GetValue(splitter), x => (int)x);
}

public SplitterState(object splitter)
Expand Down Expand Up @@ -69,10 +70,19 @@ public int splitSize
{
get
{
return (int)SplitterStateType.InvokeMember("splitSize",
var splitSize = SplitterStateType.InvokeMember("splitSize",
BindingFlags.DeclaredOnly |
BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.Instance | BindingFlags.GetField, null, splitter, null);

if (splitSize is int)
{
return (int)splitSize;
}
else
{
return 0;
}
}
}
public float[] relativeSizes
Expand Down Expand Up @@ -135,3 +145,4 @@ public void DoSplitter(int currentActiveSplitter, int v, int num3)
}
}
}
#endif
6 changes: 4 additions & 2 deletions Utils/ByteSize.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
#if UNITY_EDITOR
using System;
using System.Globalization;

namespace ByteSizeLib
Expand Down Expand Up @@ -406,4 +407,5 @@ public static bool TryParse(string s, out ByteSize result)
}
}
}
}
}
#endif
4 changes: 3 additions & 1 deletion Utils/TableGUILayout.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
#if UNITY_EDITOR
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

Expand Down Expand Up @@ -65,3 +66,4 @@ public static void AddRow(ITableState tableState, int rowIndex, IEnumerable<stri
}
}
}
#endif