user 17a9f57d59 Feat: Notion 배경 동기화 시스템 및 배경 씬 로더 개선
- Notion 동기화 기능 추가:
  - NotionSyncSettings.cs: Notion API 설정 ScriptableObject
  - NotionBackgroundSync.cs: Notion API 연동 및 동기화 윈도우
  - 배경 씬 정보를 Notion 데이터베이스에 자동 동기화
  - Git Raw URL을 통한 썸네일 이미지 연동
  - Git 커밋 상태 확인 및 경고 표시

- 배경 씬 로더 버그 수정:
  - 리컴파일 후 배경 씬 중복 로드 문제 해결
  - OnFocus 콜백으로 상태 동기화 강화
  - 중복 씬 자동 감지 및 언로드

- 썸네일 캡처 개선:
  - 기본 해상도 1920x1080 (16:9)
  - 에디터에서 1:1 중앙 크롭 표시
  - 캡처 후 자동 Notion 동기화 옵션

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 01:25:19 +09:00

77 lines
2.9 KiB
C#

using UnityEngine;
namespace Streamingle.Background.Editor
{
/// <summary>
/// Notion 동기화 설정을 저장하는 ScriptableObject
/// </summary>
[CreateAssetMenu(fileName = "NotionSyncSettings", menuName = "Streamingle/Notion Sync Settings")]
public class NotionSyncSettings : ScriptableObject
{
[Header("Notion API 설정")]
[Tooltip("Notion Integration Token (ntn_xxx... 또는 secret_xxx...)")]
public string notionApiToken = "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";
[Tooltip("Notion Database ID (32자리 hex) - 배경 일람")]
public string notionDatabaseId = "25ea7d46b958805f88fcf127979934bf";
[Header("Git 설정")]
[Tooltip("Git 서버 URL (예: https://kindnick-git.duckdns.org)")]
public string gitServerUrl = "https://kindnick-git.duckdns.org";
[Tooltip("Git 리포지토리 경로 (예: kindnick/Streamingle_URP)")]
public string gitRepoPath = "kindnick/Streamingle_URP";
[Tooltip("Git 브랜치 (예: main)")]
public string gitBranch = "main";
[Header("동기화 설정")]
[Tooltip("썸네일 캡처 시 자동 동기화")]
public bool autoSyncOnCapture = false;
[Tooltip("배경 씬 로드 시 사용 이력 기록")]
public bool trackUsageHistory = true;
[Header("썸네일 설정")]
[Tooltip("썸네일 너비")]
public int thumbnailWidth = 1920;
[Tooltip("썸네일 높이 (16:9 비율)")]
public int thumbnailHeight = 1080;
/// <summary>
/// Git Raw 파일 URL 생성 (Gitea/Gogs 형식)
/// </summary>
public string GetGitRawUrl(string assetPath)
{
// Assets/ResourcesData/Background/... 형식의 경로를 Git Raw URL로 변환
// Gitea Raw URL 형식: {serverUrl}/{repoPath}/raw/branch/{branch}/{filePath}
string relativePath = assetPath.Replace("\\", "/");
return $"{gitServerUrl}/{gitRepoPath}/raw/branch/{gitBranch}/{relativePath}";
}
/// <summary>
/// 설정이 유효한지 확인
/// </summary>
public bool IsValid()
{
return !string.IsNullOrEmpty(notionApiToken) &&
!string.IsNullOrEmpty(notionDatabaseId) &&
!string.IsNullOrEmpty(gitServerUrl) &&
!string.IsNullOrEmpty(gitRepoPath);
}
/// <summary>
/// Notion API Token이 설정되었는지 확인
/// </summary>
public bool HasNotionToken => !string.IsNullOrEmpty(notionApiToken) &&
(notionApiToken.StartsWith("secret_") || notionApiToken.StartsWith("ntn_"));
/// <summary>
/// Database ID가 유효한 형식인지 확인
/// </summary>
public bool HasValidDatabaseId => !string.IsNullOrEmpty(notionDatabaseId) && notionDatabaseId.Length >= 32;
}
}