- Notion 관련 코드 제거: - NotionBackgroundSync.cs 삭제 - NotionSyncSettings.cs → BackgroundSyncSettings.cs 이름 변경 - 웹사이트 API 연동 기능 추가: - WebsiteBackgroundExporter.cs: HTTP POST로 배경 데이터 업로드 - BackgroundSyncSettings.cs: API 엔드포인트 및 Git URL 설정 - BackgroundThumbnailCapture.cs 수정: - 새 설정 클래스 참조로 변경 - Notion 자동 동기화 코드 제거 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
75 lines
2.8 KiB
C#
75 lines
2.8 KiB
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace Streamingle.Background.Editor
|
|
{
|
|
/// <summary>
|
|
/// 배경 동기화 설정을 저장하는 ScriptableObject
|
|
/// </summary>
|
|
[CreateAssetMenu(fileName = "BackgroundSyncSettings", menuName = "Streamingle/Background Sync Settings")]
|
|
public class BackgroundSyncSettings : ScriptableObject
|
|
{
|
|
[Header("웹사이트 API 설정")]
|
|
[Tooltip("배경 API 엔드포인트 URL (예: https://minglestudio.co.kr/api/backgrounds)")]
|
|
public string apiEndpoint = "https://minglestudio.co.kr/api/backgrounds";
|
|
|
|
[Tooltip("API 인증 키 (선택사항)")]
|
|
public string apiKey = "";
|
|
|
|
[Header("Git 설정 (썸네일 URL용)")]
|
|
[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 int thumbnailWidth = 1920;
|
|
|
|
[Tooltip("썸네일 높이 (16:9 비율)")]
|
|
public int thumbnailHeight = 1080;
|
|
|
|
[Header("동기화 설정")]
|
|
[Tooltip("썸네일 캡처 시 자동 동기화")]
|
|
public bool autoSyncOnCapture = false;
|
|
|
|
[Header("웹사이트 설정")]
|
|
[Tooltip("배경 페이지 URL (브라우저에서 열기용)")]
|
|
public string websiteUrl = "https://minglestudio.co.kr/backgrounds";
|
|
|
|
/// <summary>
|
|
/// Git Media 파일 URL 생성 (Gitea 형식)
|
|
/// </summary>
|
|
public string GetGitRawUrl(string assetPath)
|
|
{
|
|
// Assets/ResourcesData/Background/... 형식의 경로를 Git Media URL로 변환
|
|
// Gitea Media URL 형식: {serverUrl}/{repoPath}/media/branch/{branch}/{filePath}
|
|
string relativePath = assetPath.Replace("\\", "/");
|
|
|
|
// 경로의 각 세그먼트를 URL 인코딩 (슬래시는 유지)
|
|
string[] segments = relativePath.Split('/');
|
|
for (int i = 0; i < segments.Length; i++)
|
|
{
|
|
segments[i] = Uri.EscapeDataString(segments[i]);
|
|
}
|
|
string encodedPath = string.Join("/", segments);
|
|
|
|
return $"{gitServerUrl}/{gitRepoPath}/media/branch/{gitBranch}/{encodedPath}";
|
|
}
|
|
|
|
/// <summary>
|
|
/// API 설정이 유효한지 확인
|
|
/// </summary>
|
|
public bool IsValid()
|
|
{
|
|
return !string.IsNullOrEmpty(apiEndpoint) &&
|
|
!string.IsNullOrEmpty(gitServerUrl) &&
|
|
!string.IsNullOrEmpty(gitRepoPath);
|
|
}
|
|
}
|
|
}
|