Skip to content

UIデザインのカード型への変更とドラッグ移動およびヒエラルキー順ソートの実装 - #11

Open
tfuru wants to merge 3 commits into
mainfrom
t_furu/update-node-design
Open

UIデザインのカード型への変更とドラッグ移動およびヒエラルキー順ソートの実装#11
tfuru wants to merge 3 commits into
mainfrom
t_furu/update-node-design

Conversation

@tfuru

@tfuru tfuru commented Jun 10, 2026

Copy link
Copy Markdown

概要

CCK Process TracerのUIデザインおよび操作性を向上させるため、以下の3つの機能を実装・統合しました。

  1. モダンなカード型UIデザインへの変更
    • デザイン案に基づくカード型ノード表示。
    • GameObject境界枠の角丸化、背景の塗りつぶし、透過ボタンおよびホバー時の背景ハイライト適用。
    • キー行の表示形式を KeyName - Target, ParameterType に拡張。
    • 接続線の色をダークモード/ライトモードに合わせて見やすいよう太さと透明度の調整。
  2. GameObject Nameラベルのドラッグによる個別グループ移動機能
    • GameObject Nameラベルをドラッグした際に、GameObject境界枠と内部のコンポーネントノード全体が一括して個別に移動するドラッグ&ドロップ機能を実装。
    • スケールやスクロールの影響を受けないキャンバス座標でのクリック判定とドラッグ制御。
    • リセットボタン押下時のドラッグオフセットの初期化対応。
  3. ノードの並び順のヒエラルキー順ソート
    • 表示される各ノード(GameObject枠)の順序を、Unityのヒエラルキーウィンドウ上での順序と一致するように Transform.GetSiblingIndex() を用いた厳密なソート処理を追加。

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

CCK Process Tracer のEditorWindow上の可視化UIをカード型デザインへ刷新し、フレーム(GameObject)単位のドラッグ移動と、Unityヒエラルキー順に合わせた表示順ソートを追加するPRです。

Changes:

  • ノード/フレーム描画を丸角カード型に変更し、線の太さ・色をスキンに合わせて調整
  • GameObject名ラベルのドラッグでフレーム+配下ノードを一括移動(キャンバス座標変換も追加)
  • Transform.GetSiblingIndex() ベースでProcessObject表示順をヒエラルキー順にソート

Reviewed changes

Copilot reviewed 19 out of 27 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
Penpot/ui-design.png.meta UIデザイン素材のUnity meta追加
Penpot/README.md.meta Penpot用READMEのUnity meta追加
Penpot/README.md Penpot開発環境メモの追加
Penpot/CCKProcessTracer.penpot.meta PenpotファイルのUnity meta追加
Penpot.meta PenpotフォルダのUnity meta追加
Editor/View.cs Screen→Canvas座標変換API追加
Editor/ProcessObject/ProcessObjectsAligner.cs フレーム配置にドラッグオフセットを反映
Editor/ProcessObject/ProcessObjectFactory.cs ProcessObjectをヒエラルキー順にソート
Editor/ProcessObject/ProcessObject.cs ProcessObjectにドラッグオフセット保持を追加
Editor/Node/TriggerNode.cs TriggerNodeのカード矩形(rect)設定と表示名拡張反映
Editor/Node/NodeFactory.cs TriggerParamのParameterTypeをKeyへ設定
Editor/Node/NodeDragController.cs.meta 新規ファイルmeta追加
Editor/Node/NodeDragController.cs フレーム名ラベルのドラッグ移動制御を追加
Editor/Node/Node.cs Nodeに描画用rect等を追加
Editor/Node/Key.cs Key表示名拡張(Target/ParameterType)
Editor/Node/GimmickNode.cs GimmickNodeのカード矩形(rect)設定
Editor/Draw/ObjectFrameDrawer.cs フレーム描画を丸角塗り+枠線へ刷新
Editor/Draw/ObjectFrame.cs nameButtonRectを保持してドラッグ判定に利用
Editor/Draw/NodeDrawer.cs.meta 新規ファイルmeta追加
Editor/Draw/NodeDrawer.cs ノードのカード背景/枠線/区切り線描画を追加
Editor/Draw/LineDrawer.cs AAポリライン+太さ指定に対応
Editor/Draw/DrawManager.cs 描画順をフレーム→ノード→矢印→ボタンに変更
Editor/Draw/ButtonDrawer.cs ボタンのスタイル/ホバー背景等のUI調整
Editor/Draw/ArrowDrawer.cs ダーク/ライトテーマ別の線色・太さに対応
Editor/CCKProcessTracer.cs OnGUIでドラッグ制御呼び出し、ResetViewでdragOffset初期化
Files not reviewed (6)
  • Editor/Draw/NodeDrawer.cs.meta: Generated file
  • Editor/Node/NodeDragController.cs.meta: Generated file
  • Penpot.meta: Generated file
  • Penpot/CCKProcessTracer.penpot.meta: Generated file
  • Penpot/README.md.meta: Generated file
  • Penpot/ui-design.png.meta: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Editor/Node/Key.cs
