public ZombieBornPool(StgZombieWave wave) { this.zombieName = wave.zombieName; this.delay = wave.waveDelay; this.count = UnityEngine.Random.Range(wave.minCount, wave.maxCount); this.minInterval = wave.minInterval; this.maxInterval = wave.maxInterval; this.interval = UnityEngine.Random.Range(this.minInterval, this.maxInterval); this.position = wave.position; this.range = wave.range; // 缺 }
public static StgEventZombieBorn ToStgEvent(XmlNode node) { StgEventZombieBorn born = new StgEventZombieBorn { isBlock = node["EB"].InnerText.Equals("1"), delay = float.Parse(node["ED"].InnerText) }; XmlNode node2 = node["WS"]; IEnumerator enumerator = node2.ChildNodes.GetEnumerator(); try { while (enumerator.MoveNext()) { XmlNode current = (XmlNode)enumerator.Current; StgZombieWave item = new StgZombieWave { zombieName = current["T"].InnerText, waveDelay = int.Parse(current["D"].InnerText), minCount = int.Parse(current["IC"].InnerText), maxCount = int.Parse(current["AC"].InnerText), minInterval = float.Parse(current["IT"].InnerText), maxInterval = float.Parse(current["AT"].InnerText), position = CommonTools.StringToVector3(current["P"].InnerText), range = float.Parse(current["R"].InnerText) }; born.waves.Add(item); Debug.Log(item.ToString()); } } finally { //IDisposable disposable = enumerator as IDisposable; //if (disposable == null) //{ //} //disposable.Dispose(); } return(born); }