2、灭火机器人没有装备水带也能行走问题修改
@ -81,8 +81,9 @@ public class FireSpreadPanel : BaseAttributeSet {
Close();
}
private void OnDestroy()
public override void OnDestroy()
{
base.OnDestroy();
InitialSizeDropdown.onValueChanged.RemoveListener(InitialSizeSet);
roadSpread.onValueChanged.RemoveListener(RoadSpreadSelected);
@ -140,6 +140,10 @@ public class FireRobotLayWaterHose : MonoBehaviour
// Update is called once per frame
void Update()
if (remainlenght<=0.5f)
agent.SetDestination(transform.position);
if (flag && agent.velocity.magnitude > 0) //开启“铺设水带”,并且开始寻路时才会执行
HasUseNum = Mathf.CeilToInt(GetSelfConsumedLength() / 20);