using System; using System.Collections; using System.Collections.Generic; using UnityEngine; [Serializable] public class BoiloverData : RecordObjectBase { public string name; public bool catchFire; public Vector3 bottomScale; public Vector3 boxsize; public float nowScale; public float shapRadius; } public class BoiloverControl : MonoBehaviour { public bool CatchFire; void Start() { } private void Update() { if (CatchFire) { if (!transform.Find("StreamFire").gameObject.activeSelf) { transform.Find("StreamFire").gameObject.SetActive(true); } if (!transform.Find("FireBottom").gameObject.activeSelf) { transform.Find("FireBottom").gameObject.SetActive(true); } } } public void GetBoiloverData(BoiloverData data) { data.name = gameObject.name; data.boxsize = GetComponent().size; data.bottomScale = transform.Find("BottomOil").transform.localScale; data.nowScale = transform.Find("BottomOil").GetComponent().ranyouScale; data.shapRadius = transform.Find("FireBottom").GetComponent().NowShape; data.catchFire = CatchFire; } public void SetBoiloverData(BoiloverData data) { GetComponent().size = data.boxsize; transform.Find("BottomOil").transform.localScale = data.bottomScale; transform.Find("BottomOil").GetComponent().ranyouScale = data.nowScale; transform.Find("FireBottom/fire (8)").GetComponent().NowShape = data.shapRadius; transform.Find("FireBottom").GetComponent().NowShape = data.shapRadius; CatchFire = data.catchFire; } }