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.
77 lines
2.7 KiB
77 lines
2.7 KiB
using AX.NetworkSystem; |
|
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
|
|
public class FireFightLeak1 : MonoBehaviour |
|
{ |
|
|
|
private Transform FireBottom; |
|
private Transform Smoke; |
|
private Transform Fire8; |
|
|
|
//初始发射bilv |
|
public float OriFireBottomrate; |
|
public float OriSmokerate; |
|
public float OriFirerate; |
|
|
|
public float fireBottomrate; |
|
public float Smokerate; |
|
public float firerate; |
|
|
|
ParticleSystem.EmissionModule firebuttomemiss; |
|
ParticleSystem.EmissionModule smokeemiss; |
|
ParticleSystem.EmissionModule fire8emiss; |
|
|
|
void Start() |
|
{ |
|
FireBottom = transform.Find("FireBottom"); |
|
Smoke = FireBottom.Find("smoke (1)"); |
|
Fire8 = FireBottom.Find("fire (8)"); |
|
firebuttomemiss = FireBottom.GetComponent<ParticleSystem>().emission; |
|
smokeemiss = Smoke.GetComponent<ParticleSystem>().emission; |
|
fire8emiss = Fire8.GetComponent<ParticleSystem>().emission; |
|
OriFireBottomrate = 1001;//firebuttomemiss.rateOverTime.constant; |
|
OriSmokerate = 50;//smokeemiss.rateOverTime.constant; |
|
OriFirerate = 1001;//smokeemiss.rateOverTime.constant; |
|
fireBottomrate = OriFireBottomrate; |
|
Smokerate = OriSmokerate; |
|
firerate = OriFirerate; |
|
} |
|
|
|
void OnParticleCollision(GameObject other) |
|
{ |
|
if (CurrentUserInfo.room!=null&& CurrentUserInfo.mySelf.Id == CurrentUserInfo.room.Owner.UserInfo.Id) |
|
{ |
|
if (GetComponent<BaseGameObjInfo>().gameObjType == CloneObjType.Leak1) |
|
{ |
|
if (other.GetComponentInParent<ParticleControlOfType>()) |
|
{ |
|
if (other.GetComponentInParent<ParticleControlOfType>().particleType == SprayParticleType.Froth) |
|
{ |
|
other.GetComponentInParent<WaterFightFire>().Target = GetComponentInParent<BoxCollider>(); |
|
} |
|
} |
|
} |
|
} |
|
|
|
} |
|
public void Leak1Calculate() |
|
{ |
|
firebuttomemiss.rateOverTime = new ParticleSystem.MinMaxCurve(fireBottomrate); |
|
smokeemiss.rateOverTime = new ParticleSystem.MinMaxCurve(Smokerate); |
|
fire8emiss.rateOverTime = new ParticleSystem.MinMaxCurve(firerate); |
|
if (fireBottomrate < 0 && firerate < 0) |
|
{ |
|
EntitiesManager.Instance.DeleteObj(gameObject); |
|
} |
|
|
|
var arg = new Leak1FireFightSyncData(); |
|
arg.SendUserID = CurrentUserInfo.mySelf.Id; |
|
arg.gameObjID = GetComponent<BaseGameObjInfo>().gameObjID; |
|
arg.FireButtomRate = fireBottomrate; |
|
arg.Fire8Rate = firerate; |
|
arg.Smokerate = Smokerate; |
|
NetworkManager.Default.SendAsync("LEAK1_FIRE_FIGHT_SYNC", arg); |
|
} |
|
}
|
|
|