using System.Collections; using System.Collections.Generic; using UnityEngine; public class CloneFireBase : CloneSingleObj { /// /// 添加初始状态记录 /// /// //public override void AddRecordFrame(List list) //{ // base.AddRecordFrame(list); // if (transform.childCount > 0) // foreach (Transform item in transform) // { // if (item.GetComponent()) // { // FireSpreadData data = item.GetComponent().GetSpreadData(); // ObjectData objdata = new ObjectData(); // objdata.cloneObjType = CloneObjType.SpreadFire; // objdata.json = JsonUtility.ToJson(data); // list.Add(objdata); // } // } //} public override void AddRecordFrame(List list) { foreach (Transform child in transform) { var data = child.GetComponent().GetSpreadData(); data.rsw = child.GetComponent().MyData.rsw; //记录火焰温度 data.pos = child.GetComponent().MyData.pos; //记录热辐射 data.temperature = child.GetComponent().MyData.temperature; //记录火焰温度 data.radiation = child.GetComponent().MyData.radiation; //记录热辐射 SetBaseData(data, child); string json = JsonUtility.ToJson(data); var objectJson = new ObjectData(); objectJson.cloneObjType = cloneObjType; objectJson.json = json; list.Add(objectJson); } } public override void SetCloneGameObject(GameObject obj) { obj.AddComponent(); obj.AddComponent(); obj.AddComponent(); if (!obj.GetComponent()) obj.AddComponent(); } }