using System.Collections; using System.Collections.Generic; using UnityEngine; public class RePlaySmokeBase : ReplaySimpleObject { public override void CloneObject(string json) { var jsonData = JsonUtility.FromJson(json); var clonedObj = EntitiesManager.Instance.CreateObj(cloneBase.clonePrefab, jsonData.myTransform.getMyPosition(), transform, long.Parse(jsonData.objectName)); clonedObj.name = jsonData.objectName;//名字即ID SetBaseGameObject(clonedObj, jsonData); SetCloneGameObject(clonedObj, json); SetSmokeNongDu(clonedObj, jsonData); } private void SetSmokeNongDu(GameObject clonedObj, SmokeRecordData data) { if (clonedObj.name == data.name) { clonedObj.GetComponent().MySmokeMain.maxParticles = data.value * 10; } } }