备份CatanBuilding瘦身独立工程
This commit is contained in:
80
Assets/Scripts/Services/MMTService.cs
Normal file
80
Assets/Scripts/Services/MMTService.cs
Normal file
@@ -0,0 +1,80 @@
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using game;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class MMTService
|
||||
{
|
||||
[Inject]
|
||||
public Tables _tables { set; get; }
|
||||
public int MMTValue { private set; get; }
|
||||
public string MMTStr { private set; get; }
|
||||
public List<int> FixedFish
|
||||
{
|
||||
get
|
||||
{
|
||||
return _tables.TbGlobalConfig.FixedFish;
|
||||
}
|
||||
}
|
||||
public bool CanShowHand { set; get; } = true;
|
||||
public bool mmt = false;
|
||||
public bool mmc = false;
|
||||
public bool mmBuilding = false;
|
||||
public string Init(int MMTValue)
|
||||
{
|
||||
this.MMTValue = MMTValue;
|
||||
var mmDatas = _tables.TbMMTInit.DataList;
|
||||
string MMType = "";
|
||||
mmt = false;
|
||||
mmc = false;
|
||||
for (int i = 0; i < mmDatas.Count; i++)
|
||||
{
|
||||
MMTInit data = mmDatas[i];
|
||||
//B组修改
|
||||
bool isB = false;
|
||||
#if UNITY_ANDROID
|
||||
if (CheckMMT(data.ID - 1))
|
||||
{
|
||||
isB = true;
|
||||
switch (data.MMTType)
|
||||
{
|
||||
///IOS 不做MMTest
|
||||
case "MMBeginnerPack":
|
||||
mmt = true;
|
||||
break;
|
||||
case "MMCollectingTargetPack":
|
||||
mmc = true;
|
||||
break;
|
||||
case "MMBuildingType":
|
||||
mmBuilding = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (isB)
|
||||
{
|
||||
MMType = MMType + "B";
|
||||
}
|
||||
else
|
||||
{
|
||||
MMType = MMType + "A";
|
||||
}
|
||||
}
|
||||
MMTStr = MMType;
|
||||
return MMType;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查分组
|
||||
/// </summary>
|
||||
/// <param name="index">第几大组0,1,2</param>
|
||||
/// <returns>false=A true=B </returns>
|
||||
bool CheckMMT(int index)
|
||||
{
|
||||
int ab = 1 << (index % 3);
|
||||
return (MMTValue & ab) == ab;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user