Kwai广告

This commit is contained in:
玉峰 2025-08-30 12:15:48 +08:00
commit 3363b58c17
114 changed files with 4468 additions and 0 deletions

12
.gitignore vendored Normal file
View File

@ -0,0 +1,12 @@
/.idea
/Packages
/Temp
/Library
/Logs
/obj
/*.csproj
/*.sln
/*.user
/sds_BackUpThisFolder_ButDontShipItWithYourGame
/sdss_BackUpThisFolder_ButDontShipItWithYourGame
/Jjhda_BackUpThisFolder_ButDontShipItWithYourGame

8
Assets/Plugins.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6646a893ff2303c408b296b6399e6127
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b068b5e0342a943b79a33139d35f69b1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,32 @@
fileFormatVersion: 2
guid: aa74a979cb33d4d16afb0e58ae8b887d
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Android: Android
second:
enabled: 1
settings: {}
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,32 @@
fileFormatVersion: 2
guid: 88b1fa4bca95147a6a93a6008aad62da
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Android: Android
second:
enabled: 1
settings: {}
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

8
Assets/Scenes.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ac2b3539b90604547837f97aa65bc4f0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,254 @@
%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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2137923633
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2137923634}
- component: {fileID: 2137923635}
m_Layer: 0
m_Name: '[SDKManager]'
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2137923634
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2137923633}
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_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2137923635
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2137923633}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6d54b264ce860144d940f61f7a0092c2, type: 3}
m_Name:
m_EditorClassIdentifier:
IsMoreAdsBidding: 0

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2cda990e2423bbf4892e6590ba056729
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Assets/Script.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cd02d54816dc59f42ac4cb4e7ccedea8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8c27f7b6d4c7b1c4885674e6e47a31a8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a1dbfc1b890a2094b90184494b6dd5de
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,49 @@
using System;
using UnityEngine;
public class AdsSDKManager : MonoBehaviour
{
public static AdsSDKManager instance;
/// <summary>
/// 看完广告的回调
/// </summary>
private Action<double> AdRewardCallback;
/// <summary>
/// 广告竞价开关激励、插屏、全屏Native广告竞价
/// </summary>
public bool IsMoreAdsBidding = false;
private void Awake()
{
instance = this;
InitSDK();
}
private void InitSDK()
{
KwaiAdsManager.Init();
}
/// <summary>
/// 展示激励广告
/// </summary>
/// <param name="callback"></param>
private void ShowRewardAd(Action<double> callback)
{
AdRewardCallback = callback;
}
/// <summary>
/// 广告看完回调
/// </summary>
public void OnRewardAdCallback(double price)
{
AdRewardCallback?.Invoke(price);
AdRewardCallback = null;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6d54b264ce860144d940f61f7a0092c2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b0a80a58adfc8ed44a051dd9180313b4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,16 @@
using UnityEngine;
public class InitResultCallbackImpl : KwaiAds.Scripts.Api.InitResultCallback
{
public void OnSuccess()
{
Debug.Log("快手广告初始化成功");
KwaiAdsManager.LoadRewardAd();
KwaiAdsManager.LoadInterstitialAd();
}
public void OnFail(int code, string msg)
{
Debug.LogFormat($"快手广告初始化失败 code is {code}, msg:{msg}");
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 297acd22f0724fb68940e9ed07e99679
timeCreated: 1756523069

View File

@ -0,0 +1,31 @@
using KwaiAds.Scripts.Api.Interstitial;
using UnityEngine;
public class InterstitialAdListener : IInterstitialAdListener
{
public void OnAdClick()
{
// 插页广告调整转换页 Interstitial ad agjust conversion page
}
public void OnAdClose()
{
// 插页广告关闭 | Interstitial ad close
}
public void OnAdPlayComplete()
{
// 插页视频播放完成 | Interstitial video play complete
KwaiAdsManager.OnInterstitialCallback();
}
public void OnAdShow()
{
// 插页视频曝光 | Interstitial video show
}
public void OnAdShowFailed(int code, string msg)
{
Debug.LogError($"RewardAdListener#OnAdShowFailed , code:{code}, msg:{msg}");
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 8a26832a3e5e45628a7fe6146582fd5d
timeCreated: 1756526359

View File

@ -0,0 +1,36 @@
using System.Globalization;
using KwaiAds.Scripts.Api.Interstitial;
using UnityEngine;
public class InterstitialAdLoadListener : IInterstitialAdLoadListener
{
private const int maxLoadCount = 3;
private int currentLoadCount = 0;
public void OnAdLoadFailed(string trackId, int code, string msg)
{
// 受国内环境限制国内无法请求到海外广告需要加白。可以将trackId反馈给对接同学进行加白。| Due to the limitations of the domestic environment, it is not possible to request overseas advertisements in China, and it is necessary to add white. You can feedback the trackId to the contact peroson to add white.
Debug.LogFormat($"InterstitialAdLoadListener#OnAdLoadFailed , trackId:{trackId}, code:{code}, msg:{msg}");
currentLoadCount++;
if (currentLoadCount < maxLoadCount)
{
KwaiAdsManager.LoadRewardAd();
}
}
public void OnAdLoadStart(string trackId)
{
Debug.Log($"InterstitialAdLoadListener#OnAdLoadStart , trackId:{trackId}");
}
public void OnAdLoadSuccess(string trackId, string price)
{
// price 单位是$(美元ecpm) | price in $ (dollars, ecpm)
Debug.Log($"InterstitialAdLoadListener#OnAdLoadSuccess , trackId:{trackId}, price:{price}");
if (double.TryParse(price, NumberStyles.Float, CultureInfo.InvariantCulture, out double result))
{
KwaiAdsManager.interstitiaAdRevenue = result;
Debug.Log($"InterstitialAdLoadListener#OnAdLoadSuccess , trackId:{trackId}, price:{price}");
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 3197cbfdc6ca40bfaa8f91562eb8e9e5
timeCreated: 1756526060

View File

@ -0,0 +1,129 @@
using System.Collections;
using System.Collections.Generic;
using KwaiAds.Scripts.Api.Interstitial;
using KwaiAds.Scripts.Api.Reward;
using UnityEngine;
public static class KwaiAdsManager
{
//目前都是测试id
private const string appId = "899999";
private const string token = "EaCw0AipSYyvf3E7";
private const string rewardAdUnitId = "8999996001";
private const string interstitialAdUnitId = "8999996002";
/// <summary>
/// 目前是千倍广告价值
/// </summary>
public static double rewardAdRevenue = 0;
/// <summary>
/// 插屏奖励价值 如果有竞价功能可能会用到
/// </summary>
public static double interstitiaAdRevenue = 0;
private static IRewardAdController rewardAdController;
private static IInterstitialAdController interstitialAdController;
public static void Init()
{
bool debug = true; // Whether in debug mode. Plsease set to false when in release build.
var kwaiAdConfig = new KwaiAds.Scripts.Api.KwaiAdConfig.Builder()
.SetAppId(appId)
.SetToken(token)
.SetAppName("App Name") // Optional
.SetDebugLog(debug) // Optional
.Build();
KwaiAds.Scripts.Api.KwaiAdsSdk.Initialize(kwaiAdConfig, new InitResultCallbackImpl());
}
#region 广
/// <summary>
/// 加载激励广告
/// </summary>
public static void LoadRewardAd()
{
if (rewardAdController != null)
{
rewardAdController.Destroy();
rewardAdController = null;
rewardAdRevenue = 0;
}
rewardAdController = KwaiAds.Scripts.Api.KwaiAdsSdk.SDK.getRewardAdController();
KwaiRewardAdRequest kwaiRewardAdRequest = new KwaiRewardAdRequest(rewardAdUnitId);
rewardAdController.Load(kwaiRewardAdRequest, new RewardAdListener(), new RewardAdLoadListener());
}
/// <summary>
/// 展示激励广告
/// </summary>
public static void ShowRewardAd()
{
if (rewardAdController != null)
{
rewardAdController.Show();
}
else
{
LoadRewardAd();
}
}
/// <summary>
/// 广告播放完成 获得奖励
/// </summary>
public static void OnRewardAdCallback()
{
AdsSDKManager.instance.OnRewardAdCallback(rewardAdRevenue);
LoadRewardAd();
}
#endregion
#region
public static void LoadInterstitialAd()
{
if (interstitialAdController != null)
{
interstitialAdController.Destroy();
interstitialAdController = null;
interstitiaAdRevenue = 0;
}
interstitialAdController = KwaiAds.Scripts.Api.KwaiAdsSdk.SDK.getInterstitialAdController();
KwaiInterstitialAdRequest kwaiInterstitialAdRequest = new KwaiInterstitialAdRequest(interstitialAdUnitId);
interstitialAdController.Load(kwaiInterstitialAdRequest, new InterstitialAdListener(), new InterstitialAdLoadListener());
}
public static void ShowInterstitialAd()
{
if (interstitialAdController != null)
{
interstitialAdController.Show();
}
else
{
LoadInterstitialAd();
}
}
/// <summary>
/// 广告播放完成 获得奖励
/// </summary>
public static void OnInterstitialCallback()
{
if (AdsSDKManager.instance.IsMoreAdsBidding)
{
AdsSDKManager.instance.OnRewardAdCallback(interstitiaAdRevenue);
}
LoadInterstitialAd();
}
#endregion
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d13d3a000acd1e64bb9f12c354d6f278
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,37 @@
using KwaiAds.Scripts.Api.Reward;
using UnityEngine;
public class RewardAdListener : IRewardAdListener
{
public void OnAdClick()
{
// 激励广告调整转换页 | Reward ad adjustment conversion page
}
public void OnAdClose()
{
// 激励广告关闭 | Reward ad close
KwaiAdsManager.LoadRewardAd();
}
public void OnAdPlayComplete()
{
// 激励视频播放完成 | Reward video play complete
}
public void OnAdShow()
{
// 激励视频曝光 | Reward video show
}
public void OnAdShowFailed(int code, string msg)
{
Debug.LogFormat($"RewardAdListener#OnAdShowFailed , code:{code}, msg:{msg}");
}
public void OnRewardEarned()
{
// 获取到激励 | Reward earned
KwaiAdsManager.OnRewardAdCallback();
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: eb646767a47246de9651276f8c02b182
timeCreated: 1756523109

View File

@ -0,0 +1,35 @@
using System.Globalization;
using KwaiAds.Scripts.Api.Reward;
using UnityEngine;
public class RewardAdLoadListener : IRewardAdLoadListener
{
private const int maxLoadCount = 3;
private int currentLoadCount = 0;
public void OnAdLoadFailed(string trackId, int code, string msg)
{
// 受国内环境限制国内无法请求到海外广告需要加白。可以将trackId反馈给对接同学进行加白。| Due to the limitations of the domestic environment, it is not possible to request overseas advertisements in China, and it is necessary to add white. You can feedback the trackId to the contact peroson to add white.
Debug.LogFormat($"RewardAdLoadListener#OnAdLoadFailed , trackId:{trackId}, code:{code}, msg:{msg}");
currentLoadCount++;
if (currentLoadCount < maxLoadCount)
{
KwaiAdsManager.LoadRewardAd();
}
}
public void OnAdLoadStart(string trackId)
{
Debug.Log($"RewardAdLoadListener#OnAdLoadStart , trackId:{trackId}");
}
public void OnAdLoadSuccess(string trackId, string price)
{
// price 单位是$(美元ecpm) | price in $ (dollars, ecpm)
if (double.TryParse(price, NumberStyles.Float, CultureInfo.InvariantCulture, out double result))
{
KwaiAdsManager.rewardAdRevenue = result;
Debug.Log($"RewardAdLoadListener#OnAdLoadSuccess , trackId:{trackId}, price:{price}");
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a0992279c4964e378024c3306ff8ace7
timeCreated: 1756523090

8
Assets/rd3.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3a60b109e679ff348987b5f3ddcbb7ae
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Assets/rd3/AdsSDK.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6ee630ce237458044be6ec0977068a88
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 21b0e881364cd4d0da806044ea47768c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5b7831b042a714ecbbed624079aee268
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6cfda4e373bf74dc188f05e9d13e5686
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,17 @@
namespace KwaiAds.Scripts.Api
{
public static class Constants
{
public static class Request
{
public const string BID_FLOOR_PRICE = "bidfloor";
public const string BID_FLOOR_CURRENCY = "bidfloorcur";
public const string MEDIATION_TYPE = "knMediationType";
}
public static class Currency
{
public static string USD = "USD";
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d588296f2ea8e4ad2b0d8fe1352f6601
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,10 @@
namespace KwaiAds.Scripts.Api
{
public interface InitResultCallback
{
// init success.
void OnSuccess();
// init fail.
void OnFail(int code, string msg);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8be85fafbbdb749d19df315210dc5f00
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c15a0f83cafbc445d8b2d6f33b4ddc39
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,10 @@
using KwaiAds.Scripts.Common;
namespace KwaiAds.Scripts.Api.Interstitial
{
public interface IInterstitialAdController : IKwaiAdController<KwaiInterstitialAdRequest, IInterstitialAdListener, IInterstitialAdLoadListener>
{
bool Load(KwaiInterstitialAdRequest request, IInterstitialAdListener adListener, IInterstitialAdLoadListener AdLoadListener);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fe02ba500a25a4d7d8908d374918ff77
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
using KwaiAds.Scripts.Common;
namespace KwaiAds.Scripts.Api.Interstitial
{
public interface IInterstitialAdListener : IAdListener
{
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 918faaa178894484c9a6e049087a19a9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
using KwaiAds.Scripts.Common;
namespace KwaiAds.Scripts.Api.Interstitial
{
public interface IInterstitialAdLoadListener : IRwardAdListener
{
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d72b6a69cd6d34540ac09553f5b5ac8e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
namespace KwaiAds.Scripts.Api.Interstitial
{
public class KwaiInterstitialAdRequest : KwaiRequest
{
public KwaiInterstitialAdRequest(string tagId) : base(tagId)
{
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6c4a573a0bd164e71b48712fce52f831
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,90 @@
namespace KwaiAds.Scripts.Api
{
public class KwaiAdConfig
{
// 必填
internal string AppId { get; }
// 必填
internal string Token { get; }
// 选填
internal string AppName { get; }
// 选填
internal string AppDomain { get; }
// 选填
internal string AppStoreUrl { get; }
// 选填, 打印debug日志使用注意上线前需要关闭
internal bool DebugLog { get; }
private KwaiAdConfig(KwaiAdConfig.Builder builder)
{
AppId = builder.AppId;
Token = builder.Token;
AppName = builder.AppName;
AppDomain = builder.AppDomain;
AppStoreUrl = builder.AppStoreUrl;
DebugLog = builder.DebugLog;
}
public class Builder
{
internal string AppId;
internal string Token;
internal string AppName;
internal string AppDomain;
internal string AppStoreUrl;
internal bool DebugLog;
public Builder SetAppId(string appid)
{
this.AppId = appid;
return this;
}
public Builder SetToken(string token)
{
this.Token = token;
return this;
}
public Builder SetAppName(string appName)
{
this.AppName = appName;
return this;
}
public Builder SetAppDomain(string appDomain)
{
this.AppDomain = appDomain;
return this;
}
public Builder SetAppStoreUrl(string appStoreUrl)
{
this.AppStoreUrl = appStoreUrl;
return this;
}
public Builder SetDebugLog(bool debugLog)
{
this.DebugLog = debugLog;
return this;
}
public KwaiAdConfig Build()
{
return new KwaiAdConfig(this);
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 32b28f3fd33f1428da1cc9988640243b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,53 @@
using System;
using KwaiAds.Scripts.Common;
namespace KwaiAds.Scripts.Api
{
public static class KwaiAdsSdk
{
private static IClientFactory _clientFactory;
private static ISDK _sdk;
internal static ISDK SDK
{
get
{
if (_sdk == null)
{
_sdk = GetClientFactory().BuildSDKClient();
}
return _sdk;
}
}
internal static IClientFactory GetClientFactory()
{
if (_clientFactory != null)
{
return _clientFactory;
}
_clientFactory =
#if UNITY_ANDROID
new KwaiAds.Scripts.Platforms.Android.AndroidClientFactory();
#else
null;
throw new PlatformNotSupportedException();
#endif
return _clientFactory;
}
/// Starts the Kwai SDK
/// @warning Call this method as early as possible to reduce ad request fail.
/// @param config SDK configuration
/// @param callback Callback for starting the Kwai SDK
/// ////
public static void Initialize(KwaiAdConfig config, InitResultCallback initResultCallback)
{
SDK.Init(config, initResultCallback);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2791cc736a9794f25ab1696f26f5213c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace KwaiAds.Scripts.Api
{
public class KwaiRequest
{
public readonly string TagId;
public Dictionary<string, string> ExtParams = new Dictionary<string, string>();
public KwaiRequest(string tagId)
{
this.TagId = tagId ?? throw new ArgumentNullException(nameof(tagId));
InitExtParams();
}
protected void InitExtParams()
{
ExtParams[Constants.Request.BID_FLOOR_PRICE] = "0";
ExtParams[Constants.Request.BID_FLOOR_CURRENCY] = Constants.Currency.USD;
ExtParams[Constants.Request.MEDIATION_TYPE] = "4";
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 61bfe19af80544aba92d1b80944a1be4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6cd289c41733447869d15ae750e6053b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,10 @@
using KwaiAds.Scripts.Common;
namespace KwaiAds.Scripts.Api.Reward
{
public interface IRewardAdController : IKwaiAdController<KwaiRewardAdRequest, IRewardAdListener, IRewardAdLoadListener>
{
bool Load(KwaiRewardAdRequest request, IRewardAdListener adListener, IRewardAdLoadListener AdLoadListener);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d5caaf31f542a47f393348c0ae68e02f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
using KwaiAds.Scripts.Common;
namespace KwaiAds.Scripts.Api.Reward
{
public interface IRewardAdListener : IAdListener
{
void OnRewardEarned();
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 045ba09dbdc7c466e9be4fc380f2d9bc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
using KwaiAds.Scripts.Common;
namespace KwaiAds.Scripts.Api.Reward
{
public interface IRewardAdLoadListener : IRwardAdListener
{
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 13ea58bcd42a84f62bb3135d963cdafc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
namespace KwaiAds.Scripts.Api.Reward
{
public class KwaiRewardAdRequest : KwaiRequest
{
public KwaiRewardAdRequest(string tagId) : base(tagId)
{
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: dd180b13db2b542d182f2385909233a8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a9d21eba105154e56868106703439665
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,15 @@
namespace KwaiAds.Scripts.Common
{
public interface IAdListener
{
public void OnAdShow();
public void OnAdShowFailed(int code, string msg);
public void OnAdClick();
public void OnAdClose();
public void OnAdPlayComplete();
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 610a8aa1a88da4205aef22f667f20fb3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,11 @@
namespace KwaiAds.Scripts.Common
{
public interface IRwardAdListener
{
void OnAdLoadStart(string trackId);
void OnAdLoadSuccess(string trackId, string price);
void OnAdLoadFailed(string trackId, int code, string msg);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a89806e9b67c64489a2a827347537cc3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
namespace KwaiAds.Scripts.Common
{
public interface IClientBidding
{
void NotifyWin();
void NotifyLoss();
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6e0c163d17ce64bc8b252335972ee68e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
namespace KwaiAds.Scripts.Common
{
public interface IClientFactory
{
ISDK BuildSDKClient();
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fdc26de22e37d4230a8e0da39e5c796e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,16 @@
using KwaiAds.Scripts.Api;
namespace KwaiAds.Scripts.Common
{
public interface IKwaiAdController<in T, in A, in L> : IClientBidding
where T : KwaiRequest
where A : IAdListener
where L : IRwardAdListener
{
bool Load(T request, A adListener, L AdLoadListener);
bool IsLoaded();
bool IsReady();
void Show();
void Destroy();
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3f46c0951e94f4f8281a9fe8163ada33
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,15 @@
using KwaiAds.Scripts.Api;
using KwaiAds.Scripts.Api.Interstitial;
using KwaiAds.Scripts.Api.Reward;
namespace KwaiAds.Scripts.Common
{
public interface ISDK
{
void Init(KwaiAdConfig config, InitResultCallback initResultCallback);
IRewardAdController getRewardAdController();
IInterstitialAdController getInterstitialAdController();
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6f06c54ccc95d498888d80a2f23ae03b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c356a83720f804e72bf376a6269fdd49
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6f65ac5b34e2e421daefec3aca0c1ee3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,14 @@
#if UNITY_ANDROID
using KwaiAds.Scripts.Common;
namespace KwaiAds.Scripts.Platforms.Android
{
class AndroidClientFactory : IClientFactory
{
public ISDK BuildSDKClient()
{
return new KwaiSdkClient();
}
}
}
#endif

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 275e0a240fbb94bbbaa5b2aef39327fe
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,22 @@
using System;
using UnityEngine;
namespace BigoAds.Scripts.Platforms.Android
{
internal static class AndroidPlatformTool
{
public const string ClassPackage = "com.kwai.network.sdk";
private const string CurrentActivityMethod = "currentActivity";
private const string UnityPlayerClassName = "com.unity3d.player.UnityPlayer";
public static AndroidJavaObject GetGameActivity()
{
return new AndroidJavaClass(UnityPlayerClassName).GetStatic<AndroidJavaObject>(CurrentActivityMethod);
}
public static void CallMethodOnMainThread(Action task)
{
GetGameActivity()?.Call("runOnUiThread", new AndroidJavaRunnable(task));
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2b96b326de04d4efc86c67f33abe4f87
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,164 @@
#if UNITY_ANDROID
using System;
using BigoAds.Scripts.Platforms.Android;
using KwaiAds.Scripts.Api;
using KwaiAds.Scripts.Common;
using UnityEngine;
namespace KwaiAds.Scripts.Platforms.Android
{
public class KwaiAdSDKInit
{
private const string TAG = "[KwaiAdSDK-INIT]";
private const string SDKClientClassName = AndroidPlatformTool.ClassPackage + ".KwaiAdSDK";
private const string SDKClientBuilder = AndroidPlatformTool.ClassPackage + ".api.SdkConfig$Builder";
private const string SDKClientInitCallback = AndroidPlatformTool.ClassPackage + ".api.KwaiInitCallback";
private static AndroidJavaClass kwaiAdSdkClass;
private static KwaiAdConfig config;
private static InitResultCallback initCallback;
private KwaiAdSDKInit(KwaiAdConfig kwaiAdConfig, InitResultCallback initResultCallback)
{
if (kwaiAdConfig == null)
{
throw new ArgumentNullException(nameof(kwaiAdConfig), $"{TAG}: KwaiAdConfig cannot be null.");
}
config = kwaiAdConfig;
initCallback = initResultCallback;
}
private class KwaiNetworkSingleton
{
private static volatile KwaiAdSDKInit _instance;
private static object syncRoot = new object();
public static KwaiAdSDKInit Instance
{
get
{
if (_instance == null)
{
lock (syncRoot)
{
if (_instance == null)
{
throw new InvalidOperationException($"{TAG}: KwaiAdSDK instance has not been initialized.");
}
}
}
return _instance;
}
}
public static void Initialize(KwaiAdConfig kwaiAdConfig, InitResultCallback initResultCallback)
{
lock (syncRoot)
{
if (_instance == null)
{
_instance = new KwaiAdSDKInit(kwaiAdConfig, initResultCallback);
_instance.InitializeKwaiAdSDK();
}
}
}
}
public static void Initialize(KwaiAdConfig kwaiAdConfig, InitResultCallback initResultCallback)
{
KwaiNetworkSingleton.Initialize(kwaiAdConfig, initResultCallback);
}
public static KwaiAdSDKInit Instance
{
get { return KwaiNetworkSingleton.Instance; }
}
public AndroidJavaClass GetKwaiAdSDKClass()
{
if (kwaiAdSdkClass == null)
{
Debug.LogError($"{TAG}: KwaiAdSDKClass has not been initialized..");
}
return kwaiAdSdkClass;
}
private void InitializeKwaiAdSDK()
{
var kwaiUnityCallback = new KwaiUnityCallback();
if (Application.platform != RuntimePlatform.Android)
{
Debug.LogError($"{TAG}: Kwai Ad SDK can only be initialized on Android.");
kwaiUnityCallback.onFail(2, "Kwai Ad SDK can only be initialized on Android.");
return;
}
kwaiAdSdkClass = new AndroidJavaClass(SDKClientClassName);
if (kwaiAdSdkClass == null)
{
Debug.LogError($"{TAG}: Failed to get KwaiAdSDK class.");
kwaiUnityCallback.onFail(3, "Failed to get KwaiAdSDK class.");
return;
}
var sdkConfigBuilder = new AndroidJavaObject(SDKClientBuilder);
if (sdkConfigBuilder == null)
{
Debug.LogError($"{TAG}: Failed to create SdkConfig builder.");
kwaiUnityCallback.onFail(4, "Failed to create SdkConfig builder.");
return;
}
if (config != null)
{
sdkConfigBuilder.Call<AndroidJavaObject>("appId", config.AppId);
sdkConfigBuilder.Call<AndroidJavaObject>("token", config.Token);
sdkConfigBuilder.Call<AndroidJavaObject>("appName", config.AppName);
sdkConfigBuilder.Call<AndroidJavaObject>("appDomain", config.AppDomain);
sdkConfigBuilder.Call<AndroidJavaObject>("appStoreUrl", config.AppStoreUrl);
sdkConfigBuilder.Call<AndroidJavaObject>("setInitCallback", kwaiUnityCallback);
sdkConfigBuilder.Call<AndroidJavaObject>("debug", config.DebugLog);
}
AndroidJavaObject currentActivity = AndroidPlatformTool.GetGameActivity();
if (currentActivity != null)
{
AndroidJavaObject contextObject = currentActivity.Call<AndroidJavaObject>("getApplicationContext");
Debug.Log("Android Context: " + contextObject.Call<string>("toString"));
kwaiAdSdkClass.CallStatic("init", contextObject, sdkConfigBuilder.Call<AndroidJavaObject>("build"));
}
else
{
Debug.LogError("Current Activity not found.");
kwaiUnityCallback.onFail(1, $"{TAG}: Current Activity not found.");
return;
}
}
[System.Serializable]
private class KwaiUnityCallback : AndroidJavaProxy
{
public KwaiUnityCallback() : base(SDKClientInitCallback) { }
public void onSuccess()
{
Debug.Log($"{TAG}: Kwai SDK initialized successfully.");
if (initCallback != null)
{
initCallback.OnSuccess();
}
}
public void onFail(int code, string msg)
{
Debug.LogError($"{TAG}: Kwai SDK initialization failed. Code: {code}, Message: {msg}");
if (initCallback != null)
{
initCallback.OnFail(code, msg);
}
}
}
}
}
#endif

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8225807b5469a4df4a11ec59cc223f4d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,240 @@
#if UNITY_ANDROID
using BigoAds.Scripts.Platforms.Android;
using KwaiAds.Scripts.Api;
using KwaiAds.Scripts.Api.Interstitial;
using UnityEngine;
namespace KwaiAds.Scripts.Platforms.Android
{
public class KwaiInterstitialAdController : IInterstitialAdController
{
private const string TAG = "[KwaiAdSDK-InterstitialAdController]";
private const string InterstitialAdConfigBuilderClassName = AndroidPlatformTool.ClassPackage + ".loader.business.interstitial.data.KwaiInterstitialAdConfig$Builder";
private const string KwaiInterstitialAdListenerClassName = AndroidPlatformTool.ClassPackage + ".loader.business.interstitial.interf.IKwaiInterstitialAdListener";
private const string AdLoadListenerClassName = AndroidPlatformTool.ClassPackage + ".loader.common.interf.AdLoadListener";
private const string KwaiInterstitialAdRequestClassName = AndroidPlatformTool.ClassPackage + ".loader.business.interstitial.data.KwaiInterstitialAdRequest";
private const string KwaiAdLoaderManagerMethodName = "getKwaiAdLoaderManager";
private const string WithKwaiInterstitialAdListenerMethodName = "withKwaiInterstitialAdListener";
private const string BuildInterstitialAdLoaderMethodName = "buildInterstitialAdLoader";
private AndroidJavaClass _KwaiAdSDKInit;
private AdLoadListener _AdLoadListener;
private InterstitialAdListener _InterstitialAdListener;
private AndroidJavaObject _KwaiInterstitialAd;
public bool Load(KwaiInterstitialAdRequest request, IInterstitialAdListener adListener, IInterstitialAdLoadListener adLoadListener)
{
_KwaiAdSDKInit = Android.KwaiAdSDKInit.Instance.GetKwaiAdSDKClass();
if (_KwaiAdSDKInit == null)
{
Debug.Log($"{TAG}: kwaiAdSDKInit is null.");
return false;
}
var loaderManager = _KwaiAdSDKInit.CallStatic<AndroidJavaObject>(KwaiAdLoaderManagerMethodName);
if (loaderManager == null)
{
Debug.Log($"{TAG}: loaderManager is null.");
return false;
}
else
{
_AdLoadListener = new AdLoadListener(adLoadListener, this);
_InterstitialAdListener = new InterstitialAdListener(adListener);
var kwaiInterstitialAdConfig = new AndroidJavaObject(InterstitialAdConfigBuilderClassName, _AdLoadListener);
if (kwaiInterstitialAdConfig == null)
{
Debug.LogError($"{TAG}: Failed to create kwaiInterstitialAdConfig builder.");
return false;
}
kwaiInterstitialAdConfig.Call<AndroidJavaObject>(WithKwaiInterstitialAdListenerMethodName, _InterstitialAdListener);
var kwaiInterstitialAdAdLoader = loaderManager.Call<AndroidJavaObject>(BuildInterstitialAdLoaderMethodName, kwaiInterstitialAdConfig.Call<AndroidJavaObject>("build"));
var adRequest = new AndroidJavaObject(KwaiInterstitialAdRequestClassName, request.TagId);
string floorPrice = request.ExtParams[Constants.Request.BID_FLOOR_PRICE];
if (floorPrice != null && floorPrice.Length != 0)
{
Debug.Log($"{TAG}: floorPrice: {floorPrice}.");
adRequest.Get<AndroidJavaObject>("extParams").Call<AndroidJavaObject>("put", Constants.Request.BID_FLOOR_PRICE, floorPrice);
}
kwaiInterstitialAdAdLoader.Call("loadAd", adRequest);
}
return true;
}
public void Show()
{
if (IsReady())
{
AndroidJavaObject currentActivity = AndroidPlatformTool.GetGameActivity();
if (currentActivity == null)
{
Debug.Log($"{TAG}: Current Game Activity not found.");
}
else
{
Debug.Log($"{TAG}: start showing.");
_KwaiInterstitialAd.Call("show", currentActivity);
}
}
else
{
Debug.Log($"{TAG}: IsLoaded: {IsLoaded()}, IsReady: {IsReady()}.");
}
}
public void Destroy()
{
if (_AdLoadListener != null)
{
_AdLoadListener.Destory();
_AdLoadListener = null;
}
if (_InterstitialAdListener != null)
{
_InterstitialAdListener.Destory();
}
_KwaiInterstitialAd = null;
}
public bool IsLoaded()
{
return _KwaiInterstitialAd != null;
}
public bool IsReady()
{
return IsLoaded() && _KwaiInterstitialAd.Call<bool>("isReady");
}
public void NotifyLoss()
{
if (_KwaiInterstitialAd != null)
{
_KwaiInterstitialAd.Call("getBidController", "sendBidLose");
}
}
public void NotifyWin()
{
if (_KwaiInterstitialAd != null)
{
_KwaiInterstitialAd.Call("getBidController", "sendBidWin");
}
}
private class AdLoadListener : AndroidJavaProxy
{
private IInterstitialAdLoadListener _InterstitialAdLoadListener;
private KwaiInterstitialAdController _KwaiInterstitialAdController;
public AdLoadListener(IInterstitialAdLoadListener interstitialAdLoadListener, KwaiInterstitialAdController kwaiInterstitialAdController) : base(AdLoadListenerClassName)
{
this._InterstitialAdLoadListener = interstitialAdLoadListener;
this._KwaiInterstitialAdController = kwaiInterstitialAdController;
}
public void onAdLoadStart(string trackId)
{
Debug.Log($"{TAG}: onAdLoadStart");
if (_InterstitialAdLoadListener != null)
{
_InterstitialAdLoadListener.OnAdLoadStart(trackId);
}
}
public void onAdLoadSuccess(string trackId, AndroidJavaObject kwaiInterstitialAd)
{
_KwaiInterstitialAdController._KwaiInterstitialAd = kwaiInterstitialAd;
string price = kwaiInterstitialAd.Call<string>("getPrice");
Debug.Log($"{TAG}: onAdLoaded: {kwaiInterstitialAd.Call<string>("getPrice")}");
if (_InterstitialAdLoadListener != null)
{
_InterstitialAdLoadListener.OnAdLoadSuccess(trackId, price);
}
}
public void onAdLoadFailed(string trackId, AndroidJavaObject kwaiError)
{
int code = kwaiError.Call<int>("getCode");
string msg = kwaiError.Call<string>("getMsg");
Debug.LogError($"{TAG}: onAdLoadFailed code = {code} msg = {msg}");
if (_InterstitialAdLoadListener != null)
{
_InterstitialAdLoadListener.OnAdLoadFailed(trackId, code, msg);
}
}
public void Destory()
{
_InterstitialAdLoadListener = null;
_KwaiInterstitialAdController = null;
}
}
private class InterstitialAdListener : AndroidJavaProxy
{
private IInterstitialAdListener _InterstitialAdListener;
public InterstitialAdListener(IInterstitialAdListener interstitialAdListener) : base(KwaiInterstitialAdListenerClassName)
{
_InterstitialAdListener = interstitialAdListener;
}
public void onAdShow()
{
Debug.Log($"{TAG}: onAdShow");
if (_InterstitialAdListener != null)
{
_InterstitialAdListener.OnAdShow();
}
}
public void onAdShowFailed(AndroidJavaObject error)
{
int code = error.Call<int>("getCode");
string msg = error.Call<string>("getMsg");
Debug.LogError($"{TAG}: onAdShowFailed code = {code} msg = {msg}");
if (_InterstitialAdListener != null)
{
_InterstitialAdListener.OnAdShowFailed(code, msg);
}
}
public void onAdClick()
{
Debug.Log($"{TAG}: onAdClick");
if (_InterstitialAdListener != null)
{
_InterstitialAdListener.OnAdClick();
}
}
public void onAdClose()
{
Debug.Log($"{TAG}: onAdClose");
if (_InterstitialAdListener != null)
{
_InterstitialAdListener.OnAdClose();
}
}
public void onAdPlayComplete()
{
Debug.Log($"{TAG}: onAdPlayComplete");
if (_InterstitialAdListener != null)
{
_InterstitialAdListener.OnAdPlayComplete();
}
}
public void Destory()
{
_InterstitialAdListener = null;
}
}
}
}
#endif

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0981c7bc6c3f9404e8effcfa265e2632
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,248 @@
#if UNITY_ANDROID
using BigoAds.Scripts.Platforms.Android;
using KwaiAds.Scripts.Api;
using KwaiAds.Scripts.Api.Reward;
using UnityEngine;
namespace KwaiAds.Scripts.Platforms.Android
{
public class KwaiRewardAdController : IRewardAdController
{
private const string TAG = "[KwaiAdSDK-RewardAdController]";
private const string RewardedAdConfigBuilderClassName = AndroidPlatformTool.ClassPackage + ".loader.business.reward.data.KwaiRewardAdConfig$Builder";
private const string KwaiRewardAdListenerClassName = AndroidPlatformTool.ClassPackage + ".loader.business.reward.interf.IKwaiRewardAdListener";
private const string AdLoadListenerClassName = AndroidPlatformTool.ClassPackage + ".loader.common.interf.AdLoadListener";
private const string KwaiRewardAdRequestClassName = AndroidPlatformTool.ClassPackage + ".loader.business.reward.data.KwaiRewardAdRequest";
private const string KwaiAdLoaderManagerMethodName = "getKwaiAdLoaderManager";
private const string WithKwaiRewardAdListenerMethodName = "withKwaiRewardAdListener";
private const string BuildRewardAdLoaderMethodName = "buildRewardAdLoader";
private AndroidJavaClass _KwaiAdSDKInit;
private AdLoadListener _AdLoadListener;
private RewardAdListener _RewardAdListener;
private AndroidJavaObject _KwaiRewardAd;
public bool Load(KwaiRewardAdRequest request, IRewardAdListener rewardAdListener, IRewardAdLoadListener rewardAdLoadListener)
{
_KwaiAdSDKInit = Android.KwaiAdSDKInit.Instance.GetKwaiAdSDKClass();
if (_KwaiAdSDKInit == null)
{
Debug.Log($"{TAG}: kwaiAdSDKInit is null.");
return false;
}
var loaderManager = _KwaiAdSDKInit.CallStatic<AndroidJavaObject>(KwaiAdLoaderManagerMethodName);
if (loaderManager == null)
{
Debug.Log($"{TAG}: loaderManager is null.");
return false;
}
else
{
_AdLoadListener = new AdLoadListener(rewardAdLoadListener, this);
_RewardAdListener = new RewardAdListener(rewardAdListener);
var kwaiRewardAdConfig = new AndroidJavaObject(RewardedAdConfigBuilderClassName, _AdLoadListener);
if (kwaiRewardAdConfig == null)
{
Debug.LogError($"{TAG}:Failed to create kwaiRewardAdConfig builder.");
return false;
}
kwaiRewardAdConfig.Call<AndroidJavaObject>(WithKwaiRewardAdListenerMethodName, _RewardAdListener);
var kwaiRewardAdAdLoader = loaderManager.Call<AndroidJavaObject>(BuildRewardAdLoaderMethodName, kwaiRewardAdConfig.Call<AndroidJavaObject>("build"));
var adRequest = new AndroidJavaObject(KwaiRewardAdRequestClassName, request.TagId);
string floorPrice = request.ExtParams[Constants.Request.BID_FLOOR_PRICE];
if (floorPrice != null && floorPrice.Length != 0)
{
Debug.Log($"{TAG}: floorPrice: {floorPrice}.");
adRequest.Get<AndroidJavaObject>("extParams").Call<AndroidJavaObject>("put", Constants.Request.BID_FLOOR_PRICE, floorPrice);
}
kwaiRewardAdAdLoader.Call("loadAd", adRequest);
}
return true;
}
public void Show()
{
if (IsReady())
{
AndroidJavaObject currentActivity = AndroidPlatformTool.GetGameActivity();
if (currentActivity == null)
{
Debug.Log($"{TAG}: Current Game Activity not found.");
}
else
{
Debug.Log($"{TAG}: start showing.");
_KwaiRewardAd.Call("show", currentActivity);
}
}
else
{
Debug.Log($"{TAG}: IsLoaded: {IsLoaded()}, IsReady: {IsReady()}.");
}
}
public void Destroy()
{
if (_AdLoadListener != null)
{
_AdLoadListener.Destory();
_AdLoadListener = null;
}
if (_RewardAdListener != null)
{
_RewardAdListener.Destory();
}
_KwaiRewardAd = null;
}
public bool IsLoaded()
{
return _KwaiRewardAd != null;
}
public bool IsReady()
{
return IsLoaded() && _KwaiRewardAd.Call<bool>("isReady");
}
public void NotifyLoss()
{
if (_KwaiRewardAd != null)
{
_KwaiRewardAd.Call("getBidController", "sendBidLose");
}
}
public void NotifyWin()
{
if (_KwaiRewardAd != null)
{
_KwaiRewardAd.Call("getBidController", "sendBidWin");
}
}
private class AdLoadListener : AndroidJavaProxy
{
private IRewardAdLoadListener _RewardAdLoadListener;
private KwaiRewardAdController _KwaiRewardAdController;
public AdLoadListener(IRewardAdLoadListener rewardAdListener, KwaiRewardAdController kwaiRewardAdController) : base(AdLoadListenerClassName)
{
this._RewardAdLoadListener = rewardAdListener;
this._KwaiRewardAdController = kwaiRewardAdController;
}
public void onAdLoadStart(string trackId)
{
Debug.Log($"{TAG}: onAdLoadStart");
if (_RewardAdLoadListener != null)
{
_RewardAdLoadListener.OnAdLoadStart(trackId);
}
}
public void onAdLoadSuccess(string trackId, AndroidJavaObject kwaiRewardAd)
{
_KwaiRewardAdController._KwaiRewardAd = kwaiRewardAd;
string price = kwaiRewardAd.Call<string>("getPrice");
Debug.Log($"{TAG}: onAdLoaded: {kwaiRewardAd.Call<string>("getPrice")}");
if (_RewardAdLoadListener != null)
{
_RewardAdLoadListener.OnAdLoadSuccess(trackId, price);
}
}
public void onAdLoadFailed(string trackId, AndroidJavaObject kwaiError)
{
int code = kwaiError.Call<int>("getCode");
string msg = kwaiError.Call<string>("getMsg");
Debug.LogError($"{TAG}: onAdLoadFailed code = {code} msg = {msg}");
if (_RewardAdLoadListener != null)
{
_RewardAdLoadListener.OnAdLoadFailed(trackId, code, msg);
}
}
public void Destory()
{
_RewardAdLoadListener = null;
_KwaiRewardAdController = null;
}
}
private class RewardAdListener : AndroidJavaProxy
{
private IRewardAdListener _RewardAdListener;
public RewardAdListener(IRewardAdListener rewardAdListener) : base(KwaiRewardAdListenerClassName) {
_RewardAdListener = rewardAdListener;
}
public void onAdShow()
{
Debug.Log($"{TAG}: onAdShow");
if (_RewardAdListener != null)
{
_RewardAdListener.OnAdShow();
}
}
public void onAdShowFailed(AndroidJavaObject error)
{
int code = error.Call<int>("getCode");
string msg = error.Call<string>("getMsg");
Debug.LogError($"{TAG}: onAdShowFailed code = {code} msg = {msg}");
if (_RewardAdListener != null)
{
_RewardAdListener.OnAdShowFailed(code, msg);
}
}
public void onAdClick()
{
Debug.Log($"{TAG}: onAdClick");
if (_RewardAdListener != null)
{
_RewardAdListener.OnAdClick();
}
}
public void onAdPlayComplete()
{
Debug.Log($"{TAG}: onAdPlayComplete");
if (_RewardAdListener != null)
{
_RewardAdListener.OnAdPlayComplete();
}
}
public void onRewardEarned()
{
Debug.Log($"{TAG}: onRewarded");
if (_RewardAdListener != null)
{
_RewardAdListener.OnRewardEarned();
}
}
public void onAdClose()
{
Debug.Log($"{TAG}: onAdClose");
if (_RewardAdListener != null)
{
_RewardAdListener.OnAdClose();
}
}
public void Destory()
{
_RewardAdListener = null;
}
}
}
}
#endif

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ac60b4b82a68d4feb811961ea98ad413
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,27 @@
#if UNITY_ANDROID
using KwaiAds.Scripts.Api;
using KwaiAds.Scripts.Api.Interstitial;
using KwaiAds.Scripts.Api.Reward;
using KwaiAds.Scripts.Common;
namespace KwaiAds.Scripts.Platforms.Android
{
public class KwaiSdkClient: ISDK
{
public void Init(KwaiAdConfig config, InitResultCallback initResultCallback)
{
KwaiAdSDKInit.Initialize(config, initResultCallback);
}
public IRewardAdController getRewardAdController()
{
return new KwaiRewardAdController();
}
public IInterstitialAdController getInterstitialAdController()
{
return new KwaiInterstitialAdController();
}
}
}
#endif

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 440ab8edeedf747c48701c4009831273
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,19 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!11 &1
AudioManager:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Volume: 1
Rolloff Scale: 1
Doppler Factor: 1
Default Speaker Mode: 2
m_SampleRate: 0
m_DSPBufferSize: 1024
m_VirtualVoiceCount: 512
m_RealVoiceCount: 32
m_SpatializerPlugin:
m_AmbisonicDecoderPlugin:
m_DisableAudio: 0
m_VirtualizeEffects: 1
m_RequestedDSPBufferSize: 0

View File

@ -0,0 +1,6 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!236 &1
ClusterInputManager:
m_ObjectHideFlags: 0
m_Inputs: []

View File

@ -0,0 +1,37 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!55 &1
PhysicsManager:
m_ObjectHideFlags: 0
serializedVersion: 13
m_Gravity: {x: 0, y: -9.81, z: 0}
m_DefaultMaterial: {fileID: 0}
m_BounceThreshold: 2
m_DefaultMaxDepenetrationVelocity: 10
m_SleepThreshold: 0.005
m_DefaultContactOffset: 0.01
m_DefaultSolverIterations: 6
m_DefaultSolverVelocityIterations: 1
m_QueriesHitBackfaces: 0
m_QueriesHitTriggers: 1
m_EnableAdaptiveForce: 0
m_ClothInterCollisionDistance: 0.1
m_ClothInterCollisionStiffness: 0.2
m_ContactsGeneration: 1
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_AutoSimulation: 1
m_AutoSyncTransforms: 0
m_ReuseCollisionCallbacks: 1
m_ClothInterCollisionSettingsToggle: 0
m_ClothGravity: {x: 0, y: -9.81, z: 0}
m_ContactPairsMode: 0
m_BroadphaseType: 0
m_WorldBounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 250, y: 250, z: 250}
m_WorldSubdivisions: 8
m_FrictionType: 0
m_EnableEnhancedDeterminism: 0
m_EnableUnifiedHeightmaps: 1
m_SolverType: 0
m_DefaultMaxAngularSpeed: 50

View File

@ -0,0 +1,11 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1045 &1
EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes:
- enabled: 1
path: Assets/Scenes/GameScene.unity
guid: 2cda990e2423bbf4892e6590ba056729
m_configObjects: {}

View File

@ -0,0 +1,40 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!159 &1
EditorSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_SerializationMode: 2
m_LineEndingsForNewScripts: 0
m_DefaultBehaviorMode: 1
m_PrefabRegularEnvironment: {fileID: 0}
m_PrefabUIEnvironment: {fileID: 0}
m_SpritePackerMode: 4
m_SpritePackerPaddingPower: 1
m_EtcTextureCompressorBehavior: 1
m_EtcTextureFastCompressor: 1
m_EtcTextureNormalCompressor: 2
m_EtcTextureBestCompressor: 4
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;asmref;rsp
m_ProjectGenerationRootNamespace:
m_EnableTextureStreamingInEditMode: 1
m_EnableTextureStreamingInPlayMode: 1
m_AsyncShaderCompilation: 1
m_CachingShaderPreprocessor: 1
m_PrefabModeAllowAutoSave: 1
m_EnterPlayModeOptionsEnabled: 0
m_EnterPlayModeOptions: 3
m_GameObjectNamingDigits: 1
m_GameObjectNamingScheme: 0
m_AssetNamingUsesSpace: 1
m_UseLegacyProbeSampleCount: 0
m_SerializeInlineMappingsOnOneLine: 1
m_DisableCookiesInLightmapper: 1
m_AssetPipelineMode: 1
m_CacheServerMode: 0
m_CacheServerEndpoint:
m_CacheServerNamespacePrefix: default
m_CacheServerEnableDownload: 1
m_CacheServerEnableUpload: 1
m_CacheServerEnableAuth: 0
m_CacheServerEnableTls: 0

View File

@ -0,0 +1,64 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!30 &1
GraphicsSettings:
m_ObjectHideFlags: 0
serializedVersion: 13
m_Deferred:
m_Mode: 1
m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0}
m_DeferredReflections:
m_Mode: 1
m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0}
m_ScreenSpaceShadows:
m_Mode: 1
m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0}
m_LegacyDeferred:
m_Mode: 1
m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0}
m_DepthNormals:
m_Mode: 1
m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0}
m_MotionVectors:
m_Mode: 1
m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0}
m_LightHalo:
m_Mode: 1
m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0}
m_LensFlare:
m_Mode: 1
m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0}
m_VideoShadersIncludeMode: 2
m_AlwaysIncludedShaders:
- {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0}
m_PreloadedShaders: []
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_CustomRenderPipeline: {fileID: 0}
m_TransparencySortMode: 0
m_TransparencySortAxis: {x: 0, y: 0, z: 1}
m_DefaultRenderingPath: 1
m_DefaultMobileRenderingPath: 1
m_TierSettings: []
m_LightmapStripping: 0
m_FogStripping: 0
m_InstancingStripping: 0
m_LightmapKeepPlain: 1
m_LightmapKeepDirCombined: 1
m_LightmapKeepDynamicPlain: 1
m_LightmapKeepDynamicDirCombined: 1
m_LightmapKeepShadowMask: 1
m_LightmapKeepSubtractive: 1
m_FogKeepLinear: 1
m_FogKeepExp: 1
m_FogKeepExp2: 1
m_AlbedoSwatchInfos: []
m_LightsUseLinearIntensity: 0
m_LightsUseColorTemperature: 0
m_DefaultRenderingLayerMask: 1
m_LogWhenShaderIsCompiled: 0

View File

@ -0,0 +1,487 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!13 &1
InputManager:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Axes:
- serializedVersion: 3
m_Name: Horizontal
descriptiveName:
descriptiveNegativeName:
negativeButton: left
positiveButton: right
altNegativeButton: a
altPositiveButton: d
gravity: 3
dead: 0.001
sensitivity: 3
snap: 1
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Vertical
descriptiveName:
descriptiveNegativeName:
negativeButton: down
positiveButton: up
altNegativeButton: s
altPositiveButton: w
gravity: 3
dead: 0.001
sensitivity: 3
snap: 1
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire1
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: left ctrl
altNegativeButton:
altPositiveButton: mouse 0
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire2
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: left alt
altNegativeButton:
altPositiveButton: mouse 1
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire3
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: left shift
altNegativeButton:
altPositiveButton: mouse 2
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Jump
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: space
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Mouse X
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 0
dead: 0
sensitivity: 0.1
snap: 0
invert: 0
type: 1
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Mouse Y
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 0
dead: 0
sensitivity: 0.1
snap: 0
invert: 0
type: 1
axis: 1
joyNum: 0
- serializedVersion: 3
m_Name: Mouse ScrollWheel
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 0
dead: 0
sensitivity: 0.1
snap: 0
invert: 0
type: 1
axis: 2
joyNum: 0
- serializedVersion: 3
m_Name: Horizontal
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 0
dead: 0.19
sensitivity: 1
snap: 0
invert: 0
type: 2
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Vertical
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 0
dead: 0.19
sensitivity: 1
snap: 0
invert: 1
type: 2
axis: 1
joyNum: 0
- serializedVersion: 3
m_Name: Fire1
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: joystick button 0
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire2
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: joystick button 1
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire3
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: joystick button 2
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Jump
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: joystick button 3
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Submit
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: return
altNegativeButton:
altPositiveButton: joystick button 0
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Submit
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: enter
altNegativeButton:
altPositiveButton: space
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Cancel
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: escape
altNegativeButton:
altPositiveButton: joystick button 1
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Enable Debug Button 1
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: left ctrl
altNegativeButton:
altPositiveButton: joystick button 8
gravity: 0
dead: 0
sensitivity: 0
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Enable Debug Button 2
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: backspace
altNegativeButton:
altPositiveButton: joystick button 9
gravity: 0
dead: 0
sensitivity: 0
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Debug Reset
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: left alt
altNegativeButton:
altPositiveButton: joystick button 1
gravity: 0
dead: 0
sensitivity: 0
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Debug Next
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: page down
altNegativeButton:
altPositiveButton: joystick button 5
gravity: 0
dead: 0
sensitivity: 0
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Debug Previous
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: page up
altNegativeButton:
altPositiveButton: joystick button 4
gravity: 0
dead: 0
sensitivity: 0
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Debug Validate
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: return
altNegativeButton:
altPositiveButton: joystick button 0
gravity: 0
dead: 0
sensitivity: 0
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Debug Persistent
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: right shift
altNegativeButton:
altPositiveButton: joystick button 2
gravity: 0
dead: 0
sensitivity: 0
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Debug Multiplier
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: left shift
altNegativeButton:
altPositiveButton: joystick button 3
gravity: 0
dead: 0
sensitivity: 0
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Debug Horizontal
descriptiveName:
descriptiveNegativeName:
negativeButton: left
positiveButton: right
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Debug Vertical
descriptiveName:
descriptiveNegativeName:
negativeButton: down
positiveButton: up
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Debug Vertical
descriptiveName:
descriptiveNegativeName:
negativeButton: down
positiveButton: up
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 2
axis: 6
joyNum: 0
- serializedVersion: 3
m_Name: Debug Horizontal
descriptiveName:
descriptiveNegativeName:
negativeButton: left
positiveButton: right
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 2
axis: 5
joyNum: 0

View File

@ -0,0 +1,35 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!387306366 &1
MemorySettings:
m_ObjectHideFlags: 0
m_EditorMemorySettings:
m_MainAllocatorBlockSize: -1
m_ThreadAllocatorBlockSize: -1
m_MainGfxBlockSize: -1
m_ThreadGfxBlockSize: -1
m_CacheBlockSize: -1
m_TypetreeBlockSize: -1
m_ProfilerBlockSize: -1
m_ProfilerEditorBlockSize: -1
m_BucketAllocatorGranularity: -1
m_BucketAllocatorBucketsCount: -1
m_BucketAllocatorBlockSize: -1
m_BucketAllocatorBlockCount: -1
m_ProfilerBucketAllocatorGranularity: -1
m_ProfilerBucketAllocatorBucketsCount: -1
m_ProfilerBucketAllocatorBlockSize: -1
m_ProfilerBucketAllocatorBlockCount: -1
m_TempAllocatorSizeMain: -1
m_JobTempAllocatorBlockSize: -1
m_BackgroundJobTempAllocatorBlockSize: -1
m_JobTempAllocatorReducedBlockSize: -1
m_TempAllocatorSizeGIBakingWorker: -1
m_TempAllocatorSizeNavMeshWorker: -1
m_TempAllocatorSizeAudioWorker: -1
m_TempAllocatorSizeCloudWorker: -1
m_TempAllocatorSizeGfx: -1
m_TempAllocatorSizeJobWorker: -1
m_TempAllocatorSizeBackgroundWorker: -1
m_TempAllocatorSizePreloadManager: -1
m_PlatformMemorySettings: {}

View File

@ -0,0 +1,93 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!126 &1
NavMeshProjectSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
areas:
- name: Walkable
cost: 1
- name: Not Walkable
cost: 1
- name: Jump
cost: 2
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
m_LastAgentTypeID: -887442657
m_Settings:
- serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.75
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_SettingNames:
- Humanoid

View File

@ -0,0 +1,8 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!149 &1
NetworkManager:
m_ObjectHideFlags: 0
m_DebugLevel: 0
m_Sendrate: 15
m_AssetToPrefab: {}

View File

@ -0,0 +1,44 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &1
MonoBehaviour:
m_ObjectHideFlags: 61
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: 13964, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_EnablePreReleasePackages: 0
m_EnablePackageDependencies: 0
m_AdvancedSettingsExpanded: 1
m_ScopedRegistriesSettingsExpanded: 1
m_SeeAllPackageVersions: 0
oneTimeWarningShown: 0
m_Registries:
- m_Id: main
m_Name:
m_Url: https://packages.unity.com
m_Scopes: []
m_IsDefault: 1
m_Capabilities: 7
m_UserSelectedRegistryName:
m_UserAddingNewScopedRegistry: 0
m_RegistryInfoDraft:
m_ErrorMessage:
m_Original:
m_Id:
m_Name:
m_Url:
m_Scopes: []
m_IsDefault: 0
m_Capabilities: 0
m_Modified: 0
m_Name:
m_Url:
m_Scopes:
-
m_SelectedScopeIndex: 0

View File

@ -0,0 +1,56 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!19 &1
Physics2DSettings:
m_ObjectHideFlags: 0
serializedVersion: 5
m_Gravity: {x: 0, y: -9.81}
m_DefaultMaterial: {fileID: 0}
m_VelocityIterations: 8
m_PositionIterations: 3
m_VelocityThreshold: 1
m_MaxLinearCorrection: 0.2
m_MaxAngularCorrection: 8
m_MaxTranslationSpeed: 100
m_MaxRotationSpeed: 360
m_BaumgarteScale: 0.2
m_BaumgarteTimeOfImpactScale: 0.75
m_TimeToSleep: 0.5
m_LinearSleepTolerance: 0.01
m_AngularSleepTolerance: 2
m_DefaultContactOffset: 0.01
m_JobOptions:
serializedVersion: 2
useMultithreading: 0
useConsistencySorting: 0
m_InterpolationPosesPerJob: 100
m_NewContactsPerJob: 30
m_CollideContactsPerJob: 100
m_ClearFlagsPerJob: 200
m_ClearBodyForcesPerJob: 200
m_SyncDiscreteFixturesPerJob: 50
m_SyncContinuousFixturesPerJob: 50
m_FindNearestContactsPerJob: 100
m_UpdateTriggerContactsPerJob: 100
m_IslandSolverCostThreshold: 100
m_IslandSolverBodyCostScale: 1
m_IslandSolverContactCostScale: 10
m_IslandSolverJointCostScale: 10
m_IslandSolverBodiesPerJob: 50
m_IslandSolverContactsPerJob: 50
m_SimulationMode: 0
m_QueriesHitTriggers: 1
m_QueriesStartInColliders: 1
m_CallbacksOnDisable: 1
m_ReuseCollisionCallbacks: 1
m_AutoSyncTransforms: 0
m_AlwaysShowColliders: 0
m_ShowColliderSleep: 1
m_ShowColliderContacts: 0
m_ShowColliderAABB: 0
m_ContactArrowScale: 0.2
m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412}
m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432}
m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745}
m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804}
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

Some files were not shown because too many files have changed in this diff Show More