public override void OnGUI(Rect rect) { Rect r = new Rect(rect); if (m_ShowAutoInstrumemtationParams) { Rect toggleRect = new Rect(r); toggleRect.height = kAutoInstrumentButtonHeight; // TODO: Use reflection and foreach on InstrumentedAssemblyTypes values var newAutoInstrumentedAssemblies = InstrumentedAssemblyTypes.None; if (GUI.Toggle(toggleRect, (m_AutoInstrumentedAssemblyTypes & InstrumentedAssemblyTypes.Script) != 0, s_AutoInstrumentScriptsContent)) { newAutoInstrumentedAssemblies |= InstrumentedAssemblyTypes.Script; } if (newAutoInstrumentedAssemblies != m_AutoInstrumentedAssemblyTypes) { m_AutoInstrumentedAssemblyTypes = newAutoInstrumentedAssemblies; ProfilerDriver.SetAutoInstrumentedAssemblies(m_AutoInstrumentedAssemblyTypes); SessionState.SetInt(kAutoInstrumentSettingKey, (int)m_AutoInstrumentedAssemblyTypes); } r.y += kAutoInstrumentButtonsHeight; r.height -= kAutoInstrumentButtonsHeight; } m_FunctionsList.OnGUI(r); }
public override void OnGUI(Rect rect) { Rect source = new Rect(rect); if (this.m_ShowAutoInstrumemtationParams) { Rect position = new Rect(source) { height = 20f }; InstrumentedAssemblyTypes none = InstrumentedAssemblyTypes.None; if (GUI.Toggle(position, (this.m_AutoInstrumentedAssemblyTypes & InstrumentedAssemblyTypes.Script) != InstrumentedAssemblyTypes.None, s_AutoInstrumentScriptsContent)) { none |= InstrumentedAssemblyTypes.Script; } if (none != this.m_AutoInstrumentedAssemblyTypes) { this.m_AutoInstrumentedAssemblyTypes = none; ProfilerDriver.SetAutoInstrumentedAssemblies(this.m_AutoInstrumentedAssemblyTypes); SessionState.SetInt("ProfilerAutoInstrumentedAssemblyTypes", (int)this.m_AutoInstrumentedAssemblyTypes); } source.y += 20f; source.height -= 20f; } this.m_FunctionsList.OnGUI(source); }
public ProfilerInstrumentationPopup(Dictionary <string, int> functions, bool showAllCheckbox, bool showAutoInstrumemtationParams) { this.m_ShowAutoInstrumemtationParams = showAutoInstrumemtationParams; this.m_ShowAllCheckbox = showAllCheckbox; this.m_AutoInstrumentedAssemblyTypes = (InstrumentedAssemblyTypes)SessionState.GetInt("ProfilerAutoInstrumentedAssemblyTypes", 0); this.m_FunctionsListInputData = new InputData(); this.m_FunctionsListInputData.m_CloseOnSelection = false; this.m_FunctionsListInputData.m_AllowCustom = true; this.m_FunctionsListInputData.m_MaxCount = 0; this.m_FunctionsListInputData.m_EnableAutoCompletion = false; this.m_FunctionsListInputData.m_SortAlphabetically = true; this.m_FunctionsListInputData.m_OnSelectCallback = new PopupList.OnSelectCallback(this.ProfilerInstrumentationPopupCallback); this.SetFunctions(functions); this.m_FunctionsList = new PopupList(this.m_FunctionsListInputData); }
public ProfilerInstrumentationPopup(Dictionary<string, int> functions, bool showAllCheckbox, bool showAutoInstrumemtationParams) { this.m_ShowAutoInstrumemtationParams = showAutoInstrumemtationParams; this.m_ShowAllCheckbox = showAllCheckbox; this.m_AutoInstrumentedAssemblyTypes = (InstrumentedAssemblyTypes) SessionState.GetInt("ProfilerAutoInstrumentedAssemblyTypes", 0); this.m_FunctionsListInputData = new ProfilerInstrumentationPopup.InputData(); this.m_FunctionsListInputData.m_CloseOnSelection = false; this.m_FunctionsListInputData.m_AllowCustom = true; this.m_FunctionsListInputData.m_MaxCount = 0; this.m_FunctionsListInputData.m_EnableAutoCompletion = false; this.m_FunctionsListInputData.m_SortAlphabetically = true; this.m_FunctionsListInputData.m_OnSelectCallback = new PopupList.OnSelectCallback(this.ProfilerInstrumentationPopupCallback); this.SetFunctions(functions); this.m_FunctionsList = new PopupList((PopupList.InputData) this.m_FunctionsListInputData); }
public override void OnGUI(Rect rect) { Rect rect1 = new Rect(rect); if (this.m_ShowAutoInstrumemtationParams) { Rect position = new Rect(rect1); position.height = 20f; InstrumentedAssemblyTypes instrumentedAssemblyTypes = InstrumentedAssemblyTypes.None; if (GUI.Toggle(position, (this.m_AutoInstrumentedAssemblyTypes & InstrumentedAssemblyTypes.Script) != InstrumentedAssemblyTypes.None, ProfilerInstrumentationPopup.s_AutoInstrumentScriptsContent)) { instrumentedAssemblyTypes |= InstrumentedAssemblyTypes.Script; } if (instrumentedAssemblyTypes != this.m_AutoInstrumentedAssemblyTypes) { this.m_AutoInstrumentedAssemblyTypes = instrumentedAssemblyTypes; ProfilerDriver.SetAutoInstrumentedAssemblies(this.m_AutoInstrumentedAssemblyTypes); SessionState.SetInt("ProfilerAutoInstrumentedAssemblyTypes", (int)this.m_AutoInstrumentedAssemblyTypes); } rect1.y += 20f; rect1.height -= 20f; } this.m_FunctionsList.OnGUI(rect1); }
static public extern void SetAutoInstrumentedAssemblies(InstrumentedAssemblyTypes fullname);
public static extern void SetAutoInstrumentedAssemblies(InstrumentedAssemblyTypes value);
static ProfilerInstrumentationPopup() { InstrumentedAssemblyTypes script = InstrumentedAssemblyTypes.Script; s_AutoInstrumentScriptsContent = new GUIContent("Auto instrument " + script.ToString() + " assemblies"); }
public override void OnGUI(Rect rect) { Rect rect1 = new Rect(rect); if (this.m_ShowAutoInstrumemtationParams) { Rect position = new Rect(rect1); position.height = 20f; InstrumentedAssemblyTypes instrumentedAssemblyTypes = InstrumentedAssemblyTypes.None; if (GUI.Toggle(position, (this.m_AutoInstrumentedAssemblyTypes & InstrumentedAssemblyTypes.Script) != InstrumentedAssemblyTypes.None, ProfilerInstrumentationPopup.s_AutoInstrumentScriptsContent)) instrumentedAssemblyTypes |= InstrumentedAssemblyTypes.Script; if (instrumentedAssemblyTypes != this.m_AutoInstrumentedAssemblyTypes) { this.m_AutoInstrumentedAssemblyTypes = instrumentedAssemblyTypes; ProfilerDriver.SetAutoInstrumentedAssemblies(this.m_AutoInstrumentedAssemblyTypes); SessionState.SetInt("ProfilerAutoInstrumentedAssemblyTypes", (int) this.m_AutoInstrumentedAssemblyTypes); } rect1.y += 20f; rect1.height -= 20f; } this.m_FunctionsList.OnGUI(rect1); }