From 476102df914b012a9ed81bd57c1152e18491576a Mon Sep 17 00:00:00 2001 From: Foldcc_b1 Date: Tue, 10 Jan 2023 18:03:30 +0800 Subject: [PATCH] update --- CHANGELOG.md | 9 + CHANGELOG.md.meta | 7 + Runtime.meta | 8 + Runtime/ADAggregator.meta | 8 + Runtime/ADAggregator/ADConfig.cs | 33 +++ Runtime/ADAggregator/ADConfig.cs.meta | 3 + Runtime/ADAggregator/ADListener.cs | 36 +++ Runtime/ADAggregator/ADListener.cs.meta | 11 + Runtime/ADAggregator/ADManager.cs | 260 ++++++++++++++++++ Runtime/ADAggregator/ADManager.cs.meta | 11 + Runtime/ADAggregator/ADPlayer.cs | 47 ++++ Runtime/ADAggregator/ADPlayer.cs.meta | 11 + Runtime/ADAggregator/AD_Type.cs | 12 + Runtime/ADAggregator/AD_Type.cs.meta | 3 + Runtime/ADAggregator/AdTimeHandler.cs | 78 ++++++ Runtime/ADAggregator/AdTimeHandler.cs.meta | 3 + Runtime/ADAggregator/AsyncAdPlayer.cs | 138 ++++++++++ Runtime/ADAggregator/AsyncAdPlayer.cs.meta | 11 + Runtime/ADAggregator/IAdController.cs | 10 + Runtime/ADAggregator/IAdController.cs.meta | 3 + .../ADAggregator/Runtime.Adaggregator.asmdef | 3 + .../Runtime.Adaggregator.asmdef.meta | 7 + Scenes.meta | 8 + Scenes/Sample-AdConfig.asset | 28 ++ Scenes/Sample-AdConfig.asset.meta | 8 + Scenes/Sample-Commercialization.unity | 208 ++++++++++++++ Scenes/Sample-Commercialization.unity.meta | 7 + package.json | 23 ++ package.json.meta | 7 + 29 files changed, 1001 insertions(+) create mode 100644 CHANGELOG.md create mode 100644 CHANGELOG.md.meta create mode 100644 Runtime.meta create mode 100644 Runtime/ADAggregator.meta create mode 100644 Runtime/ADAggregator/ADConfig.cs create mode 100644 Runtime/ADAggregator/ADConfig.cs.meta create mode 100644 Runtime/ADAggregator/ADListener.cs create mode 100644 Runtime/ADAggregator/ADListener.cs.meta create mode 100644 Runtime/ADAggregator/ADManager.cs create mode 100644 Runtime/ADAggregator/ADManager.cs.meta create mode 100644 Runtime/ADAggregator/ADPlayer.cs create mode 100644 Runtime/ADAggregator/ADPlayer.cs.meta create mode 100644 Runtime/ADAggregator/AD_Type.cs create mode 100644 Runtime/ADAggregator/AD_Type.cs.meta create mode 100644 Runtime/ADAggregator/AdTimeHandler.cs create mode 100644 Runtime/ADAggregator/AdTimeHandler.cs.meta create mode 100644 Runtime/ADAggregator/AsyncAdPlayer.cs create mode 100644 Runtime/ADAggregator/AsyncAdPlayer.cs.meta create mode 100644 Runtime/ADAggregator/IAdController.cs create mode 100644 Runtime/ADAggregator/IAdController.cs.meta create mode 100644 Runtime/ADAggregator/Runtime.Adaggregator.asmdef create mode 100644 Runtime/ADAggregator/Runtime.Adaggregator.asmdef.meta create mode 100644 Scenes.meta create mode 100644 Scenes/Sample-AdConfig.asset create mode 100644 Scenes/Sample-AdConfig.asset.meta create mode 100644 Scenes/Sample-Commercialization.unity create mode 100644 Scenes/Sample-Commercialization.unity.meta create mode 100644 package.json create mode 100644 package.json.meta diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..c1b2d24 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +# [1.0.0] + +基础版本. + +# [1.0.1] + +### 修复 + +* 优化package.json文件 diff --git a/CHANGELOG.md.meta b/CHANGELOG.md.meta new file mode 100644 index 0000000..17c6cce --- /dev/null +++ b/CHANGELOG.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fca4353ab66a48e4ebe5032dc5057c7a +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime.meta b/Runtime.meta new file mode 100644 index 0000000..e644668 --- /dev/null +++ b/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1a33fff4e384946488ff2a4a3eb977ce +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/ADAggregator.meta b/Runtime/ADAggregator.meta new file mode 100644 index 0000000..deab2d5 --- /dev/null +++ b/Runtime/ADAggregator.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 63fe00525318d834b9d86bb39ef2cb74 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/ADAggregator/ADConfig.cs b/Runtime/ADAggregator/ADConfig.cs new file mode 100644 index 0000000..aa533ae --- /dev/null +++ b/Runtime/ADAggregator/ADConfig.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace Runtime.ADAggregator +{ + [CreateAssetMenu(fileName = "AdConfig", menuName = "Commercialization/Ad_Config")] + public class ADConfig : ScriptableObject + { + public string ConfigName; + + public string Id; + + public string Key; + + public string Key2; + + public AdKeyValue BaseAwardAdKeyValue; + + public AdKeyValue BaseInteractionAdKeyValue; + + public AdKeyValue BaseSplashAdKeyValue; + + public List CommonKeyValues; + } + + [Serializable] + public class AdKeyValue + { + public string key; + public string value; + } +} \ No newline at end of file diff --git a/Runtime/ADAggregator/ADConfig.cs.meta b/Runtime/ADAggregator/ADConfig.cs.meta new file mode 100644 index 0000000..e85a152 --- /dev/null +++ b/Runtime/ADAggregator/ADConfig.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 98b31b835f394db4a51957c3f0f3ac32 +timeCreated: 1673335040 \ No newline at end of file diff --git a/Runtime/ADAggregator/ADListener.cs b/Runtime/ADAggregator/ADListener.cs new file mode 100644 index 0000000..a6987e8 --- /dev/null +++ b/Runtime/ADAggregator/ADListener.cs @@ -0,0 +1,36 @@ +using System; +// using ByteDance.Union; + +namespace Runtime.ADAggregator +{ + public class ADListener + //: IRewardAdInteractionListener + { + public Action onVideoComplete; + public Action onClose; + + public void OnAdClose() + { + onClose?.Invoke(); + onClose = null; + } + + public void OnShowError() + { + onVideoComplete?.Invoke(false); + onVideoComplete = null; + } + + public void OnShowComplete() + { + onVideoComplete?.Invoke(true); + onVideoComplete = null; + } + + public void OnRewardVerify(bool rewardVerify, int rewardAmount, string rewardName) + { + onVideoComplete?.Invoke(rewardVerify); + onVideoComplete = null; + } + } +} \ No newline at end of file diff --git a/Runtime/ADAggregator/ADListener.cs.meta b/Runtime/ADAggregator/ADListener.cs.meta new file mode 100644 index 0000000..7f3e3a5 --- /dev/null +++ b/Runtime/ADAggregator/ADListener.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 79ed6cae2aa137341a643c32f9536fbf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/ADAggregator/ADManager.cs b/Runtime/ADAggregator/ADManager.cs new file mode 100644 index 0000000..40b410b --- /dev/null +++ b/Runtime/ADAggregator/ADManager.cs @@ -0,0 +1,260 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace Runtime.ADAggregator +{ + public class ADManager : MonoBehaviour + { + private static ADManager _instance; + private static bool mIsCreate = false; + + public static ADManager Instance + { + get + { + if (_instance == null && !mIsCreate) + { + var objs = FindObjectsOfType(); + for (int i = 0; i < objs.Length; i++) + { + Destroy(objs[i]); + } + + _instance = new GameObject().AddComponent(); + _instance.name = "[GameUpdater] NoInit"; + DontDestroyOnLoad(_instance); + _instance.InitTimeSystem(); + mIsCreate = true; + } + + return _instance; + } + private set => _instance = value; + } + +#if UNITY_ANDROID + public AndroidJavaObject activityContext { get; private set; } +#endif + + /// + /// 用于记录广告位状态 0 未加载 、 1 加载中、 2 加载成功 + /// + private Dictionary AD_Dicts; + + private ADConfig _adConfig; + + private IAdController _adController; + + private AsyncAdPlayer _curAsyncPlayer; + +#pragma warning disable CS0414 + private bool _isInit = false; +#pragma warning restore CS0414 + + public void Init(Action onCallback , ADConfig adConfig , IAdController controller , params object[] args) + { + _isInit = true; + _instance.name = "[GameUpdater] Init"; + AD_Dicts = new Dictionary(); +#if UNITY_EDITOR + onCallback?.Invoke(); +#else + controller.Init(adConfig , args); + _adController = controller; + _adConfig = adConfig; + onCallback?.Invoke(); +#endif + + } + + + public bool IsRealy(AD_Type adType) + { +#if UNITY_EDITOR + return true; +#endif +#pragma warning disable CS0162 + if (AD_Dicts.ContainsKey(adType) == false) + { + AD_Dicts[adType] = PlayerCreate(adType); + } + return AD_Dicts[adType].IsReadly(); +#pragma warning restore CS0162 + } + + public void LoadAD(AD_Type adType) + { +#if UNITY_EDITOR + return; +#endif + // Debug.LogError("准备加载广告" + adType); +#pragma warning disable CS0162 + if (!IsRealy(adType)) + { + AD_Dicts[adType].LoadAD(); + } +#pragma warning restore CS0162 + } + + /// + /// 检查网络状态 + /// + /// + public bool CheckNetwork() + { + return Application.internetReachability != NetworkReachability.NotReachable; + } + + /// + /// 直接加载并播放广告 + /// + /// + /// + public void AsyncPlayAD(AD_Type adType, string adScene, Action callback) + { + _adController.EventLog("adScene" , adScene); + try + { + _curAsyncPlayer?.Kill(); + if (AD_Dicts.ContainsKey(adType) == false) + { + AD_Dicts[adType] = PlayerCreate(adType); + } + var player = AD_Dicts[adType]; + _curAsyncPlayer = new AsyncAdPlayer(player, callback); + } + catch (Exception e) + { + Debug.LogError(e); + _adController.EventLog("error" , "showAdError" , e.Message); + callback?.Invoke(false); + } + } + + public ADPlayer PlayerCreate(AD_Type type) + { +#if UNITY_EDITOR + return null; +#endif +#pragma warning disable CS0162 + return _adController.CreateAdPlayer(type); +#pragma warning restore CS0162 + } + + public void CloseAd(AD_Type adType) + { +#if UNITY_EDITOR + return; +#endif +#pragma warning disable CS0162 + if (adType != AD_Type.AwardVideo) + { + if (AD_Dicts.ContainsKey(adType)) + { + AD_Dicts[adType]?.CloseAD(); + } + } +#pragma warning restore CS0162 + } + + + #region TimeSystem + + private List _updateList; + private const int DefaultLength = 1024; + private List _timeHandlers; + + private void InitTimeSystem() + { + this._updateList = new List(DefaultLength); + } + + private void _InvokeUpdate(List list) + { + for (int i = list.Count - 1; i >= 0; i--) + { + //在遍历时可能会出现外部操作list导致Count改变 + if (i >= list.Count) + continue; + if (list[i] == null) + { + list.RemoveAt(i); + } + else + { + list[i].Invoke(); + } + } + + for (int i = this._timeHandlers.Count - 1; i >= 0; i--) + { + var timeHandler = this._timeHandlers[i]; + if (timeHandler == null || timeHandler.IsDone || timeHandler._isKill) + { + this._timeHandlers.RemoveAt(i); + } + else + { + timeHandler.Update(); + } + } + } + + private void Update() => this._InvokeUpdate(this._updateList); + + public AdTimeHandler CreateTimer(float delay, Action callback, Action update = null) + { + if (delay <= 0) + { + callback.Invoke(); + return null; + } + + var timer = new AdTimeHandler(delay, callback, update); + this._timeHandlers.Add(timer); + return timer; + } + + public AdTimeHandler CreateOneFrameTimer(Action callback, Action update = null) + { + return this.CreateTimer(0.001f, callback, update); + } + + public AdTimeHandler CreateTimer(GameObject gameObj, float delay, Action callback, Action update = null) + { + if (delay <= 0) + { + callback.Invoke(); + return null; + } + + var timer = new AdTimeHandler(gameObj, delay, callback, update); + this._timeHandlers.Add(timer); + return timer; + } + + public void AddUpdater(Action updater) + { + this._updateList.Add(updater); + } + + public void RemoveUpdater(Action updater) + { + this._updateList.Remove(updater); + } + + #endregion + + public void CloseMask() + { + _adController.SetMask(false); + } + + public void OpenMask() + { + _adController.SetMask(true); + } + + } +} \ No newline at end of file diff --git a/Runtime/ADAggregator/ADManager.cs.meta b/Runtime/ADAggregator/ADManager.cs.meta new file mode 100644 index 0000000..eac199b --- /dev/null +++ b/Runtime/ADAggregator/ADManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 51249ffc3e3342c48a4c9528bab186da +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/ADAggregator/ADPlayer.cs b/Runtime/ADAggregator/ADPlayer.cs new file mode 100644 index 0000000..171b2a9 --- /dev/null +++ b/Runtime/ADAggregator/ADPlayer.cs @@ -0,0 +1,47 @@ +using System; + +namespace Runtime.ADAggregator +{ + public abstract class ADPlayer + { + /// + /// 0 未加载 、 1 加载中、 2 加载完成 + /// + protected int curState; + + public string Key; + protected ADListener adListener; + public Action OnErrorAction; + + public int State => curState; + + public ADPlayer Init(string key) + { + this.Key = key; + this.curState = 0; + adListener = new ADListener(); + this.OnInit(); + return this; + } + + public bool IsLoading() + { + return curState == 1; + } + + public abstract void ShowAD(Action onClose, Action onVideoComplete); + public abstract bool IsReadly(); + public abstract void LoadAD(); + + public virtual void OnInit() + { + } + + /// + /// 主动关闭广告 + /// + public virtual void CloseAD() + { + } + } +} \ No newline at end of file diff --git a/Runtime/ADAggregator/ADPlayer.cs.meta b/Runtime/ADAggregator/ADPlayer.cs.meta new file mode 100644 index 0000000..cc69d7d --- /dev/null +++ b/Runtime/ADAggregator/ADPlayer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7603efefc23554149b67df69502e64a3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/ADAggregator/AD_Type.cs b/Runtime/ADAggregator/AD_Type.cs new file mode 100644 index 0000000..ebc5ca0 --- /dev/null +++ b/Runtime/ADAggregator/AD_Type.cs @@ -0,0 +1,12 @@ +using System; + +namespace Runtime.ADAggregator +{ + [Serializable] + public enum AD_Type + { + AwardVideo, //激励视频广告 + Splash, //开屏 + Interaction,//插屏 + } +} \ No newline at end of file diff --git a/Runtime/ADAggregator/AD_Type.cs.meta b/Runtime/ADAggregator/AD_Type.cs.meta new file mode 100644 index 0000000..1169496 --- /dev/null +++ b/Runtime/ADAggregator/AD_Type.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 909151816b7d45e2bb4194e20ec189bc +timeCreated: 1574599079 \ No newline at end of file diff --git a/Runtime/ADAggregator/AdTimeHandler.cs b/Runtime/ADAggregator/AdTimeHandler.cs new file mode 100644 index 0000000..f0a5457 --- /dev/null +++ b/Runtime/ADAggregator/AdTimeHandler.cs @@ -0,0 +1,78 @@ +using System; +using UnityEngine; + +namespace Runtime.ADAggregator +{ + public sealed class AdTimeHandler + { + private float _maxTime; + private float _delayTime; + private Action _onComplete; + private Action _onUpdate; + private GameObject _gameObject; + private bool _isMono; + private bool _isPause; + + public bool IsDone => this._delayTime >= this._maxTime; + public bool IsPlaying => !IsDone && !this._isKill; + + internal bool _isKill; + + internal AdTimeHandler(float delay, Action callback, Action onUpdate = null) + { + this._maxTime = delay; + this._delayTime = 0; + this._onComplete = callback; + this._onUpdate = onUpdate; + this._isMono = false; + this._isKill = false; + } + + internal AdTimeHandler(GameObject gameObject, float delay, Action callback, Action onUpdate = null) + { + this._maxTime = delay; + this._delayTime = 0; + this._onComplete = callback; + this._onUpdate = onUpdate; + this._gameObject = gameObject; + this._isMono = true; + this._isKill = false; + } + + internal void Update() + { + if (!this.IsDone) + { + if (this._isMono) + { + if (System.Object.ReferenceEquals(this._gameObject, null)) + { + this.Kill(); + } + } + + if (!this._isPause) + { + this._onUpdate?.Invoke(this._delayTime / this._maxTime); + this._delayTime += Time.deltaTime; + } + + if (this.IsDone) + { + this._onComplete?.Invoke(); + this.Kill(); + } + } + } + + public void Kill() + { + this._isKill = true; + } + + public void Pause(bool b) + { + this._isPause = b; + } + } +} \ No newline at end of file diff --git a/Runtime/ADAggregator/AdTimeHandler.cs.meta b/Runtime/ADAggregator/AdTimeHandler.cs.meta new file mode 100644 index 0000000..f33f6c7 --- /dev/null +++ b/Runtime/ADAggregator/AdTimeHandler.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e81a68c1c39445b8b6849964bc69db07 +timeCreated: 1673341117 \ No newline at end of file diff --git a/Runtime/ADAggregator/AsyncAdPlayer.cs b/Runtime/ADAggregator/AsyncAdPlayer.cs new file mode 100644 index 0000000..d5f660e --- /dev/null +++ b/Runtime/ADAggregator/AsyncAdPlayer.cs @@ -0,0 +1,138 @@ +using System; +using UnityEngine; + +namespace Runtime.ADAggregator +{ + public class AsyncAdPlayer + { + private Action _callback; + private ADPlayer _adPlayer; + private bool firstLoad; + private bool isKill; + private bool isUpdate; + private AdTimeHandler overHandler; + + private float _outTime; + + public AsyncAdPlayer(ADPlayer player , Action callback) + { + + this._outTime = 0; + this._callback = callback; + this.isKill = false; + this.firstLoad = true; + this._adPlayer = player; + if (_adPlayer == null) + { +#if UNITY_EDITOR + Debug.LogError("无法播放指定的广告"); +#endif + _callback?.Invoke(false); + Kill(); + return; + } + ADManager.Instance.OpenMask(); + _adPlayer.OnErrorAction = OnError; + isUpdate = true; + ADManager.Instance.AddUpdater(DoUpdate); + } + + private void OnError() + { +#if UNITY_EDITOR + Debug.LogError("广告异常: " + this._adPlayer.Key); +#endif + // return; + // if (isUpdate) + // { + // isUpdate = false; + // ADManager.Instance.RemoveUpdater(DoUpdate); + // } + // ADManager.Instance.CloseMask(); + // _callback?.Invoke(false); + // Clear(); + } + + private void DoUpdate() + { + if (!isUpdate) + return; + _outTime += Time.deltaTime; + if (this._outTime >= 15) + { + _callback?.Invoke(false); + Kill(); + } + if (_adPlayer.IsReadly()) + { +#if UNITY_EDITOR + Debug.LogError("开始播放广告: " + this._adPlayer.Key); +#endif + _adPlayer.ShowAD(OnCloseAD, OnComplete); + ADManager.Instance.CloseMask(); + isUpdate = false; + ADManager.Instance.RemoveUpdater(DoUpdate); + } + else if(!_adPlayer.IsLoading()) + { + if (firstLoad) + { +#if UNITY_EDITOR + Debug.LogError("开始加载广告: " + this._adPlayer.Key); +#endif + this._outTime = 0; + _adPlayer.LoadAD(); + firstLoad = false; + } + else + { + _callback?.Invoke(false); + Kill(); + } + } + } + + private void OnCloseAD() + { +#if UNITY_EDITOR + Debug.LogError("关闭广告: " + this._adPlayer.Key); +#endif + if (overHandler == null) + { + overHandler = ADManager.Instance.CreateTimer(1.5f, () => + { + this._callback?.Invoke(false); + Clear(); + }); + } + } + + private void OnComplete(bool obj) + { + this.overHandler?.Kill(); + this.overHandler = ADManager.Instance.CreateTimer(0.05f, () => + { + _callback?.Invoke(obj); + Clear(); + }); + } + + //销毁广告 + public void Kill() + { + if (isKill) + return; + ADManager.Instance.CloseMask(); + ADManager.Instance.RemoveUpdater(DoUpdate); + Clear(); + } + + private void Clear() + { + isKill = true; + _callback = null; + _adPlayer = null; + this.overHandler = null; + } + } +} diff --git a/Runtime/ADAggregator/AsyncAdPlayer.cs.meta b/Runtime/ADAggregator/AsyncAdPlayer.cs.meta new file mode 100644 index 0000000..36e45b9 --- /dev/null +++ b/Runtime/ADAggregator/AsyncAdPlayer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3f7ea948e052ec848852aaa5387c40f7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/ADAggregator/IAdController.cs b/Runtime/ADAggregator/IAdController.cs new file mode 100644 index 0000000..1241a55 --- /dev/null +++ b/Runtime/ADAggregator/IAdController.cs @@ -0,0 +1,10 @@ +namespace Runtime.ADAggregator +{ + public interface IAdController + { + void Init(ADConfig adConfig, object[] args); + ADPlayer CreateAdPlayer(AD_Type type); + void EventLog(string eventTable, string eventValue, string eventMessage = null); + void SetMask(bool isOpen); + } +} \ No newline at end of file diff --git a/Runtime/ADAggregator/IAdController.cs.meta b/Runtime/ADAggregator/IAdController.cs.meta new file mode 100644 index 0000000..900f23a --- /dev/null +++ b/Runtime/ADAggregator/IAdController.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b92fad2951d841d7a85eb1298dec4786 +timeCreated: 1673336562 \ No newline at end of file diff --git a/Runtime/ADAggregator/Runtime.Adaggregator.asmdef b/Runtime/ADAggregator/Runtime.Adaggregator.asmdef new file mode 100644 index 0000000..577745b --- /dev/null +++ b/Runtime/ADAggregator/Runtime.Adaggregator.asmdef @@ -0,0 +1,3 @@ +{ + "name": "Runtime.Adaggregator" +} diff --git a/Runtime/ADAggregator/Runtime.Adaggregator.asmdef.meta b/Runtime/ADAggregator/Runtime.Adaggregator.asmdef.meta new file mode 100644 index 0000000..83544e4 --- /dev/null +++ b/Runtime/ADAggregator/Runtime.Adaggregator.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3198a86b02613024e960e3d04a9638cd +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scenes.meta b/Scenes.meta new file mode 100644 index 0000000..7fe8e10 --- /dev/null +++ b/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 131a6b21c8605f84396be9f6751fb6e3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scenes/Sample-AdConfig.asset b/Scenes/Sample-AdConfig.asset new file mode 100644 index 0000000..5d26165 --- /dev/null +++ b/Scenes/Sample-AdConfig.asset @@ -0,0 +1,28 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b31b835f394db4a51957c3f0f3ac32, type: 3} + m_Name: Sample-AdConfig + m_EditorClassIdentifier: + ConfigName: + Id: + Key: + Key2: + BaseAwardAdKeyValue: + key: + value: + BaseInteractionAdKeyValue: + key: + value: + BaseSplashAdKeyValue: + key: + value: + CommonKeyValues: [] diff --git a/Scenes/Sample-AdConfig.asset.meta b/Scenes/Sample-AdConfig.asset.meta new file mode 100644 index 0000000..e272445 --- /dev/null +++ b/Scenes/Sample-AdConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d4eed937a29d5f2408fa1bb48c59169a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scenes/Sample-Commercialization.unity b/Scenes/Sample-Commercialization.unity new file mode 100644 index 0000000..9421266 --- /dev/null +++ b/Scenes/Sample-Commercialization.unity @@ -0,0 +1,208 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &519420028 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 519420032} + - component: {fileID: 519420031} + - component: {fileID: 519420029} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &519420029 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 519420028} + m_Enabled: 1 +--- !u!20 &519420031 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 519420028} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 0 + m_HDR: 1 + m_AllowMSAA: 0 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 0 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &519420032 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 519420028} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Scenes/Sample-Commercialization.unity.meta b/Scenes/Sample-Commercialization.unity.meta new file mode 100644 index 0000000..c1e3c88 --- /dev/null +++ b/Scenes/Sample-Commercialization.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2cda990e2423bbf4892e6590ba056729 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/package.json b/package.json new file mode 100644 index 0000000..be607d4 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "com.foldcc.cc-framework.commercialization", + "displayName": "CC-Framework.commercialization", + "description": "商业化sdk通用组件,包含广告、内购、用户统计、归因统计等", + "version": "1.0.0", + "unity": "2021.1", + "license": "MIT", + "repository": { + "type": "git", + "url": "http://private.lightyears.ltd:18640/foldcc/CC-Framework.Commercialization" + }, + "author": { + "name": "foldcc", + "email": "lhyuau@qq.com", + "url": "https://gitee.com/foldcc" + }, + "dependencies": + { + }, + "keywords": [ + "Framework" + ] +} diff --git a/package.json.meta b/package.json.meta new file mode 100644 index 0000000..4617fe3 --- /dev/null +++ b/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6bdc75239432ff3458a7b98e29519e6d +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: