贺州人民医院电子沙盘
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

55 lines
1.8 KiB

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<BoxCollider>().size;
data.bottomScale = transform.Find("BottomOil").transform.localScale;
data.nowScale = transform.Find("BottomOil").GetComponent<OilSpread>().ranyouScale;
data.shapRadius = transform.Find("FireBottom").GetComponent<OilParticleControl>().NowShape;
data.catchFire = CatchFire;
}
public void SetBoiloverData(BoiloverData data)
{
GetComponent<BoxCollider>().size = data.boxsize;
transform.Find("BottomOil").transform.localScale = data.bottomScale;
transform.Find("BottomOil").GetComponent<OilSpread>().ranyouScale = data.nowScale;
transform.Find("FireBottom/fire (8)").GetComponent<OilParticleControl>().NowShape = data.shapRadius;
transform.Find("FireBottom").GetComponent<OilParticleControl>().NowShape = data.shapRadius;
CatchFire = data.catchFire;
}
}