public RSEntityId ComponentGUIField(GUIContent inLabel, RSEntityId inValue, IRSEntityMgr inManager, System.Type inRequiredType, params GUILayoutOption[] inOptions) { int currentId = (int)inValue; int nextId = EditorGUILayout.DelayedIntField(inLabel, currentId, inOptions); return(new RSEntityId(nextId)); }
internal RSValidationContext(RSLibrary inLibrary, IRSEntityMgr inManager, IRSEntity inEntity, RSTriggerInfo inTrigger, RSParameterInfo inParameterInfo) { Library = inLibrary; Manager = inManager; Entity = inEntity; Trigger = inTrigger; Parameter = inParameterInfo; }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { IRSEntityMgr manager = null; RSEditorUtility.EditorPlugin.TryGetEntityManager(property.serializedObject.targetObject, out manager); label = EditorGUI.BeginProperty(position, label, property); { SerializedProperty value = property.FindPropertyRelative("m_Value"); RSEntityId newId = RSEditorUtility.EditorPlugin.EntityIdGUIField(position, label, new RSEntityId(value.intValue), manager); value.intValue = (int)newId; } EditorGUI.EndProperty(); }
private void RegenContext(bool inbForce = false) { if (!inbForce && Event.current.type != EventType.Layout) { return; } m_SelfUndoTarget = new UndoTarget(this, "RuleTableEditor"); m_TargetState.Refresh(); if (m_TargetState.SelectedObject == null) { m_TargetState.Clear(); m_SelectionState.ClearAll(); return; } if (m_TargetState.SelectedObject != null && m_SelectionState.Source == null) { IRSRuleTableSource tableSource; if (!RSEditorUtility.EditorPlugin.TryGetRuleTable(m_TargetState.SelectedObject, out tableSource)) { m_TargetState.Clear(); m_SelectionState.ClearAll(); return; } if (tableSource.TableData == null) { m_TargetState.Clear(); m_SelectionState.ClearAll(); return; } m_SelectionState.Source = tableSource; m_SelectionState.Table = tableSource.TableData; bool bCleanUpChanged = TableUtils.CleanUp(tableSource.TableData); if (bCleanUpChanged) { m_TargetState.UndoTarget.MarkDirtyWithoutUndo("Cleaned up Rule Table data"); } } m_SelectionState.Refresh(); m_Context = m_Context.WithLibrary(RSEditorUtility.EditorPlugin.Library); IRSEntity entity = null; if (m_TargetState.SelectedObject) { RSEditorUtility.EditorPlugin.TryGetEntity(m_TargetState.SelectedObject, out entity); } m_Context = m_Context.WithEntity(entity); IRSEntityMgr manager = null; if (manager == null || m_TargetState.SelectedObject) { RSEditorUtility.EditorPlugin.TryGetEntityManager(m_TargetState.SelectedObject, out manager); } m_Context = m_Context.WithManager(manager); }
public bool TryGetEntityManager(Scene inScene, out IRSEntityMgr outManager) { outManager = null; return(false); }
public bool TryGetEntityManager(Object inObject, out IRSEntityMgr outManager) { outManager = null; return(false); }
public RSEntityId ComponentGUIField(Rect inPosition, GUIContent inLabel, RSEntityId inValue, IRSEntityMgr inManager, System.Type inRequiredType) { int currentId = (int)inValue; int nextId = EditorGUI.DelayedIntField(inPosition, inLabel, currentId); return(new RSEntityId(nextId)); }
public RSEntityId EntityIdGUIField(Rect inPosition, GUIContent inLabel, RSEntityId inValue, IRSEntityMgr inManager) { int currentId = (int)inValue; int nextId = EditorGUI.DelayedIntField(inPosition, inLabel, currentId); return(new RSEntityId(nextId)); }
public RSValidationContext WithManager(IRSEntityMgr inManager) { return(new RSValidationContext(Library, inManager, Entity, Trigger, Parameter)); }