Merge savya: drop Paper feature, native-only gallery, scripts inventory
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,6 @@ namespace Darkmatter.Core.Contracts.Services.Gallery
|
|||||||
{
|
{
|
||||||
public interface IGalleryService
|
public interface IGalleryService
|
||||||
{
|
{
|
||||||
void SaveImageAsync(Texture2D sprite, string fileName);
|
UniTask SaveImageAsync(Texture2D sprite, string fileName, string albumName = "Colorbook");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
using System;
|
||||||
|
using Cysharp.Threading.Tasks;
|
||||||
using Darkmatter.Core.Contracts.Services.Gallery;
|
using Darkmatter.Core.Contracts.Services.Gallery;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
@@ -5,9 +7,33 @@ namespace Darkmatter.Services.Gallery
|
|||||||
{
|
{
|
||||||
public class GalleryService : IGalleryService
|
public class GalleryService : IGalleryService
|
||||||
{
|
{
|
||||||
public void SaveImageAsync(Texture2D image, string fileName)
|
public async UniTask SaveImageAsync(Texture2D image, string fileName, string albumName = "Colorbook")
|
||||||
{
|
{
|
||||||
NativeGallery.SaveImageToGallery(image, "ColorBook", fileName);
|
var permission = await NativeGallery.RequestPermissionAsync(NativeGallery.PermissionType.Write,
|
||||||
|
NativeGallery.MediaType.Image);
|
||||||
|
|
||||||
|
if (permission != NativeGallery.Permission.Granted)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var tcs = new UniTaskCompletionSource();
|
||||||
|
|
||||||
|
NativeGallery.SaveImageToGallery(image, albumName,
|
||||||
|
filename: $"colorbook_{DateTime.UtcNow:yyyyMMdd_HHmmss}.png", callback: (success, path) =>
|
||||||
|
{
|
||||||
|
if (!success)
|
||||||
|
{
|
||||||
|
Debug.LogError("Failed to save image to gallery.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Log($"Image saved to gallery at: {path}");
|
||||||
|
}
|
||||||
|
tcs.TrySetResult();
|
||||||
|
});
|
||||||
|
|
||||||
|
await tcs.Task;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -198,90 +198,6 @@ Transform:
|
|||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1 &619394800
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 619394802}
|
|
||||||
- component: {fileID: 619394801}
|
|
||||||
m_Layer: 0
|
|
||||||
m_Name: Global Light 2D
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!114 &619394801
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 619394800}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 073797afb82c5a1438f328866b10b3f0, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
m_ComponentVersion: 2
|
|
||||||
m_LightType: 4
|
|
||||||
m_BlendStyleIndex: 0
|
|
||||||
m_FalloffIntensity: 0.5
|
|
||||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
|
||||||
m_Intensity: 1
|
|
||||||
m_LightVolumeIntensity: 1
|
|
||||||
m_LightVolumeEnabled: 0
|
|
||||||
m_ApplyToSortingLayers: 00000000
|
|
||||||
m_LightCookieSprite: {fileID: 0}
|
|
||||||
m_DeprecatedPointLightCookieSprite: {fileID: 0}
|
|
||||||
m_LightOrder: 0
|
|
||||||
m_AlphaBlendOnOverlap: 0
|
|
||||||
m_OverlapOperation: 0
|
|
||||||
m_NormalMapDistance: 3
|
|
||||||
m_NormalMapQuality: 2
|
|
||||||
m_UseNormalMap: 0
|
|
||||||
m_ShadowsEnabled: 0
|
|
||||||
m_ShadowIntensity: 0.75
|
|
||||||
m_ShadowSoftness: 0
|
|
||||||
m_ShadowSoftnessFalloffIntensity: 0.5
|
|
||||||
m_ShadowVolumeIntensityEnabled: 0
|
|
||||||
m_ShadowVolumeIntensity: 0.75
|
|
||||||
m_LocalBounds:
|
|
||||||
m_Center: {x: 0, y: -0.00000011920929, z: 0}
|
|
||||||
m_Extent: {x: 0.9985302, y: 0.99853027, z: 0}
|
|
||||||
m_PointLightInnerAngle: 360
|
|
||||||
m_PointLightOuterAngle: 360
|
|
||||||
m_PointLightInnerRadius: 0
|
|
||||||
m_PointLightOuterRadius: 1
|
|
||||||
m_ShapeLightParametricSides: 5
|
|
||||||
m_ShapeLightParametricAngleOffset: 0
|
|
||||||
m_ShapeLightParametricRadius: 1
|
|
||||||
m_ShapeLightFalloffSize: 0.5
|
|
||||||
m_ShapeLightFalloffOffset: {x: 0, y: 0}
|
|
||||||
m_ShapePath:
|
|
||||||
- {x: -0.5, y: -0.5, z: 0}
|
|
||||||
- {x: 0.5, y: -0.5, z: 0}
|
|
||||||
- {x: 0.5, y: 0.5, z: 0}
|
|
||||||
- {x: -0.5, y: 0.5, z: 0}
|
|
||||||
--- !u!4 &619394802
|
|
||||||
Transform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 619394800}
|
|
||||||
serializedVersion: 2
|
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
|
||||||
m_ConstrainProportionsScale: 0
|
|
||||||
m_Children: []
|
|
||||||
m_Father: {fileID: 0}
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
--- !u!1 &1224714931
|
--- !u!1 &1224714931
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -422,9 +338,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: ef7eaa67fc66d48c88c8ec12d27f9b14, type: 3}
|
m_Script: {fileID: 11500000, guid: ef7eaa67fc66d48c88c8ec12d27f9b14, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier: Features.PaperRig::Darkmatter.Features.PaperRig.PaperRigServiceModule
|
m_EditorClassIdentifier: Features.PaperRig::Darkmatter.Features.PaperRig.PaperRigServiceModule
|
||||||
paperRig:
|
paperRig: {artCamera: {fileID: 0}, displayRect: {fileID: 0}}
|
||||||
artCamera: {fileID: 0}
|
|
||||||
displayRect: {fileID: 0}
|
|
||||||
--- !u!1 &1965442262
|
--- !u!1 &1965442262
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -526,7 +440,7 @@ Canvas:
|
|||||||
m_GameObject: {fileID: 2069155637}
|
m_GameObject: {fileID: 2069155637}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_RenderMode: 1
|
m_RenderMode: 0
|
||||||
m_Camera: {fileID: 0}
|
m_Camera: {fileID: 0}
|
||||||
m_PlaneDistance: 100
|
m_PlaneDistance: 100
|
||||||
m_PixelPerfect: 0
|
m_PixelPerfect: 0
|
||||||
@@ -564,7 +478,6 @@ RectTransform:
|
|||||||
SceneRoots:
|
SceneRoots:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_Roots:
|
m_Roots:
|
||||||
- {fileID: 619394802}
|
|
||||||
- {fileID: 2069155641}
|
- {fileID: 2069155641}
|
||||||
- {fileID: 590523275}
|
- {fileID: 590523275}
|
||||||
- {fileID: 1224714932}
|
- {fileID: 1224714932}
|
||||||
|
|||||||
BIN
Readme.docx
Normal file
BIN
Readme.docx
Normal file
Binary file not shown.
Reference in New Issue
Block a user