///////////////////////////////////////// //Custom version // private IEnumerator OnLoad(On.RoR2.RoR2Application.orig_OnLoad orig, RoR2.RoR2Application self) // { // IEnumerator num = orig(self); // // //Creates IntPtr of sufficient size. // IntPtr Memory = Marshal.AllocHGlobal(bytes.Length); // //copies the byte array to the IntPtr // Marshal.Copy(bytes, 0, Memory, bytes.Length); // // //Loads the entire IntPtr as a bank // var result = AkSoundEngine.LoadBank(Memory, (uint)bytes.Length, out BankID); // if (result != AKRESULT.AK_Success) // { // Debug.LogError("Risk of Rave SoundBank failed to to load with result " + result); // } // // //num.MoveNext(); // return num; // } //Custom version ///////////////////////////////////////// private void EndRaveTest(On.RoR2.HoldoutZoneController.orig_OnDisable orig, RoR2.HoldoutZoneController self) { EndRave(); orig(self); Hodl = null; }
void EndRave() { Hodl = null; //Play music if (MusicCon) { Debug.Log("Try Stop"); //uint test = RoR2.Util.PlaySound("RaveStop", MusicCon.gameObject); uint test = AkSoundEngine.PostEvent("RaveStop", MusicCon.gameObject); Debug.Log("code: " + test); } RaveTintImg.color = new Color(1, 1, 1, 0); Debug.Log("End Conductor"); conductor.stopConductor(); lastBeat = 0; }
private void StartRave(On.RoR2.HoldoutZoneController.orig_Start orig, RoR2.HoldoutZoneController self) { orig(self); // Debug.Log("Start Conductor"); //spawn the rave prefabs //Play music if (MusicCon) { // Debug.Log("Try play"); //uint test = RoR2.Util.PlaySound("RaveStart", MusicCon.gameObject); uint test = AkSoundEngine.PostEvent("RaveStart", MusicCon.gameObject); // Debug.Log("code: " + test); } conductor.startConductor(); }
private void EndRaveChargedHoldout(On.RoR2.HoldoutZoneController.orig_FullyChargeHoldoutZone orig, RoR2.HoldoutZoneController self) { EndRave(); orig(self); }