public override void OnInspectorGUI() { __target = (SetBindingVariable)target; base.OnInspectorGUI(); if (GUILayout.Button("Select RequestText Set Target")) { DataBindingView.GetWindow().Show(); DataBindingView.OnCopy = (s) => { __target.requestText = s; }; } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); if (__target == null) { __target = (DeepBindingBehavior)target; } if (GUILayout.Button("Select RequestText Listen Target")) { DataBindingView.GetWindow().Show(); DataBindingView.OnCopy = (s) => { __target.requestText = "{" + s + "}"; }; } if (__target.variables != null) { var s = __target.requestText; foreach (var item in __target.variables.variable) { s = s.Replace($"{{$.{item.name}}}", item.value); } EditorGUILayout.LabelField("=> " + s); } if (EditorApplication.isPlaying && __target.deepBinder != null && __target.deepBinder.process != null) { EditorGUILayout.LabelField("Runtime 解析 : "); EditorGUILayout.LabelField(__target.trueRequestText); EditorGUI.indentLevel++; EditorGUILayout.BeginVertical(); foreach (var p in __target.deepBinder.process) { EditorGUILayout.LabelField(p.request, p.DebugString()); EditorGUI.indentLevel++; EditorGUILayout.LabelField(p.tmpResult); EditorGUI.indentLevel--; } EditorGUILayout.EndVertical(); EditorGUI.indentLevel--; } if (EditorApplication.isPlaying && GUILayout.Button("Reload")) { __target.ReBuildTrueRequestPath(); } }
protected override void RowGUI(RowGUIArgs args) { var item = (TreeViewItem <BindingTreeElement>)args.item; Rect cellRect = args.GetCellRect(0); CenterRectUsingSingleLineHeight(ref cellRect); base.RowGUI(args); cellRect = args.GetCellRect(1); CenterRectUsingSingleLineHeight(ref cellRect); if (DataBindingView.OnCopy != null) { if (GUI.Button(cellRect, s_TestIcons[3])) { DataBindingView.OnCopy(item.data.name); DataBindingView.OnCopy = null; } return; } if (!EditorApplication.isPlaying) { return; } GUI.Label(cellRect, item.data.DataSource); cellRect = args.GetCellRect(2); CenterRectUsingSingleLineHeight(ref cellRect); //CenterRectUsingSingleLineHeight(ref cellRect); if (!item.data.hasSource) { GUI.DrawTexture(cellRect, s_TestIcons[1], ScaleMode.ScaleToFit); } else if (item.data.dataPair.IsBindingProperty) { GUI.DrawTexture(cellRect, s_TestIcons[2], ScaleMode.ScaleToFit); } else { GUI.DrawTexture(cellRect, s_TestIcons[0], ScaleMode.ScaleToFit); } GUI.DrawTexture(args.GetCellRect(3), item.data.hasObserver ? s_TestIcons[2] : s_TestIcons[1], ScaleMode.ScaleToFit); GUI.Label(args.GetCellRect(4), item.data.type); }