protected override void ReadData(ESPReader reader) { using (MemoryStream stream = new MemoryStream(reader.ReadBytes(size))) using (ESPReader subReader = new ESPReader(stream, reader.Plugin)) { try { Force = subReader.ReadSingle(); Damage = subReader.ReadSingle(); Radius = subReader.ReadSingle(); Light.ReadBinary(subReader); Sound1.ReadBinary(subReader); Flags = subReader.ReadEnum <ExplosionFlags>(); ISRadius = subReader.ReadSingle(); ImpactDataSet.ReadBinary(subReader); Sound2.ReadBinary(subReader); RadiationLevel = subReader.ReadSingle(); RadiationDissipationTime = subReader.ReadSingle(); RadiationRadius = subReader.ReadSingle(); SoundLevel = subReader.ReadEnum <SoundLevel>(); } catch { return; } } }
private void OnEnable() { sound = GetComponent <Sound2>(); source = GetComponent <AudioSource>(); triggerSignal.onValueChanged += SignalChanged; SignalChanged(triggerSignal.value); }
public void Duck(Sound2 mainsound) { if (mainsound == null || mainsound.activeClip == null || mainsound.activeClip.clip == null) { Duck(1f); } else { Duck(mainsound.activeClip.clip.length); } }
private void OnEnable() { sound = GetComponent <Sound2>(); collider = GetComponent <BoxCollider>(); grid = GetComponentInParent <AudioGrid>(); int i; for (i = 0; i < all.Count && !(all[i].layer > layer); i++) { } all.Insert(i, this); }
protected override void WriteData(ESPWriter writer) { writer.Write(Force); writer.Write(Damage); writer.Write(Radius); Light.WriteBinary(writer); Sound1.WriteBinary(writer); writer.Write((UInt32)Flags); writer.Write(ISRadius); ImpactDataSet.WriteBinary(writer); Sound2.WriteBinary(writer); writer.Write(RadiationLevel); writer.Write(RadiationDissipationTime); writer.Write(RadiationRadius); writer.Write((UInt32)SoundLevel); }
public void ButtonSelect(int ButtonVal) { if (ButtonVal == 1) { SceneManager.LoadScene(1); } else if (ButtonVal == 2) { Level1.SetActive(true); Level2.SetActive(true); Level3.SetActive(true); } else if (ButtonVal == 3) { Debug.Log("exit"); Application.Quit(); Debug.Log("exit1"); } else if (ButtonVal == 4) { Debug.Log("settings"); Sound1.SetActive(true); Sound2.SetActive(true); } else if (ButtonVal == 5) { PlayerPrefs.SetInt("sesKontrol", 1); Debug.Log("seson"); Sound.SetActive(true); } else if (ButtonVal == 6) { PlayerPrefs.SetInt("sesKontrol", 0); Debug.Log("sesoff"); Sound.SetActive(false); } else if (ButtonVal == 7) { PlayerPrefs.DeleteAll(); } }
protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; ele.TryPathTo("Force", true, out subEle); subEle.Value = Force.ToString("G15"); ele.TryPathTo("Damage", true, out subEle); subEle.Value = Damage.ToString("G15"); ele.TryPathTo("Radius", true, out subEle); subEle.Value = Radius.ToString("G15"); ele.TryPathTo("Light", true, out subEle); Light.WriteXML(subEle, master); ele.TryPathTo("Sound1", true, out subEle); Sound1.WriteXML(subEle, master); ele.TryPathTo("Flags", true, out subEle); subEle.Value = Flags.ToString(); ele.TryPathTo("ISRadius", true, out subEle); subEle.Value = ISRadius.ToString("G15"); ele.TryPathTo("ImpactDataSet", true, out subEle); ImpactDataSet.WriteXML(subEle, master); ele.TryPathTo("Sound2", true, out subEle); Sound2.WriteXML(subEle, master); ele.TryPathTo("Radiation/Level", true, out subEle); subEle.Value = RadiationLevel.ToString("G15"); ele.TryPathTo("Radiation/DissipationTime", true, out subEle); subEle.Value = RadiationDissipationTime.ToString("G15"); ele.TryPathTo("Radiation/Radius", true, out subEle); subEle.Value = RadiationRadius.ToString("G15"); ele.TryPathTo("SoundLevel", true, out subEle); subEle.Value = SoundLevel.ToString(); }
public override void Dispose() { if (Sound1 != default) { Sound1.Dispose(); } if (Sound2 != default) { Sound2.Dispose(); } if (Sound3 != default) { Sound3.Dispose(); } base.Dispose(); }
protected override void ReadDataXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; if (ele.TryPathTo("Force", false, out subEle)) { Force = subEle.ToSingle(); } if (ele.TryPathTo("Damage", false, out subEle)) { Damage = subEle.ToSingle(); } if (ele.TryPathTo("Radius", false, out subEle)) { Radius = subEle.ToSingle(); } if (ele.TryPathTo("Light", false, out subEle)) { Light.ReadXML(subEle, master); } if (ele.TryPathTo("Sound1", false, out subEle)) { Sound1.ReadXML(subEle, master); } if (ele.TryPathTo("Flags", false, out subEle)) { Flags = subEle.ToEnum <ExplosionFlags>(); } if (ele.TryPathTo("ISRadius", false, out subEle)) { ISRadius = subEle.ToSingle(); } if (ele.TryPathTo("ImpactDataSet", false, out subEle)) { ImpactDataSet.ReadXML(subEle, master); } if (ele.TryPathTo("Sound2", false, out subEle)) { Sound2.ReadXML(subEle, master); } if (ele.TryPathTo("Radiation/Level", false, out subEle)) { RadiationLevel = subEle.ToSingle(); } if (ele.TryPathTo("Radiation/DissipationTime", false, out subEle)) { RadiationDissipationTime = subEle.ToSingle(); } if (ele.TryPathTo("Radiation/Radius", false, out subEle)) { RadiationRadius = subEle.ToSingle(); } if (ele.TryPathTo("SoundLevel", false, out subEle)) { SoundLevel = subEle.ToEnum <SoundLevel>(); } }
public void Start() { instance = this; }