private bool RenderBooleanPropertyGroup(ProfileGroupDefinition def) { EditorGUILayout.BeginHorizontal(); BoolKeyframeGroup group = m_Profile.GetGroup <BoolKeyframeGroup>(def.propertyKey); EditorGUILayout.PrefixLabel(new GUIContent(group.name, def.tooltip)); bool valueChanged = false; if (m_Profile.IsManagedByTimeline(def.propertyKey)) { RenderManagedOnTimlineMessage(); } else { BoolKeyframe frame = group.GetKeyframe(0); EditorGUI.BeginChangeCheck(); bool assignedValue = EditorGUILayout.Toggle(frame.value); if (EditorGUI.EndChangeCheck()) { Undo.RecordObject(m_Profile, "Changed bool keyframe value"); frame.value = assignedValue; valueChanged = true; } } EditorGUILayout.EndHorizontal(); return(valueChanged); }
public bool GetBoolPropertyValue(string propertyKey, float timeOfDay) { BoolKeyframeGroup group = GetGroup <BoolKeyframeGroup>(propertyKey); if (group == null) { Debug.LogError("Can't find boolean group with property key: " + propertyKey); return(false); } return(group.BoolForTime(timeOfDay)); }
private void AddBooleanGroup(string propKey, string groupName, bool value) { BoolKeyframeGroup group = new BoolKeyframeGroup(groupName, new BoolKeyframe(0, value)); keyframeGroups[propKey] = group; }