c1_unity/Assets/Scripts/Component/Battle/BattleControlBg.cs
2025-08-04 17:10:12 +08:00

46 lines
1.1 KiB
C#
Executable File

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace BF
{
public class BattleControlBg : MonoBehaviour
{
public float speed = 0.0f;
public float endX = 0.0f;
public float resetX = 0.0f;
public int type = 0;
void FixedUpdate()
{
// if (!BF.BFMain.Instance.BattleMgr.UpdateEnabled) return;
var transform = GetComponent<RectTransform>();
if (transform.anchoredPosition.x <= endX)
{
transform.anchoredPosition = new Vector2(resetX, transform.anchoredPosition.y);
}
// if (type == 1)
// {
// speed = BF.BFMain.Instance.BattleMgr.SceneSpeedC;
// }
// else if (type == 2)
// {
// speed = BF.BFMain.Instance.BattleMgr.SceneSpeedM;
// }
// else if (type == 3)
// {
// speed = BF.BFMain.Instance.BattleMgr.SceneSpeedF;
// }
// else if (type == 4)
// {
// speed = BF.BFMain.Instance.BattleMgr.SceneSpeedCould;
// }
// else if (type == 5)
// {
// speed = BF.BFMain.Instance.BattleMgr.SceneSpeedBg;
// }
transform.Translate(speed * Time.deltaTime, 0.0f, 0.0f);
}
}
}