Files
back_cantanBuilding/Assets/Scripts/Services/MMTService.cs
2026-05-26 16:15:54 +08:00

81 lines
2.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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">第几大组012</param>
/// <returns>false=A true=B </returns>
bool CheckMMT(int index)
{
int ab = 1 << (index % 3);
return (MMTValue & ab) == ab;
}
}