public void OnUpdate() { if (bTimed && FSM != null) { for (int num = 0; num < UIPortraits.Count; num++) { if (UIUnitIndex.ContainsValue(num)) { Image image = UIPortraits[num]; Text text = UINames[num]; int order = UIPortraitOrder[num]; WuxiaUnit unit = UIWuxiaUnits[order]; Vector3 targetPos = (order == 0) ? new Vector3(68f, 620f, 0f) : new Vector3(80f, 610f - (float)order * 48f, 0f); if (unit != null && unit.IsEndUnit) { targetPos += new Vector3(-20f, -20f, 0f); } image.transform.position = Vector3.Lerp(image.transform.position, targetPos, Time.deltaTime * 5f); } } if (UnitMenu != null && UnitMenu.isActiveAndEnabled && wait_button != null) { wait_button.GetComponentsInChildren <Text>(true)[1].text = "等待"; var unit = Traverse.Create(UnitMenu).Field("unit").GetValue <WuxiaUnit>(); wait_button.gameObject.SetActive(!Timed_IsWaiting(unit) && !unit.IsMoving && !unit.IsMoved && !unit.IsAction); } } }
public static void TimedPatch_Begin(ref WuxiaBattleManager __instance, BattleStateMachine bsm) { bTimed = initiactiveBattle.Value; // 总开关 BM = __instance; FSM = bsm; TimedValue.Clear(); TimedActives.Clear(); TimedWaiting.Clear(); TimedNext.Clear(); UIWuxiaUnits.Clear(); UIUnitIndex.Clear(); UIPortraits.Clear(); UINameBgs.Clear(); UINames.Clear(); }