public float TimeField(Rect rect, int id, float time, float frameRate, TimeFormat timeFormat)
{
bool flag;
if (timeFormat == TimeFormat.None)
{
float num = EditorGUI.DoFloatField(EditorGUI.s_RecycledEditor, rect, new Rect(0f, 0f, 0f, 0f), id, time, EditorGUI.kFloatFieldFormatString, EditorStyles.numberField, false);
return this.SnapTimeToWholeFPS(num, frameRate);
}
if (timeFormat == TimeFormat.Frame)
{
int num3 = Mathf.RoundToInt(time * frameRate);
return (((float) EditorGUI.DoIntField(EditorGUI.s_RecycledEditor, rect, new Rect(0f, 0f, 0f, 0f), id, num3, EditorGUI.kIntFieldFormatString, EditorStyles.numberField, false, 0f)) / frameRate);
}
string text = this.FormatTime(time, frameRate, TimeFormat.TimeFrame);
string allowedletters = "0123456789.,:";
text = EditorGUI.DoTextField(EditorGUI.s_RecycledEditor, id, rect, text, EditorStyles.numberField, allowedletters, out flag, false, false, false);
if (flag && (GUIUtility.keyboardControl == id))
{
float num9;
GUI.changed = true;
text = text.Replace(',', '.');
int index = text.IndexOf(':');
if (index >= 0)
{
int num6;
int num7;
string s = text.Substring(0, index);
string str4 = text.Substring(index + 1);
if (int.TryParse(s, out num6) && int.TryParse(str4, out num7))
{
return (num6 + (((float) num7) / frameRate));
}
return time;
}
if (float.TryParse(text, out num9))
{
return this.SnapTimeToWholeFPS(num9, frameRate);
}
}
return time;
}