private void DisplayTimingField(Property property) { _timingProperties.Add(property); string frameCount = "-"; if (!_properties[property.name].hasMultipleDifferentValues) { frameCount = PlatformerMotor2D._GetFrameCount(_properties[property.name].floatValue).ToString(); } EditorGUILayout.PropertyField(_properties[property.name], new GUIContent(string.Format("{0} ({1} Frames)", property.text, frameCount))); }
private void CheckAndDisplayTimingWarnings(Property property) { if (!_properties[property.name].hasMultipleDifferentValues && !Mathf.Approximately(_properties[property.name].floatValue / Time.fixedDeltaTime, Mathf.Round(_properties[property.name].floatValue / Time.fixedDeltaTime))) { string msg = string.Format( "'{0}' is not a multiple of the fixed time step ({1}). This results in an extra frame effectively making '{0}' {2} instead of {3}", property.text, Time.fixedDeltaTime, PlatformerMotor2D._GetFrameCount(_properties[property.name].floatValue) * Time.fixedDeltaTime, _properties[property.name].floatValue); EditorGUILayout.HelpBox( msg, MessageType.Warning, true); } }