using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using AX.MessageSystem; using AX.NetworkSystem; using UnityEngine.AI; public class FireSpreadPanel : BaseAttributeSet { private static FireSpreadPanel instance; public static FireSpreadPanel Instance { get { if (instance == null) { GameObject obj = Resources.Load("Common/FireSpreadPanel"); GameObject clone = Instantiate(obj, GameObject.Find("Canvas").transform); clone.transform.SetAsLastSibling(); clone.name = "FireSpreadPanel"; clone.transform.position = Vector3.zero; instance = clone.GetComponent(); instance.Init(); } return instance; } } InputField combustibleInputField;//燃烧物输入框 Dropdown combustibleDropdown;//燃烧物选择下拉框 Toggle combustibleToggle;//燃烧物输入和选择之间的切换 Dropdown InitialSizeDropdown;//火源初始大小设置下来框 InputField firePostion;//位置 Toggle roadSpread;//路径蔓延 Toggle areSpread;//区域蔓延 public Toggle aroundSpread;//四周蔓延 Toggle aotoSpread;//自动蔓延 Dropdown spreadSpeedDropdown;//蔓延速度 public bool isLoad;//是否是加载而不是换选蔓延方式和重置 Button sure; Button Reset; void Init() { combustibleInputField = transform.Find("Comburent/InputField").GetComponent(); combustibleDropdown = transform.Find("Comburent/Dropdown").GetComponent(); combustibleToggle = transform.Find("Comburent/Toggle").GetComponent(); firePostion = transform.Find("Position/InputField").GetComponent(); InitialSizeDropdown = transform.Find("InitialSize/Dropdown").GetComponent(); InitialSizeDropdown.onValueChanged.AddListener(InitialSizeSet); roadSpread = transform.Find("FireSpread/SpreadType/RoadSpread").GetComponent(); roadSpread.onValueChanged.AddListener(RoadSpreadSelected); areSpread = transform.Find("FireSpread/SpreadType/AreSpread").GetComponent(); areSpread.onValueChanged.AddListener(AreSpreadSelected); aroundSpread = transform.Find("FireSpread/SpreadType/AroundSpread").GetComponent(); aroundSpread.onValueChanged.AddListener(AroundSpreadSelected); aotoSpread = transform.Find("FireSpread/SpreadType/AotoSpread").GetComponent(); aotoSpread.onValueChanged.AddListener(AotoSpreadSelected); spreadSpeedDropdown = transform.Find("FireSpread/SpreadSpeed/Dropdown").GetComponent(); sure = transform.Find("Sure").GetComponent