海淀天下城电子沙盘单机版
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.

42 lines
1.0 KiB

4 years ago
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
public class WaterCopeFire : MonoBehaviour
{
public bool IsWater;
public float time;
public float DurationTime = 180f;
// Use this for initialization
void Start()
{
DurationTime=float.Parse( TransformHelper.LoadJsonFromConfing("DurationTime.json"));
}
// Update is called once per frame
void Update()
{
if (RecordEvent.IsReplay())
return;
if (IsWater)
{
time += Time.deltaTime;
if (time >= DurationTime)
{
time = 0;
EntitiesManager.Instance.DeleteObj(gameObject);
RecordEvent.AddEventData(GetComponent<BaseGameObjInfo>().gameObjType, RecordEventType.Delete, gameObject.name);
}
IsWater = false;
}
}
private void OnParticleCollision(GameObject other)
{
if (other.layer != 4)
return;
IsWater = true;
}
}