| | |
| | | battleRootNode.SetBackground(ResManager.Instance.LoadAsset<Texture>("Texture/FullScreenBg", "mainui_img_277")); |
| | | |
| | | SetBattleStartState(); |
| | | SetSpeedRatio(speedRatio); |
| | | SetSpeedRatio(BattleManager.Instance.speedGear[BattleManager.Instance.speedIndex]); |
| | | SetRootNodePosition(); |
| | | } |
| | | |
| | |
| | | // 同时只能有一场战斗在进行 guid, battlefield |
| | | protected Dictionary<string, BattleField> battleFields = new Dictionary<string, BattleField>(); |
| | | |
| | | public float[] speedGear; //战斗倍数对应的实际速率 |
| | | public int speedIndex |
| | | { |
| | | get |
| | | { |
| | | return QuickSetting.Instance.GetQuickSettingValue<int>(QuickSettingType.BattleSpeed, 0); |
| | | } |
| | | set |
| | | { |
| | | QuickSetting.Instance.SetQuickSetting(QuickSettingType.BattleSpeed, value); |
| | | QuickSetting.Instance.SendPackage(); |
| | | } |
| | | } |
| | | |
| | | public Action<string, BattleField> onBattleFieldCreate; |
| | | |
| | |
| | | LogicEngine.Instance.OnUpdate += Run; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk; |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerInit; |
| | | ParseConfig(); |
| | | |
| | | } |
| | | |
| | | void ParseConfig() |
| | | { |
| | | var config = FuncConfigConfig.Get("AutoGuaji"); |
| | | speedGear = JsonMapper.ToObject<float[]>(config.Numerical4); |
| | | } |
| | | |
| | | |
| | | public override void Release() |
| | | { |
| | | base.Release(); |
| | |
| | | |
| | | public class FullScreenBattleWin : UIBase |
| | | { |
| | | float[] speedGear = { 1.1f, 1.3f, 1.5f }; |
| | | |
| | | // 组件引用 |
| | | public Transform mountPoint; |
| | |
| | | if (null == battleField) |
| | | return; |
| | | |
| | | int index = Array.IndexOf(speedGear, battleField.speedRatio); |
| | | index = (index + 1) % speedGear.Length; |
| | | battleField.SetSpeedRatio(speedGear[index]); |
| | | textSpeed.text = (index + 1).ToString(); |
| | | BattleManager.Instance.speedIndex = (BattleManager.Instance.speedIndex + 1) % BattleManager.Instance.speedGear.Length; |
| | | battleField.SetSpeedRatio(BattleManager.Instance.speedGear[BattleManager.Instance.speedIndex]); |
| | | textSpeed.text = (BattleManager.Instance.speedIndex + 1).ToString(); |
| | | } |
| | | |
| | | private void PauseGame() |
| | |
| | | ui.SetBattleField(battleField); |
| | | battleField.UpdateCanvas(canvas); |
| | | |
| | | textSpeed.text = (Array.IndexOf(speedGear, battleField.speedRatio) + 1).ToString(); |
| | | textSpeed.text = (BattleManager.Instance.speedIndex + 1).ToString(); |
| | | } |
| | | } |
| | |
| | | using UnityEngine; |
| | | public class AutoFightModel : GameSystemManager<AutoFightModel> |
| | | { |
| | | //战斗倍数:值越大越快,影响战斗表现,掉落速度等 |
| | | //战斗倍数:值越大越快,影响战斗表现,掉落速度等,这里的倍数是索引,对应配置里的实际速率 |
| | | public int fightSpeed |
| | | { |
| | | get |
| | |
| | | } |
| | | set |
| | | { |
| | | QuickSetting.Instance.SetQuickSetting(QuickSettingType.AutoFight_Speed, value); |
| | | var num = Math.Max(1, value); |
| | | BattleManager.Instance.storyBattleField.SetSpeedRatio(BattleManager.Instance.speedGear[num - 1]); |
| | | QuickSetting.Instance.SetQuickSetting(QuickSettingType.AutoFight_Speed, num); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | public event Action ChangeAutoEvent; |
| | | |
| | | public int maxSpeed = 3; //最高速度 |
| | | public int maxSpeed = 3; //最高速度 索引 |
| | | public int maxCost; //最高消耗 |
| | | public int[] autoCostWithBlessLV; //自动战斗消耗倍数关联祝福等级 |
| | | public int speed2UnlockMissionID; |
| | | public int speed3UnlockCTGID; |
| | | |
| | | public override void Init() |
| | | { |
| | | ParseConfig(); |
| | |
| | | return; |
| | | } |
| | | |
| | | |
| | | BattleManager.Instance.storyBattleField.SetSpeedRatio(BattleManager.Instance.speedGear[fightSpeed - 1]); |
| | | isAutoAttack = isAutoAttackSet; |
| | | |
| | | //手动会一直进入这个逻辑, 自动触发一次 |
| | |
| | | quickSettingDic.Add(QuickSettingType.AutoFight_FightPower, new QuickSettingRange(QuickSettingType.AutoFight_FightPower, 2, 1)); |
| | | quickSettingDic.Add(QuickSettingType.AutoFight_Open, new QuickSettingRange(QuickSettingType.AutoFight_Open, 3, 1)); |
| | | quickSettingDic.Add(QuickSettingType.AutoGoldRush, new QuickSettingRange(QuickSettingType.AutoGoldRush, 4, 10, 1)); //自动淘金,9个物品值,1个自动刷新开关 |
| | | quickSettingDic.Add(QuickSettingType.BattleSpeed, new QuickSettingRange(QuickSettingType.BattleSpeed, 14, 1)); |
| | | |
| | | setting = new string(UCharacter, 100); |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitializeEvent; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk; |
| | |
| | | AutoFight_FightPower, //是否高战力停止 |
| | | AutoFight_Open, //是否开启自动战斗 |
| | | AutoGoldRush, //自动淘金 |
| | | BattleSpeed, //战斗速度索引 非主线部分 |
| | | } |
| | | |
| | | public class QuickSettingRange |
| | |
| | | { |
| | | [SerializeField] Text m_Title; |
| | | [SerializeField] Text m_RuleTxt; |
| | | [SerializeField] ScrollRect m_ScrollRect; |
| | | // [SerializeField] RectTransform scrollRect; |
| | | // [SerializeField] float maxHeight = 800f; // 设置最大高度限制 |
| | | |
| | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | m_ScrollRect.verticalNormalizedPosition = 1; |
| | | var config = RuleConfig.Get(functionOrder); |
| | | |
| | | m_RuleTxt.text = Language.Get(config.Description); |