Commit 5d745df5 authored by LiLiuZhou's avatar LiLiuZhou

11

parents 0c28490e 9b00e133
......@@ -117,7 +117,7 @@ public class AdManager
return;
#endif
//穿山甲
if (ZXADConfig.Instance.CSJ_AD_APP_ID != null&& ZXADConfig.Instance.CSJ_AD_APP_ID!="")
if (ZXADConfig.Instance.CSJ_AD_APP_ID != null && ZXADConfig.Instance.CSJ_AD_APP_ID != "")
{
#if UNITY_ANDROID
......@@ -153,7 +153,7 @@ public class AdManager
ZXHCADManager.Init(ZXADConfig.Instance.HC_AD_APP_ID, Constant.Instance.IsTestNet);
#endif
}
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "ZXADConfig.Instance.HC_AD_APP_ID "+ ZXADConfig.Instance.HC_AD_APP_ID);
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "ZXADConfig.Instance.HC_AD_APP_ID " + ZXADConfig.Instance.HC_AD_APP_ID);
//风行
#if UNITY_ANDROID
AndroidJavaClass jc3 = new AndroidJavaClass("com.ym.admodule.fs.FunShionManager");
......@@ -206,7 +206,7 @@ public class AdManager
// listener.onError("code" + code + "没有默认配置 errMsg" + errMsg);
// listener.onLastError();
//}
listener.onError(code + "errormsg" +errMsg);
listener.onError(code + "errormsg" + errMsg);
listener.onLastError();
}));
......@@ -306,7 +306,7 @@ public class AdManager
CSJSplshADUtils.Instance.LoadSplshAd(entity, GetActivity(), GetSplashAdManager(), listener, callback);
#elif UNITY_IOS
//加载穿山甲开屏广告
CSJSplshADUtils.Instance.LoadSplshAd(entity,null, null, listener, callback);
CSJSplshADUtils.Instance.LoadSplshAd(entity, null, null, listener, callback);
#endif
break;
......@@ -594,7 +594,7 @@ public class AdManager
if (bl)
{
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "大图缓存成功 " + entity.adPlatform + " CodeID " + entity.codeId);
//保存插屏缓存数据
//保存大图缓存数据
ZXADConfig.Instance.SetAdCache(sloatName, entity, "");
}
else
......@@ -850,7 +850,7 @@ public class AdManager
{
entity.actionName = actionName;
ZXADConfig.Instance.RemoveAdCache(slotName, "");
mPlayCacheInterstitialAdPlatform(entity,listener, new Action<bool>((bl) =>
mPlayCacheInterstitialAdPlatform(entity, listener, new Action<bool>((bl) =>
{
if (bl)
{
......@@ -885,7 +885,7 @@ public class AdManager
#if UNITY_ANDROID
case ZXADConfig.PLANTFORM_AD_KUS:
//快手插屏广告加载
KsInterstitialAdUtils.Instance.PlayCacheInterstitialAd(entity, callback,listener);
KsInterstitialAdUtils.Instance.PlayCacheInterstitialAd(entity, callback, listener);
break;
#endif
default:
......@@ -1289,6 +1289,15 @@ public class AdManager
if (adList == null || adList.Count == 0)
{
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "激励视频A组没有数据");
ADLoading.Instance().loadFailCount++;
if (ADLoading.Instance().loadFailCount == 2)
{
ADLoading.Instance().HideADLoading();
ADLoading.Instance().loadFailCount = 0;
}
return;
}
if (IsFirstLoadRewardAd)
......@@ -1333,6 +1342,7 @@ public class AdManager
if (ADLoading.Instance().loadFailCount == 2)
{
ADLoading.Instance().HideADLoading();
ADLoading.Instance().loadFailCount = 0;
}
}
......@@ -1353,6 +1363,15 @@ public class AdManager
if (adList == null || adList.Count == 0)
{
Debug.unityLogger.Log(ZXADConfig.ADManagerTAG, "激励视频B组没有数据");
ADLoading.Instance().loadFailCount++;
if (ADLoading.Instance().loadFailCount == 2)
{
ADLoading.Instance().HideADLoading();
ADLoading.Instance().loadFailCount = 0;
}
return;
}
List<AdEntity> totalEntityList = adList;
......@@ -1390,6 +1409,7 @@ public class AdManager
if (ADLoading.Instance().loadFailCount == 2)
{
ADLoading.Instance().HideADLoading();
ADLoading.Instance().loadFailCount = 0;
}
}
......
......@@ -48,7 +48,7 @@ namespace Tencent.GDT
{
return;
}
loadListeners.Add((int) rewardVideoAd, listener);
loadListeners[(int) rewardVideoAd] = listener;
}
public void SetEnableDefaultAudioSessionSetting(bool audioSessionSetting)
......
......@@ -49,7 +49,7 @@ namespace Tencent.GDT
{
return;
}
loadListeners.Add((int)this.nativeExpressAd, listener);
loadListeners[(int)this.nativeExpressAd] = listener;
}
public void LoadAd(int count)
......
......@@ -14,7 +14,11 @@ public class ConfigXcode
// 只处理IOS工程, pathToBuildProject会传入导出的ios工程的根目录
        if (buildTarget != BuildTarget.iOS)
return;
// ----------------------------- 修改main.mm文件 -----------------------------
var mainAppPath = Path.Combine(pathToBuiltProject, "MainApp", "main.mm");
var mainContent = File.ReadAllText(mainAppPath);
var newContent = mainContent.Replace("#include <UnityFramework/UnityFramework.h>", @"#include ""../UnityFramework/UnityFramework.h""");
File.WriteAllText(mainAppPath, newContent);
// ----------------------------- 创建工程设置对象 -----------------------------
var projectPath = pathToBuiltProject + "/Unity-iPhone.xcodeproj/project.pbxproj";
......@@ -27,7 +31,7 @@ public class ConfigXcode
// ----------------------------- 修改BITCODE设置的例子 -----------------------------
project.SetBuildProperty(mainTargetGuid, "ENABLE_BITCODE", "NO");
// ----------------------------- 添加framework -----------------------------
// ----------------------------- 设置framework -----------------------------
project.AddFrameworkToProject(frameworkTargetGuid, "AppTrackingTransparency.framework", false);
project.AddFrameworkToProject(frameworkTargetGuid, "libz.dylib", false);
project.AddFrameworkToProject(frameworkTargetGuid, "libsqlite3.tbd", false);
......
......@@ -12,6 +12,24 @@ PluginImporter:
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
Exclude iOS: 0
- first:
Android: Android
second:
enabled: 0
settings:
CPU: ARMv7
- first:
Any:
second:
......@@ -20,9 +38,44 @@ PluginImporter:
- first:
Editor: Editor
second:
enabled: 1
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86_64
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: x86_64
- first:
iPhone: iOS
second:
enabled: 1
settings:
AddToEmbeddedBinaries: false
CPU: AnyCPU
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:
......@@ -67,6 +67,10 @@ public class AdUtils
public void onAdClose(AdEntity entity)
{
#if UNITY_IOS
Time.timeScale = 1;
#endif
Debug.Log("音乐是否开关的值"+ PlayerPrefs.GetInt("IS_OPEN_MUSIC", 0));
if(PlayerPrefs.GetInt("IS_OPEN_MUSIC", 0) == 0)
{
......@@ -107,6 +111,9 @@ public class AdUtils
public void onAdShow()
{
#if UNITY_IOS
Time.timeScale = 0;
#endif
AudioUtils.ins.music.Stop();
EventUtils.OnEvent("video_show");
......@@ -212,6 +219,9 @@ public class AdUtils
public void onError(string errorMsg)
{
#if UNITY_IOS
Time.timeScale = 1;
#endif
callback(false);
}
......
......@@ -334,52 +334,57 @@ public class CarUIControl : MonoBehaviour
currentCarTime = (int)entity.landPlantData.growthLastSecond;
//设置暂停状态
setPauseTime(currentCarTime);
//关闭上一次倒计时
if (timeControl != null)
{
StopCoroutine(timeControl);
}
if (currentCarTime > 0)
{
timeControl = StartCoroutine(timeConteller());
}
}
private IEnumerator timeConteller()
{
yield return null;
fruitTimeTv.text = UnityUtil.getCountdown(currentCarTime);
while (currentCarTime >= 0)
{
if (progressBarImg != null)
{
progressBarImg.fillAmount = 1 - (currentCarTime / (float)totalTime);
fruitTimeTv.text = ((1 - (currentCarTime / (float)totalTime)) * 100).ToString("f0") + "%";
}
yield return new WaitForSecondsRealtime(1f);
if (currentCarTime <= 0)
{
//倒计时完成
//关闭上一次倒计时
StopCoroutine(timeControl);
//开启新一轮倒计时 倒计时结束 变换状态
EventCenter.Broadcast(MyEventType.UPDATE_CAR_LIST_DATA);
Guide.guide.onClickStep2();
break;
}
else
{
setPauseTime(currentCarTime);
if (!isPauseTime)
{
//currentCarTime--;
}
}
fruitTimeTv.text = UnityUtil.getCountdown(currentCarTime);
//SaveData.GetIns().saveFlowerLastTime(transform.tag, coinTime);
}
////关闭上一次倒计时
//if (timeControl != null)
//{
// StopCoroutine(timeControl);
//}
//if (currentCarTime > 0)
//{
// timeControl = StartCoroutine(timeConteller());
//}
}
//private IEnumerator timeConteller()
//{
// yield return null;
// fruitTimeTv.text = UnityUtil.getCountdown(currentCarTime);
// while (currentCarTime >= 0)
// {
// if (progressBarImg != null)
// {
// progressBarImg.fillAmount = 1 - (currentCarTime / (float)totalTime);
// fruitTimeTv.text = ((1 - (currentCarTime / (float)totalTime)) * 100).ToString("f0") + "%";
// }
// yield return new WaitForSecondsRealtime(1f);
// if (currentCarTime <= 0)
// {
// //倒计时完成
// //关闭上一次倒计时
// StopCoroutine(timeControl);
// //开启新一轮倒计时 倒计时结束 变换状态
// EventCenter.Broadcast(MyEventType.UPDATE_CAR_LIST_DATA);
// Guide.guide.onClickStep2();
// break;
// }
// else
// {
// setPauseTime(currentCarTime);
// if (!isPauseTime)
// {
// //currentCarTime--;
// }
// }
// fruitTimeTv.text = UnityUtil.getCountdown(currentCarTime);
// //SaveData.GetIns().saveFlowerLastTime(transform.tag, coinTime);
// }
//}
//判断是否暂停
private void setPauseTime(int currentTime)
{
......
......@@ -543,8 +543,13 @@ public class DialogControl : MonoBehaviour
EventUtils.OnEvent("addDiamond_click", "点击钻石加号");
HttpTool.Instance._Get("app/v2/cscmnq/diamond_by_video_status", null, new Action<DiamondStatusBean>((bean) =>
{
<<<<<<< HEAD
DiamondRewardNum = bean.rewardDiamondNum;
=======
DiamondplayNum = bean.playNum;
DiamondRewardNum = bean.rewardDiamondNum;
>>>>>>> 9b00e1332e9bbf41d0221509f4e86bb98a4b5535
if (DiamondplayNum > 0)
{
rdp.Show(bean.rewardDiamondNum);
......@@ -961,7 +966,7 @@ public class DialogControl : MonoBehaviour
if (cb)
{
Debug.Log("关闭宝箱视频");
HttpTool.Instance._Post("app/v1/wdlc/reward/receive_box_reward", null, new Action<BoxReceiveBean>((bean) =>
HttpTool.Instance._Post("app/v2/cscmnq/receive_box_reward", null, new Action<BoxReceiveBean>((bean) =>
{
//OnOpenRewardDialog(bean);
if (bean.currencyType == 10)
......
......@@ -679,7 +679,7 @@ public class HomeInfoControl : MonoBehaviour, HomeContract.View
AudioUtils.ins.PlayBtnAudio();
EventUtils.OnEvent("yijianzhongzhi");
HttpTool.Instance._Post("app/v2/wdlc/seed_by_wd", null, new Action<OrderSeedData>((bean) =>
HttpTool.Instance._Post("app/v2/cscmnq/seed_by_wd", null, new Action<OrderSeedData>((bean) =>
{
//LandListInfo(bean.landList);
// PlayerDataControl.Instance.VideoUnlockCarID = bean.lockNeedWatchVideoStartNum;
......
......@@ -67,7 +67,7 @@ public class StickDialog : MonoBehaviour
{
parm.Clear();
parm["landId"] = cancelStickId;
HttpTool.Instance._Post("app/v1/wdlc/clear_bug", parm, new Action<CleanBugBean>((bean) =>
HttpTool.Instance._Post("app/v2/cscmnq/clear_bug", parm, new Action<CleanBugBean>((bean) =>
{
EventCenter.Broadcast(MyEventType.UPDATE_LAND_DATA, bean.landStatus);
......
......@@ -188,7 +188,7 @@ public class LottlyControl : MonoBehaviour
{
setTurnable(bean);
//rewardType=5 钻石, rewardType=10 现金
//rewardType=20 钻石, rewardType=10 现金
//awardNum
Debug.Log("结果数据"+bean.rewardType+bean.awardCash);
type = bean.rewardType;
......@@ -215,7 +215,7 @@ public class LottlyControl : MonoBehaviour
isTuranable = false;
Debug.unityLogger.Log("ZhuanPanEvent 动画执行完毕");
EventCenter.Broadcast(MyEventType.RefreshLottlyData);
if (type == 5)
if (type == 20)
{
//展示收获钻石弹窗
GameObject.Find("Dialog").GetComponent<DialogControl>().showReceiveDiamondDialog(awardNum.ToString());
......
#import "UnityAppController.h"
#import "WXApi.h"
#import "BridageManager.h"
#import "UserData.h"
#import "KeychainItemManager.h"
#import "WKWebViewController.h"
@interface CustomAppController : UnityAppController < WXApiDelegate >
@end
IMPL_APP_CONTROLLER_SUBCLASS (CustomAppController)
@implementation CustomAppController
#if defined(__cplusplus)
extern "C" {
#endif
// 显示网页
void ShowIOSWebView(char *urlStr, char *titleStr)
{
// GetAppController()获取appController,相当于self
WKWebViewController *vc = [WKWebViewController new];
vc.url = [NSString stringWithUTF8String:urlStr];
vc.showNav = YES;
vc.webTitle = [NSString stringWithUTF8String:titleStr];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
nav.modalPresentationStyle = UIModalPresentationFullScreen;
// 点击按钮后跳转到iOS界面,设置界面为iOS界面
[GetAppController().window.rootViewController presentViewController:nav animated:YES completion:^{
UnityPause(true);
}];
}
// 显示无网络弹窗
void ShowIOSNoWebAlert()
{
UIAlertController *vc = [UIAlertController alertControllerWithTitle:@"无网络连接" message:@"请检查网络环境,并确认开启网络访问权限!" preferredStyle: UIAlertControllerStyleAlert];
UIAlertAction *alert = [UIAlertAction actionWithTitle:@"检查网络" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:nil];
}];
[vc addAction:alert];
// UIWindow *window = [UIApplication sharedApplication].keyWindow;
[GetAppController().window.rootViewController presentViewController:vc animated:YES completion:nil];
}
#if defined(__cplusplus)
}
#endif
-(void)bridageUnity
{
UserData *data = [[UserData alloc] init];
[data initPlist];
[KeychainItemManager readKeychainIDFA];
[[BridageManager shareManager] bridage];
}
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
[super application:application didFinishLaunchingWithOptions:launchOptions];
[self bridageUnity];
NSLog(@"走了1");
return YES;
}
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
[super application:app openURL:url options:options];
NSLog(@"走了2");
if ([WXApi handleOpenURL:url delegate:[BridageManager shareManager]])
{
return YES;
}
return YES;
}
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler
{
[super application:application continueUserActivity:userActivity restorationHandler:restorationHandler];
NSLog(@"走了3");
if ([WXApi handleOpenUniversalLink:userActivity delegate:[BridageManager shareManager]])
{
return YES;
}
return YES;
}
@end
fileFormatVersion: 2
guid: 12e763f1de6c94cb3b95a2517ef41313
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
iPhone: iOS
second:
enabled: 1
settings:
AddToEmbeddedBinaries: false
userData:
assetBundleName:
assetBundleVariant:
......@@ -90,7 +90,7 @@ public class Splash : MonoBehaviour
{
Constant.Instance.shubiao = false;
}
//Constant.Instance.shubiao = true;
Constant.Instance.shubiao = true;
novelInfo();
}), new Action<string, string>((code, errMsg) =>
{
......
......@@ -203,6 +203,9 @@ public class StartControl : MonoBehaviour
int passTime = curTime - lastCloseTime;
if (passTime > Constant.Instance.splash_time && passTime < Constant.Instance.video_time)
{
#if UNITY_IOS
ShowSplashAd();
#else
if (AdUtils.IsShowRewardAd)
{
AdUtils.IsShowRewardAd = false;
......@@ -211,9 +214,13 @@ public class StartControl : MonoBehaviour
{
ShowSplashAd();
}
#endif
}
else if (passTime >= Constant.Instance.video_time)
{
#if UNITY_IOS
ShowRewardAd();
#else
if (AdUtils.IsShowRewardAd)
{
AdUtils.IsShowRewardAd = false;
......@@ -222,6 +229,7 @@ public class StartControl : MonoBehaviour
{
ShowRewardAd();
}
#endif
}
}
......
......@@ -34,7 +34,6 @@ GraphicsSettings:
- {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16003, guid: 0000000000000000f000000000000000, type: 0}
m_PreloadedShaders: []
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
type: 0}
......
......@@ -17,7 +17,7 @@ MonoBehaviour:
m_Registries:
- m_Id: main
m_Name:
m_Url: https://packages.unity.cn
m_Url: https://packages.unity.com
m_Scopes: []
m_IsDefault: 1
m_UserSelectedRegistryName:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment