Commit 95115459 authored by wangxuewei's avatar wangxuewei

[提交人]:王雪伟

[提交简述] :多多菜园1.0.3
[实现方案] :更换游戏资源
parent a2343181
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
......
......@@ -14,7 +14,6 @@ import com.game.luckyfarm.UnityPlayerActivity
import com.umeng.analytics.MobclickAgent
import com.ym.admodule.config.AdManager
import com.ym.admodule.config.ZXADSizeConfig
import com.ym.admodule.listener.ZXADVideoListener
import com.ym.game.activity.WxLoginActivity
import com.ym.game.listener.IDialogViewCloseCallback
import com.ym.game.notif.NotificationService
......@@ -89,8 +88,11 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
AdUtils.loadNextCacheRewardVideoAd(this)
AdUtils.loadFeedCacheAdToCache(this)
AdManager.loadFeedAdToCache(ADConfig.AD_IMG_FADE,this, ZXADSizeConfig(
Utils.px2dip(PhoneUtils.getScreenWidth(this).toFloat()) - 40, 280))
AdManager.loadFeedAdToCache(
ADConfig.AD_IMG_FADE, this, ZXADSizeConfig(
Utils.px2dip(PhoneUtils.getScreenWidth(this).toFloat()) - 40, 280
)
)
}
override fun onDestroy() {
......@@ -149,7 +151,11 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
String::class.java,
String::class.java
)
method.invoke(classtype, gameObjectName, functionName, args)
if (args != null) {
method.invoke(classtype, gameObjectName, functionName, args)
} else {
method.invoke(classtype, gameObjectName, functionName)
}
return true
} catch (e: Exception) {
}
......@@ -215,7 +221,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
MainLooper.get()?.post(Runnable {
if (Utils.isFastClick2()) {
//CashExchangeDialog.showCashExchage(this, this)
PuzzleDialog.showPuzzleDialog(this,this)
PuzzleDialog.showPuzzleDialog(this, this)
}
})
}
......@@ -274,7 +280,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
fun adFlyBox() {
if (flyBoxIsClick) {
flyBoxIsClick = false
AdUtils.playRewardAd(this,"box_click",object :IAdVideoListener {
AdUtils.playRewardAd(this, "box_click", object : IAdVideoListener {
override fun onAdClose() {
flyBoxIsClick = true
getFlyBoxReceive()
......@@ -295,7 +301,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
fun adRedPackPlan() {
if (flyBoxIsClick2) {
flyBoxIsClick2 = false
AdUtils.playRewardAd(this,"bottom_open_red_envelope_click",object :IAdVideoListener {
AdUtils.playRewardAd(this, "bottom_open_red_envelope_click", object : IAdVideoListener {
override fun onAdClose() {
flyBoxIsClick2 = true
getRedPackPlanReceive();
......@@ -348,6 +354,25 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
})
}
/**
* 获取地块列表
* */
fun getListLandNew(from: Int) {
Log.d("Wxw", "初始化地块列表成功$from")
GameApiClient.gameApi.getListLand().compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<List<LandListEntity>>() {
override fun onSuccess(result: List<LandListEntity>?) {
var json = "{\"landList\":" + Utils.obj2Str(result) + "}"
Log.d("Wxw", "初始化地块列表成功$from$json")
callUnity("Canvas", "loadLandListSuccess", json)
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
Log.d("Wxw", "初始化地块列表失败$from")
}
})
}
fun getGuide(callback: IUnitySendMessageCallback?) {
GameApiClient.gameApi.getGuide().compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<GuideEntity>() {
......@@ -410,14 +435,17 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
View.OnClickListener {
GameEvent("click_receive_redPack_double", "点击六倍领取")
Log.d("wxw", "签到翻倍广告点击")
AdUtils.playRewardAd(this@GameActivity,"receive_redPack_double_click",object :IAdVideoListener {
override fun onAdClose() {
onRedPackAwardReceive(result.doubleX.multipleSid)
}
override fun onError(errorMsg: String?) {
}
})
AdUtils.playRewardAd(
this@GameActivity,
"receive_redPack_double_click",
object : IAdVideoListener {
override fun onAdClose() {
onRedPackAwardReceive(result.doubleX.multipleSid)
}
override fun onError(errorMsg: String?) {
}
})
})
}
}
......@@ -465,32 +493,35 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
Log.d("wxw", "云朵加速")
if (cloudIsClick) {
cloudIsClick = false
AdUtils.playRewardAd(this@GameActivity,"cloud_acceleration_click",object :IAdVideoListener {
override fun onAdClose() {
cloudIsClick = true
GameApiClient.gameApi.getCloudSpeed()
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<StatusEntity>() {
override fun onSuccess(result: StatusEntity?) {
Log.d("wxw", "云朵加速" + Utils.obj2Str(result))
callback?.onCloudSpeedSuccess(true, Utils.obj2Str(result))
}
override fun onFailure(
e: Throwable?,
code: String?,
errorMsg: String?
) {
Log.d("wxw", "云朵加速 error")
callback?.onCloudSpeedSuccess(false, errorMsg + "")
}
})
}
AdUtils.playRewardAd(
this@GameActivity,
"cloud_acceleration_click",
object : IAdVideoListener {
override fun onAdClose() {
cloudIsClick = true
GameApiClient.gameApi.getCloudSpeed()
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<StatusEntity>() {
override fun onSuccess(result: StatusEntity?) {
Log.d("wxw", "云朵加速" + Utils.obj2Str(result))
callback?.onCloudSpeedSuccess(true, Utils.obj2Str(result))
}
override fun onFailure(
e: Throwable?,
code: String?,
errorMsg: String?
) {
Log.d("wxw", "云朵加速 error")
callback?.onCloudSpeedSuccess(false, errorMsg + "")
}
})
}
override fun onError(errorMsg: String?) {
cloudIsClick = true
}
})
override fun onError(errorMsg: String?) {
cloudIsClick = true
}
})
}
......@@ -510,7 +541,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
//解锁地块
fun getUnlockLand(callback: IUnitySendMessageCallback?, id: Int, type: Int) {
Log.d("wxw", "解锁地块 id" + id + "type" + type)
Log.d("wxw", "解锁地块 id" + id + "type" + type)//同步
GameApiClient.gameApi.getUnlockLand(id, type).compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<StatusEntity>() {
override fun onSuccess(result: StatusEntity?) {
......@@ -527,6 +558,21 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
})
}
//解锁地块本地同步服务端
fun getUnlockLandNew(id: Int, type: Int) {
Log.d("wxw", "解锁地块 id" + id + "type" + type)//同步
GameApiClient.gameApi.getUnlockLand(id, type).compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<StatusEntity>() {
override fun onSuccess(result: StatusEntity?) {
Log.d("wxw", "同步解锁地块")
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
Log.d("wxw", "同步解锁地块 error")
}
})
}
//加速剂
fun getUseAccelerators(callback: IUnitySendMessageCallback?, id: Int) {
GameApiClient.gameApi.getUseAccelerators(id).compose(RxSchedulers.observableIO2Main())
......@@ -549,12 +595,12 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
.subscribe(object : BaseObserver<StatusEntity>() {
override fun onSuccess(result: StatusEntity?) {
Log.d("wxw", "金币购买种子" + Utils.obj2Str(result))
callback?.onBuySeedSuccess(true, Utils.obj2Str(result))
// callback?.onBuySeedSuccess(true, Utils.obj2Str(result))
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
Log.d("wxw", "金币购买种子 error")
callback?.onBuySeedSuccess(false, errorMsg + "")
// callback?.onBuySeedSuccess(false, errorMsg + "")
}
})
}
......@@ -593,8 +639,10 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
override fun onSuccess(result: List<HomeListEntity>?) {
mOrderString = Utils.obj2Str(result)
Log.d("wxw", "订单数据" + Utils.obj2Str(result))
callback?.onOrderListSuccess(true,
"{\"homeList\":" + Utils.obj2Str(result) + "}")
callback?.onOrderListSuccess(
true,
"{\"homeList\":" + Utils.obj2Str(result) + "}"
)
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
......@@ -625,85 +673,111 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
fun getVideoSeedReceive(callback: IUnitySendMessageCallback?, id: Int) {
if (videoSeedClick) {
videoSeedClick = false
AdUtils.playRewardAd(this@GameActivity,"receive_seed_click",object :IAdVideoListener {
override fun onAdClose() {
videoSeedClick = true
GameApiClient.gameApi.getVideoSeedReceive(id)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<StatusEntity>() {
override fun onSuccess(result: StatusEntity?) {
result?.id = id
Log.d("wxw", "看视频领取种子" + Utils.obj2Str(result))
callback?.onIncrVideoSeedSuccess(true, Utils.obj2Str(result))
}
override fun onFailure(
e: Throwable?,
code: String?,
errorMsg: String?
) {
Log.d("wxw", "看视频领取种子 error")
callback?.onIncrVideoSeedSuccess(false, errorMsg + "")
}
})
}
AdUtils.playRewardAd(
this@GameActivity,
"receive_seed_click",
object : IAdVideoListener {
override fun onAdClose() {
videoSeedClick = true
GameApiClient.gameApi.getVideoSeedReceive(id)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<StatusEntity>() {
override fun onSuccess(result: StatusEntity?) {
result?.id = id
Log.d("wxw", "看视频领取种子" + Utils.obj2Str(result))
callback?.onIncrVideoSeedSuccess(true, Utils.obj2Str(result))
}
override fun onFailure(
e: Throwable?,
code: String?,
errorMsg: String?
) {
Log.d("wxw", "看视频领取种子 error")
callback?.onIncrVideoSeedSuccess(false, errorMsg + "")
}
})
}
override fun onError(errorMsg: String?) {
videoSeedClick = true
}
})
override fun onError(errorMsg: String?) {
videoSeedClick = true
}
})
}
}
//看视频领取种子 本地处理 新
fun getVideoSeedReceiveNew(id: Int) {
if (videoSeedClick) {
videoSeedClick = false
AdUtils.playRewardAd(
this@GameActivity,
"receive_seed_click",
object : IAdVideoListener {
override fun onAdClose() {
videoSeedClick = true
callUnity("Form_land", "onVideoSeedReceiveSuccess", ""+(id-1))
GameApiClient.gameApi.getVideoSeedReceive(id)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<StatusEntity>() {
override fun onSuccess(result: StatusEntity?) {
Log.d("wxw", "看视频领取种子同步" + Utils.obj2Str(result))
}
override fun onFailure(
e: Throwable?,
code: String?,
errorMsg: String?
) {
Log.d("wxw", "看视频领取种子同步 error")
}
})
}
// GameApiClient.gameApi.getVideoSeedReceive(id).compose(RxSchedulers.observableIO2Main())
// .subscribe(object : BaseObserver<StatusEntity>() {
// override fun onSuccess(result: StatusEntity?) {
// result?.id = id
// Log.d("wxw", "看视频领取种子" + Utils.obj2Str(result))
// callback?.onIncrVideoSeedSuccess(true, Utils.obj2Str(result))
// }
//
// override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
// Log.d("wxw", "看视频领取种子 error")
// callback?.onIncrVideoSeedSuccess(false, errorMsg + "")
// }
// })
override fun onError(errorMsg: String?) {
videoSeedClick = true
}
})
}
}
var videoJiasuClick = true
//看视频领取加速剂
fun getVideoAcceleratorsReceive(callback: IUnitySendMessageCallback?, id: Int) {
if (videoJiasuClick) {
videoJiasuClick = false
AdUtils.playRewardAd(this@GameActivity,"accelerator_receive_click",object :IAdVideoListener {
override fun onAdClose() {
videoJiasuClick = true
GameApiClient.gameApi.getVideoAcceleratorsReceive(id)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<StatusEntity>() {
override fun onSuccess(result: StatusEntity?) {
Log.d("wxw", "看视频领取加速剂" + Utils.obj2Str(result))
callback?.onIncrVideoAcceleratorsSuccess(
true,
Utils.obj2Str(result)
)
}
override fun onFailure(
e: Throwable?,
code: String?,
errorMsg: String?
) {
Log.d("wxw", "看视频领取加速剂 error")
callback?.onIncrVideoAcceleratorsSuccess(false, errorMsg + "")
}
})
}
AdUtils.playRewardAd(
this@GameActivity,
"accelerator_receive_click",
object : IAdVideoListener {
override fun onAdClose() {
videoJiasuClick = true
GameApiClient.gameApi.getVideoAcceleratorsReceive(id)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<StatusEntity>() {
override fun onSuccess(result: StatusEntity?) {
Log.d("wxw", "看视频领取加速剂" + Utils.obj2Str(result))
callback?.onIncrVideoAcceleratorsSuccess(
true,
Utils.obj2Str(result)
)
}
override fun onFailure(
e: Throwable?,
code: String?,
errorMsg: String?
) {
Log.d("wxw", "看视频领取加速剂 error")
callback?.onIncrVideoAcceleratorsSuccess(false, errorMsg + "")
}
})
}
override fun onError(errorMsg: String?) {
videoJiasuClick = true
}
})
override fun onError(errorMsg: String?) {
videoJiasuClick = true
}
})
}
}
......@@ -768,7 +842,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
override fun onCloseViewSuccess(isSuccess: Boolean) {
//关闭view
Log.e("MXL","CLOSE")
Log.e("MXL", "CLOSE")
callUnity("TitleView", "getHomeInfo", "")
callUnity("DailyWelfarm", "getCardList", "")
}
......@@ -841,7 +915,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
override fun onSuccess(result: AddCardEntity?) {
mOrderString = Utils.obj2Str(result)
Log.d("wxw", "收集卡片" + Utils.obj2Str(result))
callback?.onAddCardSuccess(true, Utils.obj2Str(result) )
callback?.onAddCardSuccess(true, Utils.obj2Str(result))
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
......@@ -850,6 +924,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}
})
}
//查询卡片角标
fun getCardList(callback: IUnitySendMessageCallback?) {
GameApiClient.gameApi.getCollectCard().compose(RxSchedulers.observableIO2Main())
......@@ -857,7 +932,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
override fun onSuccess(result: PuzzleEntity?) {
mOrderString = Utils.obj2Str(result)
Log.d("wxw", "查询卡片角标" + Utils.obj2Str(result))
callback?.onGetCardList(true, Utils.obj2Str(result) )
callback?.onGetCardList(true, Utils.obj2Str(result))
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -34,6 +34,54 @@ public class LandListEntity {
private int cloudSecond;
private int acceleratorsSecond;
private int guideStatus;
private LandConfigList[] growList;
private int fruitNum;//水果数量
private int acceleratorsNum;//加速剂数量
public LandConfigList[] getGrowList() {
return growList;
}
public void setGrowList(LandConfigList[] growList) {
this.growList = growList;
}
private class LandConfigList{
private int start;
private int countdown;
public int getStart() {
return start;
}
public void setStart(int start) {
this.start = start;
}
public int getCountdown() {
return countdown;
}
public void setCountdown(int countdown) {
this.countdown = countdown;
}
}
public int getFruitNum() {
return fruitNum;
}
public void setFruitNum(int fruitNum) {
this.fruitNum = fruitNum;
}
public int getAcceleratorsNum() {
return acceleratorsNum;
}
public void setAcceleratorsNum(int acceleratorsNum) {
this.acceleratorsNum = acceleratorsNum;
}
public int getGuideStatus() {
return guideStatus;
......
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