Minor fixes
This commit is contained in:
@@ -8,6 +8,5 @@ namespace Darkmatter.Core.Contracts.Features.GameplayFlow
|
||||
UniTask BackAsync(CancellationToken cancellationToken);
|
||||
UniTask SaveAsync(CancellationToken cancellationToken);
|
||||
UniTask NextAsync(CancellationToken cancellationToken);
|
||||
void OnApplicationPaused();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 683c2f491e8042d0a46bb7b5ad497be3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,26 +0,0 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using Darkmatter.Core.Data.Dynamic.Services.Ads;
|
||||
using Darkmatter.Core.Enums.Services.Ads;
|
||||
|
||||
namespace Darkmatter.Core.Contracts.Services.Ads
|
||||
{
|
||||
public interface IAdService
|
||||
{
|
||||
bool IsInitialized { get; }
|
||||
event Action<AdFormat, AdLoadState> LoadStateChanged;
|
||||
|
||||
UniTask InitializeAsync(CancellationToken cancellationToken);
|
||||
|
||||
UniTask<bool> LoadAsync(AdFormat format, CancellationToken cancellationToken);
|
||||
bool IsReady(AdFormat format);
|
||||
UniTask<AdShowResult> ShowAsync(AdFormat format, CancellationToken cancellationToken);
|
||||
|
||||
UniTask<bool> ShowBannerAsync(BannerSize size, BannerPosition position, CancellationToken cancellationToken);
|
||||
void HideBanner();
|
||||
void DestroyBanner();
|
||||
|
||||
void SetConsent(bool hasUserConsent, bool isChildDirected);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ffaede2f106c45a68197d70ec929c7de
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4dcdb224825b4764a080e5b881b996e4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,67 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Darkmatter.Core.Enums.Services.Ads;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Darkmatter.Core.Data.Static.Services.Ads
|
||||
{
|
||||
[CreateAssetMenu(fileName = "AdUnitCatalog", menuName = "Darkmatter/Ads/Ad Unit Catalog")]
|
||||
public class AdUnitCatalogSO : ScriptableObject
|
||||
{
|
||||
[Serializable]
|
||||
public class Entry
|
||||
{
|
||||
public AdFormat Format;
|
||||
public string AndroidUnitId;
|
||||
public string IosUnitId;
|
||||
}
|
||||
|
||||
[Header("App IDs")]
|
||||
[SerializeField] private string androidAppId;
|
||||
[SerializeField] private string iosAppId;
|
||||
|
||||
[Header("Test Mode")]
|
||||
[Tooltip("If true, returns Google sample ad unit IDs (safe for development).")]
|
||||
[SerializeField] private bool useTestUnits = true;
|
||||
|
||||
[Tooltip("Device IDs to treat as test devices (hashed IDs from logcat).")]
|
||||
[SerializeField] private List<string> testDeviceIds = new();
|
||||
|
||||
[Header("Production Unit IDs")]
|
||||
[SerializeField] private List<Entry> entries = new();
|
||||
|
||||
public string AndroidAppId => androidAppId;
|
||||
public string IosAppId => iosAppId;
|
||||
public bool UseTestUnits => useTestUnits;
|
||||
public IReadOnlyList<string> TestDeviceIds => testDeviceIds;
|
||||
|
||||
public string GetUnitId(AdFormat format, RuntimePlatform platform)
|
||||
{
|
||||
if (useTestUnits)
|
||||
{
|
||||
return GetTestUnitId(format, platform);
|
||||
}
|
||||
|
||||
foreach (var e in entries)
|
||||
{
|
||||
if (e == null || e.Format != format) continue;
|
||||
return platform == RuntimePlatform.IPhonePlayer ? e.IosUnitId : e.AndroidUnitId;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static string GetTestUnitId(AdFormat format, RuntimePlatform platform)
|
||||
{
|
||||
bool ios = platform == RuntimePlatform.IPhonePlayer;
|
||||
return format switch
|
||||
{
|
||||
AdFormat.Banner => ios ? "ca-app-pub-3940256099942544/2934735716" : "ca-app-pub-3940256099942544/6300978111",
|
||||
AdFormat.Interstitial => ios ? "ca-app-pub-3940256099942544/4411468910" : "ca-app-pub-3940256099942544/1033173712",
|
||||
AdFormat.Rewarded => ios ? "ca-app-pub-3940256099942544/1712485313" : "ca-app-pub-3940256099942544/5224354917",
|
||||
AdFormat.RewardedInterstitial => ios ? "ca-app-pub-3940256099942544/6978759866" : "ca-app-pub-3940256099942544/5354046379",
|
||||
AdFormat.AppOpen => ios ? "ca-app-pub-3940256099942544/5575463023" : "ca-app-pub-3940256099942544/9257395921",
|
||||
_ => null
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e6352f0162df4adf99a5945e25c6bf40
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 40846ca6e71249d68a99e1d226fd162d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,11 +0,0 @@
|
||||
namespace Darkmatter.Core.Enums.Services.Ads
|
||||
{
|
||||
public enum AdFormat
|
||||
{
|
||||
Banner,
|
||||
Interstitial,
|
||||
Rewarded,
|
||||
RewardedInterstitial,
|
||||
AppOpen
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce1e736d19fc4569af80b06274dc3935
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,10 +0,0 @@
|
||||
namespace Darkmatter.Core.Enums.Services.Ads
|
||||
{
|
||||
public enum AdLoadState
|
||||
{
|
||||
Idle,
|
||||
Loading,
|
||||
Loaded,
|
||||
Failed
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 44f09c3955b34814abfa83407118a6a5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,13 +0,0 @@
|
||||
namespace Darkmatter.Core.Enums.Services.Ads
|
||||
{
|
||||
public enum BannerPosition
|
||||
{
|
||||
Top,
|
||||
Bottom,
|
||||
TopLeft,
|
||||
TopRight,
|
||||
BottomLeft,
|
||||
BottomRight,
|
||||
Center
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2223e7f2cedb4f479f7c6722e0ca7fd1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,13 +0,0 @@
|
||||
namespace Darkmatter.Core.Enums.Services.Ads
|
||||
{
|
||||
public enum BannerSize
|
||||
{
|
||||
Banner,
|
||||
LargeBanner,
|
||||
MediumRectangle,
|
||||
FullBanner,
|
||||
Leaderboard,
|
||||
SmartBanner,
|
||||
AnchoredAdaptive
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 570a6e9b47c5451c8ef78aa7a3923ead
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -9,7 +9,6 @@ using Darkmatter.Core.Contracts.Features.GameplayFlow;
|
||||
using Darkmatter.Core.Contracts.Features.Loading;
|
||||
using Darkmatter.Core.Contracts.Features.Progression;
|
||||
using Darkmatter.Core.Contracts.Features.ShapeBuilder;
|
||||
using Darkmatter.Core.Contracts.Services.Gallery;
|
||||
using Darkmatter.Core.Contracts.Services.Scenes;
|
||||
using Darkmatter.Core.Data.Dynamic.Features.Progression;
|
||||
using Darkmatter.Core.Data.Signals.Features.Coloring;
|
||||
@@ -92,9 +91,6 @@ namespace Darkmatter.Features.GameplayFlow.Systems
|
||||
_colorAppliedSub = _bus.Subscribe<ColorAppliedSignal>(OnColorApplied);
|
||||
_drawingSelectedSub = _bus.Subscribe<DrawingSelectedSignal>(OnDrawingSelected);
|
||||
|
||||
Application.quitting += OnAppQuitting;
|
||||
Application.focusChanged += OnAppFocusChanged;
|
||||
|
||||
_loadingScreen.SetProgress(1f);
|
||||
if (_phase == DrawingPhase.Coloring)
|
||||
{
|
||||
@@ -151,17 +147,6 @@ namespace Darkmatter.Features.GameplayFlow.Systems
|
||||
_bus.Publish(new DrawingSelectedSignal(nextId));
|
||||
}
|
||||
|
||||
public void OnApplicationPaused()
|
||||
{
|
||||
SaveCurrentAsync(CancellationToken.None).Forget();
|
||||
}
|
||||
|
||||
private void OnAppQuitting() => OnApplicationPaused();
|
||||
|
||||
private void OnAppFocusChanged(bool focused)
|
||||
{
|
||||
if (!focused) OnApplicationPaused();
|
||||
}
|
||||
|
||||
private void OnShapeAssembled(ShapeAssembledSignal signal)
|
||||
{
|
||||
@@ -261,8 +246,6 @@ namespace Darkmatter.Features.GameplayFlow.Systems
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Application.quitting -= OnAppQuitting;
|
||||
Application.focusChanged -= OnAppFocusChanged;
|
||||
|
||||
_assembledSub?.Dispose();
|
||||
_colorAppliedSub?.Dispose();
|
||||
|
||||
@@ -17,7 +17,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5338333684312430304
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -131,15 +131,15 @@ PrefabInstance:
|
||||
m_Modifications:
|
||||
- target: {fileID: 1825175764228994942, guid: ed3abc5b1c6bc43938850705ab3e4d4b, type: 3}
|
||||
propertyPath: m_Color.b
|
||||
value: 0.2474635
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1825175764228994942, guid: ed3abc5b1c6bc43938850705ab3e4d4b, type: 3}
|
||||
propertyPath: m_Color.g
|
||||
value: 0.2474635
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1825175764228994942, guid: ed3abc5b1c6bc43938850705ab3e4d4b, type: 3}
|
||||
propertyPath: m_Color.r
|
||||
value: 0.7830189
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3648889831887995107, guid: ed3abc5b1c6bc43938850705ab3e4d4b, type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
|
||||
Reference in New Issue
Block a user