vector3Type,
}
public List<Node> afterNodes = new List<Node>();
public List<Node> afterNodes = new List<Node>();
Comment thread Editor/Node/Node.cs
Comment on lines 22 to 27
public const float verticalNodeInterval = 20f;
public Vector2 arrowReceivePosition;
public Rect rect;
public Vector2 dragOffset;

public GimmickNode childGimmickNode;
Comment thread Editor/Draw/NodeDrawer.cs
Comment on lines +33 to +36
// ヘッダー下部の境界線
float nameHeight = 50f; // Node.nameHeight の実値
float scaledHeaderHeight = nameHeight * View.scale;
float borderY = scaledRect.yMin + scaledHeaderHeight;
Comment thread Editor/Draw/NodeDrawer.cs
Comment on lines +44 to +49
if (node is TriggerNode triggerNode)
{
float keyHeight = 25f; // Node.keyHeight の実値
for (int i = 0; i < triggerNode.useKeys.Count; i++)
{
float keyBorderY = borderY + (keyHeight * (i + 1)) * View.scale;
Comment thread Penpot/README.md
ローカル環境で Penpot インスタンスを起動するには、以下のコマンドを実行します。

```bash
cd /Volumes/SSD/work/Penpot
Comment on lines +1 to +4
using UnityEngine;
using UnityEditor;

namespace CCKProcessTracer.Editor
Comment on lines +32 to +37
var style = new GUIStyle();
style.alignment = TextAnchor.MiddleLeft;
style.padding = new RectOffset((int)(10 * View.scale), (int)(10 * View.scale), 0, 0);
style.fontSize = (int)(12 * View.scale);
if (style.fontSize < 8) style.fontSize = 8;

Comment on lines 17 to +25
foreach (var f in objectFrames)
{
if (!KeyFilter.IsFrameVisible(f.processObject))
continue;

Handles.color = Color.gray;
Vector2 upLeft = View.ProcessViewPosition(new Vector2(f.rect.xMin, f.rect.yMin));
Vector2 downRight = View.ProcessViewPosition(new Vector2(f.rect.xMax, f.rect.yMax));

Vector3 upLeft = View.ProcessViewPosition(new Vector2(f.rect.xMin, f.rect.yMin));
Vector3 upRight = View.ProcessViewPosition(new Vector2(f.rect.xMax, f.rect.yMin));
Vector3 downRight = View.ProcessViewPosition(new Vector2(f.rect.xMax, f.rect.yMax));
Vector3 downLeft = View.ProcessViewPosition(new Vector2(f.rect.xMin, f.rect.yMax));
Rect scaledRect = new Rect(upLeft.x, upLeft.y, downRight.x - upLeft.x, downRight.y - upLeft.y);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants