void Start() { characterController = GetComponent<CharacterController>(); characterParticles = GameObject.Find("Player/Flute Radius").GetComponent<ParticleSystem>(); fluteCall1 = FMOD_StudioSystem.instance.GetEvent("event:/sfx/player/flute1"); fluteCall2 = FMOD_StudioSystem.instance.GetEvent("event:/sfx/player/flute2"); }
// Use this for initialization void Start() { soundNameMap = new Dictionary<string, string>(); FillMap("boil", boilSoundNamePrefix, 3); FillMap("fry", frySoundNamePrefix, 3); FillMap("chop", chopSoundNamePrefix, 3); FillMap("bin", binSoundNamePrefix, 3); FillMap("footstep", footstepSoundNamePrefix, 6); FillMap("pick", pickSoundNamePrefix, 3); FillMap("complete", completeSoundName); FillMap("dishDone", dishDoneSoundName); FillMap("drop", dropSoundName); FillMap("lose", loseSoundName); FillMap("bell", bellSoundName); FillMap("demonTalk", demonTalkSoundName); FillMap("ritualSuccess", ritualSuccessSoundName); FillMap("ritualFailure", ritualFailureSoundName); FillMap("fire", fireSoundName); FillMap("smokeAlarm", smokeAlarmSoundName); currentSounds = new List<EventInstance>(); _musicEvent = FMODUnity.RuntimeManager.CreateInstance(musicEventName); _musicEvent.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(Camera.allCameras[0].transform.position)); }
public static void StopEvent(EventInstance evt) { if (evt != null && evt.isValid()) { UnityUtil.ERRCHECK(evt.stop(STOP_MODE.ALLOWFADEOUT)); UnityUtil.ERRCHECK(evt.release()); } }
private void OnEnable() { this.eventInstance = FMODCommon.PlayOneshot(this.eventPath, base.transform.position, new object[] { "wind", TheForestAtmosphere.Instance.WindIntensity }); }
private void PlayerSighted() { base.CancelInvoke("EnablePlayerSighted"); if (this.playerSightedEnabled) { this.playerSightedEnabled = false; this.playerSightedInstance = FMODCommon.PlayOneshotNetworked(this.playerSightedEvent, base.transform, FMODCommon.NetworkRole.Server); } }
void Start() { m_ControllerBody = m_Controller.GetComponent<Rigidbody>(); m_FootstepState = FMODUnity.RuntimeManager.CreateInstance(m_FootstepEvent); m_FootstepState.start(); m_FootstepState.getParameterByIndex(0, out m_FootstepsWalking); m_FootstepState.getParameterByIndex(1, out m_FootstepsRunning); }
void Start() { currentActiveSwitches = 0; prevActiveSwitches = 0; openPosition = new Vector3(transform.position.x, transform.position.y + raiseHeight, transform.position.z); closedPosition = transform.position; doorSlideAudio = FMOD_StudioSystem.instance.GetEvent("event:/sfx/environment/puzzlePiece/slidingStoneDoor"); var attributes = FMOD.Studio.UnityUtil.to3DAttributes(this.transform.position); doorSlideAudio.set3DAttributes(attributes); }
private void OnEnable() { if (FMOD_StudioSystem.instance) { this.eventInstance = FMOD_StudioSystem.instance.GetEvent("event:/music/menu"); if (this.eventInstance != null) { UnityUtil.ERRCHECK(this.eventInstance.start()); } } }
void Start() { ambience = FMOD_StudioSystem.instance.GetEvent("event:/sfx/environment/ambience"); ambience.getParameter("windSpeed", out windSpeedParam); ambience.getParameter("windIntensity", out windIntensityParam); windSpeedParam.setValue(0); windIntensityParam.setValue(0); ambience.start(); StartCoroutine(VaryWindParam(windSpeedParam)); StartCoroutine(VaryWindParam(windIntensityParam)); }
protected bool IsSoundPlaying(EventInstance instance) { if (instance == null) { Debug.LogError ("Null event instance"); return false; } var playbackState = PLAYBACK_STATE.STOPPED; instance.getPlaybackState (out playbackState); return playbackState == PLAYBACK_STATE.PLAYING; }
void Start() { fmodevent = FMOD_StudioSystem.instance.GetEvent("event:/music/music"); if (fmodevent != null) { fmodevent.setVolume(1.0f); fmodevent.setParameterValue("music_trans", 0.0f); fmodevent.start(); } }
void Start() { m_PlayerChar = GetComponent<PlayerChar>(); m_Loaded = true; m_IsLoading = false; m_CrossbowShotEvent = FMODUnity.RuntimeManager.CreateInstance(m_CrossbowShotAudio); m_CrossbowShotEvent.start(); m_CrossbowShotEvent.getCue("KeyOff", out m_CrossbowCue); m_CrossbowShotEvent.getParameter("Reload", out m_CrossbowReload); ReadyRotation = Crossbow.transform.localRotation; ReloadRotation = ReadyRotation * Quaternion.AngleAxis(-20f, Vector3.right); }
private void playHitGroundSFX() { if (FMOD_StudioSystem.instance) { if (this.cutScene.skipOpening) { this.hitGroundEvent = FMOD_StudioSystem.instance.PlayOneShot("event:/ambient/plane_start/hit_ground_skipped", Vector3.zero, null); } else { this.hitGroundEvent = FMOD_StudioSystem.instance.PlayOneShot("event:/ambient/plane_start/hit_ground", Vector3.zero, null); } } }
private void Update() { if (this.playerSightedInstance != null) { PLAYBACK_STATE state = PLAYBACK_STATE.STOPPED; if (this.playerSightedInstance.getPlaybackState(out state) == RESULT.OK && state.isPlaying()) { UnityUtil.ERRCHECK(this.playerSightedInstance.set3DAttributes(base.transform.to3DAttributes())); } else { this.playerSightedInstance = null; } } }
void Start () { sfxController = gameObject.GetComponent<SFXController>(); hum = FMOD_StudioSystem.instance.GetEvent("event:/alpaca_hum"); hum.getParameter("occlusion", out occlusion); hum.getParameter("distanceFromSmallRm", out distanceFromSmallRm); hum.getParameter("distanceFromLargeRm", out distanceFromLargeRm); distanceFromLargeRm.setValue(distLargeRm); distanceFromSmallRm.setValue(distSmallRm); // set up snap shot for displaced sound var system = FMOD_StudioSystem.instance.System; FMOD.Studio.EventDescription description; system.getEvent("snapshot:/displacedSound", out description); description.createInstance(out displacedSound); }
public static void CompleteTransfer(Transform destination, EventInstance windEvent) { if (windEvent != null) { TreeWindSfx treeWindSfx = null; if (destination != null) { treeWindSfx = destination.GetComponentInChildren<TreeWindSfx>(); } if (treeWindSfx != null) { treeWindSfx.WindEvent = windEvent; } else { TreeWindSfx.StopEvent(windEvent); } windEvent = null; } }
IEnumerator PlayFlute(EventInstance fluteAudio) { // set the position of the sound effect to be the player's position var attributes = FMOD.Studio.UnityUtil.to3DAttributes(transform.position); fluteAudio.set3DAttributes(attributes); fluteAudio.start(); characterParticles.Play(true); float start = Time.time; float time = start; while (time <= start + 5f) { // update the position of the sound as the player moves attributes = FMOD.Studio.UnityUtil.to3DAttributes(transform.position); fluteAudio.set3DAttributes(attributes); time += Time.deltaTime; yield return null; } }
/// <summary> /// Adds the mod menu section for the first element of 'modules' that matches 'criteria', /// then removes it from the 'modules' list. /// </summary> /// <returns>true if an element matching 'criteria' was found, false otherwise.</returns> private static bool createModMenuSectionAndDelete(List <EverestModule> modules, Predicate <EverestModule> criteria, TextMenu menu, bool inGame, EventInstance snapshot) { bool foundMatch = false; // find all modules matching the criteria, and create their mod menu sections. int matchingIndex = modules.FindIndex(criteria); while (matchingIndex != -1) { modules[matchingIndex].CreateModMenuSection(menu, inGame, snapshot); modules.RemoveAt(matchingIndex); foundMatch = true; matchingIndex = modules.FindIndex(criteria); } return(foundMatch); }
protected virtual void CreateModMenuSectionHeader(TextMenu menu, bool inGame, EventInstance snapshot) { Type type = SettingsType; EverestModuleSettings settings = _Settings; if (type == null || settings == null) { return; } string typeName = type.Name.ToLowerInvariant(); if (typeName.EndsWith("settings")) { typeName = typeName.Substring(0, typeName.Length - 8); } string nameDefaultPrefix = $"modoptions_{typeName}_"; string name; // We lazily reuse this field for the props later on. name = type.GetCustomAttribute <SettingNameAttribute>()?.Name ?? $"{nameDefaultPrefix}title"; name = name.DialogCleanOrNull() ?? Metadata.Name.SpacedPascalCase(); menu.Add(new patch_TextMenu.patch_SubHeader(name + " | v." + Metadata.VersionString)); }
public void MylingIdleAudio(Transform position) { mylingIdleEvent = RuntimeManager.CreateInstance(mylingIdleAudio); RuntimeManager.AttachInstanceToGameObject(mylingIdleEvent, position); mylingIdleEvent.start(); }
public void BossAOEAttackAudio(Transform position) { birdAoeAttackEvent = RuntimeManager.CreateInstance(birdAoeAttackAudio); RuntimeManager.AttachInstanceToGameObject(birdAoeAttackEvent, position); birdAoeAttackEvent.start(); }
public RESULT createSubEvent(string name, out EventInstance instance) { RESULT result = RESULT.OK; IntPtr subeventraw = new IntPtr(); instance = null; try { result = FMOD_Studio_EventInstance_CreateSubEvent(rawPtr, Encoding.UTF8.GetBytes(name + Char.MinValue), out subeventraw); } catch { result = RESULT.ERR_INVALID_PARAM; } if (result != RESULT.OK) { return result; } instance = new EventInstance(); instance.setRaw(subeventraw); return result; }
public override void CreateModMenuSection(TextMenu menu, bool inGame, EventInstance snapshot) { CreateModMenuSectionHeader(menu, inGame, snapshot); SpeedrunToolMenu.Create(menu, inGame, snapshot); }
public void PlayWinnerIsSound() { dialogueSource = FMODUnity.RuntimeManager.CreateInstance(winnerIsPath); dialogueSource.start(); dialogueSource.release(); }
public RESULT createInstance(out EventInstance instance) { instance = null; IntPtr newPtr = new IntPtr(); RESULT result = FMOD_Studio_EventDescription_CreateInstance(rawPtr, out newPtr); if (result != RESULT.OK) { return result; } instance = new EventInstance(newPtr); return result; }
/// <summary> /// Create the mod menu subsection including the section header in the given menu. /// The default implementation uses reflection to attempt creating a menu. /// </summary> /// <param name="menu">Menu to add the section to.</param> /// <param name="inGame">Whether we're in-game (paused) or in the main menu.</param> /// <param name="snapshot">The Level.PauseSnapshot</param> public virtual void CreateModMenuSection(TextMenu menu, bool inGame, EventInstance snapshot) { Type type = SettingsType; EverestModuleSettings settings = _Settings; if (type == null || settings == null) { return; } // The default name prefix. string nameDefaultPrefix = $"modoptions_{type.Name.ToLowerInvariant()}_"; if (nameDefaultPrefix.EndsWith("Settings")) { nameDefaultPrefix = nameDefaultPrefix.Substring(0, nameDefaultPrefix.Length - 8); } // Any attributes we may want to get and read from later. SettingInGameAttribute attribInGame; SettingRangeAttribute attribRange; // If the settings type has got the InGame attrib, only show it in the matching situation. if ((attribInGame = type.GetCustomAttribute <SettingInGameAttribute>()) != null && attribInGame.InGame != inGame) { return; } // The settings subheader. string name; // We lazily reuse this field for the props later on. name = type.GetCustomAttribute <SettingNameAttribute>()?.Name ?? $"{nameDefaultPrefix}title"; name = name.DialogCleanOrNull() ?? Metadata.Name.SpacedPascalCase(); menu.Add(new TextMenu.SubHeader(name)); PropertyInfo[] props; if (type == _PrevSettingsType) { props = _PrevSettingsProps; } else { _PrevSettingsProps = props = type.GetProperties(); _PrevSettingsType = type; } foreach (PropertyInfo prop in props) { if ((attribInGame = prop.GetCustomAttribute <SettingInGameAttribute>()) != null && attribInGame.InGame != inGame) { continue; } if (prop.GetCustomAttribute <SettingIgnoreAttribute>() != null) { continue; } if (!prop.CanRead || !prop.CanWrite) { continue; } name = prop.GetCustomAttribute <SettingNameAttribute>()?.Name ?? $"{nameDefaultPrefix}{prop.Name.ToLowerInvariant()}"; name = name.DialogCleanOrNull() ?? prop.Name.SpacedPascalCase(); bool needsRelaunch = prop.GetCustomAttribute <SettingNeedsRelaunchAttribute>() != null; TextMenu.Item item = null; Type propType = prop.PropertyType; object value = prop.GetValue(settings); // Create the matching item based off of the type and attributes. if (propType == typeof(bool)) { item = new TextMenu.OnOff(name, (bool)value) .Change(v => prop.SetValue(settings, v)) .NeedsRelaunch(needsRelaunch) ; } else if ( propType == typeof(int) && (attribRange = prop.GetCustomAttribute <SettingRangeAttribute>()) != null ) { item = new TextMenu.Slider(name, i => i.ToString(), attribRange.Min, attribRange.Max, (int)value) .Change(v => prop.SetValue(settings, v)) .NeedsRelaunch(needsRelaunch) ; } if (item == null) { continue; } menu.Add(item); } }
public void PlayGameSound() { dialogueSource = FMODUnity.RuntimeManager.CreateInstance(gameEndPath); dialogueSource.start(); dialogueSource.release(); }
private void SetupSFX() { sfxController = gameObject.GetComponent<SFXController>(); gunshotAudio = FMOD_StudioSystem.instance.GetEvent("event:/flute"); gunshotAudio.getParameter("distanceFromLargeRm", out distanceFromLargeRm); gunshotAudio.getParameter("distanceFromSmallRm", out distanceFromSmallRm); GameObject s = GameObject.Find("Building Small/Audio Zone"); GameObject l = GameObject.Find("Building Large/Audio Zone"); smallRoom = s.GetComponent<Transform>(); largeRoom = l.GetComponent<Transform>(); InvokeRepeating("FindNearestAudioOpenings", 0, 1); }
private static void RaiseEvent(EventInstance _instance) { RaiseEvent(_instance.eventID, _instance.eventData); }
public TextMenu CreateMenu(bool inGame, EventInstance snapshot) { menu = new TextMenu(); items.Clear(); menu.Add(new TextMenu.Header(Dialog.Clean("maplist_title"))); menu.Add(new TextMenu.SubHeader(Dialog.Clean("maplist_filters"))); menu.Add(new TextMenu.Button(Dialog.Clean("maplist_reload")).Pressed(() => { Audio.Play(SFX.ui_postgame_unlock_newchapter); Overworld.Mountain.UntiltedCamera = cameraStart; OuiHelper_ChapterSelect_Reload.Reload(); Overworld.Goto <OuiMapList>(); })); menu.Add(searchButton = new TextMenu.Button(Dialog.Clean("maplist_search")).Pressed(() => { Searching = true; MInput.Disabled = true; })); sets.Clear(); foreach (AreaData area in AreaData.Areas) { string levelSet = area.GetLevelSet(); if (string.IsNullOrEmpty(levelSet)) { continue; } if (levelSet == "Celeste") { continue; } if (sets.Contains(levelSet)) { continue; } sets.Add(levelSet); } menu.Add(new TextMenu.Slider(Dialog.Clean("maplist_type"), value => { if (value == 0) { return(Dialog.Clean("levelset_celeste")); } if (value == 1) { return(Dialog.Clean("maplist_type_allmods")); } return(DialogExt.CleanLevelSet(sets[value - 2])); }, 0, 1 + sets.Count, type).Change(value => { type = value; ReloadItems(); })); menu.Add(new TextMenu.Slider(Dialog.Clean("maplist_side"), value => ((char)('A' + value)).ToString(), 0, Enum.GetValues(typeof(AreaMode)).Length - 1, side).Change(value => { side = value; ReloadItems(); })); menu.Add(new TextMenu.SubHeader(Dialog.Clean("maplist_list"))); ReloadItems(); return(menu); }
private void Start() { drillEventInst = FMODUnity.RuntimeManager.CreateInstance(fmodEvent); //FMODUnity.RuntimeManager.AttachInstanceToGameObject(drillEventInst, , GetComponent<Rigidbody>()); }
// Sound Effects public void PlayGongNoise() { soundEffectsSource = FMODUnity.RuntimeManager.CreateInstance(gongPath); soundEffectsSource.start(); soundEffectsSource.release(); }
void Start() { _billyClub = StudioSystem.GetEvent (BillyClub.path); }
public void PlayMenuSelectNoise() { soundEffectsSource = FMODUnity.RuntimeManager.CreateInstance(menuSelectPath); soundEffectsSource.start(); soundEffectsSource.release(); }
public void Activate() { if (FMOD_StudioSystem.instance) { if (this.WindEvent == null || !this.WindEvent.isValid()) { this.WindEvent = FMOD_StudioSystem.instance.GetEvent(this.EventPath); UnityUtil.ERRCHECK(this.WindEvent.set3DAttributes(UnityUtil.to3DAttributes(base.gameObject, null))); if (this.WindParameterIndex >= 0) { UnityUtil.ERRCHECK(this.WindEvent.setParameterValueByIndex(this.WindParameterIndex, TheForestAtmosphere.Instance.WindIntensity)); } if (this.SizeParameterIndex >= 0) { UnityUtil.ERRCHECK(this.WindEvent.setParameterValueByIndex(this.SizeParameterIndex, this.size)); } if (this.TimeParameterIndex >= 0) { UnityUtil.ERRCHECK(this.WindEvent.setParameterValueByIndex(this.TimeParameterIndex, FMOD_StudioEventEmitter.HoursSinceMidnight)); } UnityUtil.ERRCHECK(this.WindEvent.start()); } else { if (this.WindParameterIndex >= 0) { UnityUtil.ERRCHECK(this.WindEvent.setParameterValueByIndex(this.WindParameterIndex, TheForestAtmosphere.Instance.WindIntensity)); } if (this.TimeParameterIndex >= 0) { UnityUtil.ERRCHECK(this.WindEvent.setParameterValueByIndex(this.TimeParameterIndex, FMOD_StudioEventEmitter.HoursSinceMidnight)); } } this.WaitingForTimeout = false; } }
protected override void ReactToEvent(UnityFunction unityFunction) { EventInstance eventInstance = audioEventPlayer.GetInstance; eventInstance.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); }
private void OnDisable() { UnityUtil.ERRCHECK(this.eventInstance.stop(STOP_MODE.ALLOWFADEOUT)); UnityUtil.ERRCHECK(this.eventInstance.release()); this.eventInstance = null; }
protected void Page_Load(object sender, EventArgs e) { ContextBusClient cbClient = new ContextBusClient(); //Get Employee definition from adventure works: ConnectionParam[] parameters = cbClient.LoadConnection("advworks", AdvWorksConnectorId); cbClient.Login(parameters, AdvWorksConnectorId); FlyweightObjectDefinition flyweight = new FlyweightObjectDefinition() { Id = "HumanResources.Employee" }; ObjectDefinition employeeObjDef = cbClient.GetObjectDefinitionList(new FlyweightObjectDefinition[] { flyweight }, AdvWorksConnectorId).First(); //Get Team definition from Sharepoint parameters = cbClient.LoadConnection("Sharepoint-Team", "SharePoint"); cbClient.Login(parameters, "SharePoint"); flyweight = new FlyweightObjectDefinition() { Id = "SP|List|/sites/SiteCollection1|Team" }; ObjectDefinition sharepointObjDef = cbClient.GetObjectDefinitionList(new FlyweightObjectDefinition[] { flyweight }, "SharePoint").First(); //build the workflow. TaskManagerClient taskClient = new TaskManagerClient(); //1. Create login task LoginTask login = taskClient.CreateLoginTask(AdvWorksConnectorId, "advworks"); //2. Create Mapping Task MappingTask map = taskClient.CreateMappingTask(sharepointObjDef, employeeObjDef); MappableField field = map.TargetFields.SingleOrDefault(f => f.Id == "p.BusinessEntityID"); field.Mapping.MappingType = MappingType.ConstMapping; field.Mapping.Value = 1; field = map.TargetFields.SingleOrDefault(f => f.Id == "p.EmailPromotion"); field.Mapping.MappingType = MappingType.ConstMapping; field.Mapping.Value = 0; field = map.TargetFields.SingleOrDefault(f => f.Id == "p.Demographics"); field.Mapping.MappingType = MappingType.ConstMapping; field.Mapping.Value = ""; field = map.TargetFields.SingleOrDefault(f => f.Id == "p.NameStyle"); field.Mapping.MappingType = MappingType.ConstMapping; field.Mapping.Value = false; field = map.TargetFields.SingleOrDefault(f => f.Id == "p.PersonType"); field.Mapping.MappingType = MappingType.ConstMapping; field.Mapping.Value = "EM"; field = map.TargetFields.SingleOrDefault(f => f.Id == "p.FirstName"); field.Mapping.MappingType = MappingType.FieldMapping; field.Mapping.Value = "First_x0020_Name"; field = map.TargetFields.SingleOrDefault(f => f.Id == "p.LastName"); field.Mapping.MappingType = MappingType.FieldMapping; field.Mapping.Value = "Last_x0020_Name"; field = map.TargetFields.SingleOrDefault(f => f.Id == "e.JobTitle"); field.Mapping.MappingType = MappingType.FieldMapping; field.Mapping.Value = "Title"; //3. Save Task SaveObjectInstanceTask saveSharepointToEktron = taskClient.CreateSaveObjectTask(AdvWorksConnectorId); //4. Logout Task LogoutTask logout = taskClient.CreateLogoutTask(AdvWorksConnectorId); //5. Assemble and save workflow string workflowName = string.Concat("My Test Workflow"); Workflow workflow = taskClient.CreateWorkflow(workflowName); List<ContextBusTask> tasks = new List<ContextBusTask>(); tasks.Add(login); tasks.Add(map); tasks.Add(saveSharepointToEktron); tasks.Add(logout); workflow.Tasks = tasks.ToArray(); taskClient.SaveWorkflow(workflow); //3. Create associated Event Definitions for workflow. EventManagerClient eventClient = new EventManagerClient(); EventDefinition eventDef = new EventDefinition() { Id = workflowName, Payload = map.SourceObject }; eventClient.AssociateWorkflowsToEvent(new string[] { workflow.WorkflowName }, eventDef); // //Now raise the event to perform the workflow! // //first get sharpeoint item ObjectInstanceCriteriaFilter criteria = new ObjectInstanceCriteriaFilter(); criteria.Filters = new CriteriaFilter[0]; ObjectInstanceList sharepointObjInstance = cbClient.GetObjectInstanceList(sharepointObjDef, criteria, "SharePoint"); //create event instance with sharepoint item EventInstance itemEvent = new EventInstance() { Id = workflowName, Payload = sharepointObjInstance.Results.First() }; //raise the event. eventClient.RaiseEvent(itemEvent); }
public static void Register(EventInstance e, LuaEventCallback callback) { m_eventCallbacks.Add(e, callback); }
void Start() { nav = GetComponent<NavMeshAgent>(); alpacaParticles = GetComponentInChildren<ParticleSystem>(); isSummonable = true; isLockedToTarget = false; if (targetObj != null) { targetPos = targetObj.transform.position; nav.SetDestination(targetPos); } else { targetPos = transform.position; } alpacaHum = FMOD_StudioSystem.instance.GetEvent("event:/sfx/alpaca/hum"); }
public void BirdSpawnEnemyAudio(Transform position) { birdSpawnEnemyEvent = RuntimeManager.CreateInstance(birdSpawnEnemyAudio); RuntimeManager.AttachInstanceToGameObject(birdSpawnEnemyEvent, position); birdSpawnEnemyEvent.start(); }
// Start is called before the first frame update void Start() { musicInstance = RuntimeManager.CreateInstance(MenuMusic); musicInstance.start(); }
public void BossDrainLaserAudio(Transform position) { birdDrainLaserEvent = RuntimeManager.CreateInstance(birdDrainLaserAudio); RuntimeManager.AttachInstanceToGameObject(birdDrainLaserEvent, position); birdDrainLaserEvent.start(); }
public static void WriteEvent(string source, EventInstance instance, byte[] data, object[] values) { }
public static TextMenu CreateMenu(bool inGame, EventInstance snapshot) { TextMenu menu = new TextMenu(); ((patch_TextMenu)menu).BatchMode = true; menu.Add(new TextMenuExt.HeaderImage("menu/everest") { ImageColor = Color.White, ImageOutline = true, ImageScale = 0.5f }); if (!inGame) { List <EverestModuleMetadata> missingDependencies = new List <EverestModuleMetadata>(); lock (Everest.Loader.Delayed) { if (Everest.Loader.Delayed.Count > 0) { menu.Add(new TextMenuExt.SubHeaderExt(Dialog.Clean("modoptions_coremodule_notloaded_a")) { HeightExtra = 0f, TextColor = Color.OrangeRed }); menu.Add(new TextMenuExt.SubHeaderExt(Dialog.Clean("modoptions_coremodule_notloaded_b")) { HeightExtra = 0f, TextColor = Color.OrangeRed }); foreach (Tuple <EverestModuleMetadata, Action> mod in Everest.Loader.Delayed) { string missingDepsString = ""; if (mod.Item1.Dependencies != null) { // check for missing dependencies List <EverestModuleMetadata> missingDependenciesForMod = mod.Item1.Dependencies .FindAll(dep => !Everest.Loader.DependencyLoaded(dep)); if (mod.Item1.OptionalDependencies != null) { // find optional dependencies with mismatching versions List <EverestModuleMetadata> optionalDependenciesWithVersionMismatches = mod.Item1.OptionalDependencies .FindAll(dep => !Everest.Loader.DependencyLoaded(dep) && Everest.Modules.Any(module => module.Metadata?.Name == dep.Name)); missingDependenciesForMod.AddRange(optionalDependenciesWithVersionMismatches); } missingDependencies.AddRange(missingDependenciesForMod); if (missingDependenciesForMod.Count != 0) { // format their names and versions, and join all of them in a single string missingDepsString = string.Join(", ", missingDependenciesForMod.Select(dependency => dependency.Name + " | v." + dependency.VersionString)); // ensure that string is not too long, or else it would break the display if (missingDepsString.Length > 40) { missingDepsString = missingDepsString.Substring(0, 40) + "..."; } // wrap that in a " ({list} not found)" message missingDepsString = $" ({string.Format(Dialog.Get("modoptions_coremodule_notloaded_notfound"), missingDepsString)})"; } } menu.Add(new TextMenuExt.SubHeaderExt(mod.Item1.Name + " | v." + mod.Item1.VersionString + missingDepsString) { HeightExtra = 0f, TextColor = Color.PaleVioletRed }); } } else if (CoreModule.Settings.WarnOnEverestYamlErrors && Everest.Loader.FilesWithMetadataLoadFailures.Count > 0) { menu.Add(new TextMenuExt.SubHeaderExt(Dialog.Clean("modoptions_coremodule_yamlerrors")) { HeightExtra = 0f, TextColor = Color.OrangeRed }); menu.Add(new TextMenuExt.SubHeaderExt(Dialog.Clean("modoptions_coremodule_notloaded_b")) { HeightExtra = 0f, TextColor = Color.OrangeRed }); foreach (string fileName in Everest.Loader.FilesWithMetadataLoadFailures) { menu.Add(new TextMenuExt.SubHeaderExt(Path.GetFileName(fileName)) { HeightExtra = 0f, TextColor = Color.PaleVioletRed }); } } } if (Everest.Updater.HasUpdate) { menu.Add(new TextMenu.Button(Dialog.Clean("modoptions_coremodule_update").Replace("((version))", Everest.Updater.Newest.Build.ToString())).Pressed(() => { Everest.Updater.Update(Instance.Overworld.Goto <OuiLoggedProgress>()); })); } if (missingDependencies.Count != 0) { menu.Add(new TextMenu.Button(Dialog.Clean("modoptions_coremodule_downloaddeps")).Pressed(() => { OuiDependencyDownloader.MissingDependencies = missingDependencies; Instance.Overworld.Goto <OuiDependencyDownloader>(); })); } } // reorder Mod Options according to the modoptionsorder.txt file. List <EverestModule> modules = new List <EverestModule>(Everest._Modules); if (Everest.Loader._ModOptionsOrder != null && Everest.Loader._ModOptionsOrder.Count > 0) { foreach (string modName in Everest.Loader._ModOptionsOrder) { if (modName.Equals("Everest", StringComparison.InvariantCultureIgnoreCase)) { // the current entry is for Everest Core createModMenuSectionAndDelete(modules, module => module.Metadata.Name == "Everest", menu, inGame, snapshot); } else { string modPath = Path.Combine(Everest.Loader.PathMods, modName); // check for both PathDirectory and PathArchive for each module. if (!createModMenuSectionAndDelete(modules, module => module.Metadata.PathDirectory == modPath, menu, inGame, snapshot)) { createModMenuSectionAndDelete(modules, module => module.Metadata.PathArchive == modPath, menu, inGame, snapshot); } } } } foreach (EverestModule mod in modules) { mod.CreateModMenuSection(menu, inGame, snapshot); } if (menu.Height > menu.ScrollableMinSize) { menu.Position.Y = menu.ScrollTargetY; } ((patch_TextMenu)menu).BatchMode = false; return(menu); }
private void Awake() { cascateTickWait = new WaitForSeconds(cascateTickTime); addScoreEvent = RuntimeManager.CreateInstance(addScorePath); }
protected virtual void CreateModMenuSectionKeyBindings(TextMenu menu, bool inGame, EventInstance snapshot) { menu.Add(new TextMenu.Button(Dialog.Clean("options_keyconfig")).Pressed(() => { menu.Focused = false; Engine.Scene.Add(CreateKeyboardConfigUI(menu)); Engine.Scene.OnEndOfFrame += () => Engine.Scene.Entities.UpdateLists(); })); menu.Add(new TextMenu.Button(Dialog.Clean("options_btnconfig")).Pressed(() => { menu.Focused = false; Engine.Scene.Add(CreateButtonConfigUI(menu)); Engine.Scene.OnEndOfFrame += () => Engine.Scene.Entities.UpdateLists(); })); }
public static void SavePath(this EventInstance eventInstance, string path) { eventInstance.SetExtendedString(EventInstancePathKey, path); }
public void stopFMODEvents() { FMODCommon.ReleaseIfValid(this.hitGroundEvent, STOP_MODE.ALLOWFADEOUT); this.hitGroundEvent = null; }
private void Start() { soundEvent = RuntimeManager.CreateInstance(selectSound); }
public RESULT createSubEvent(string name, out EventInstance instance) { instance = null; IntPtr newPtr = new IntPtr(); RESULT result = FMOD_Studio_EventInstance_CreateSubEvent(rawPtr, Encoding.UTF8.GetBytes(name + Char.MinValue), out newPtr); if (result != RESULT.OK) { return result; } instance = new EventInstance(newPtr); return result; }
private void Start() { CanvasScore.instance.Initialize(); eventButton = RuntimeManager.CreateInstance(audiobutton); }
public RESULT getInstanceList(out EventInstance[] array) { array = null; RESULT result; int capacity; result = FMOD_Studio_EventDescription_GetInstanceCount(rawPtr, out capacity); if (result != RESULT.OK) { return result; } if (capacity == 0) { array = new EventInstance[0]; return result; } IntPtr[] rawArray = new IntPtr[capacity]; int actualCount; result = FMOD_Studio_EventDescription_GetInstanceList(rawPtr, rawArray, capacity, out actualCount); if (result != RESULT.OK) { return result; } if (actualCount > capacity) // More items added since we queried just now? { actualCount = capacity; } array = new EventInstance[actualCount]; for (int i=0; i<actualCount; ++i) { array[i] = new EventInstance(rawArray[i]); } return RESULT.OK; }
private IEnumerator Cutscene(Level level) { sfx = Audio.Play(CustomSFX.game_seedCrystalHeart_collect_all_main, Position); snapshot = Audio.CreateSnapshot(Snapshots.MAIN_DOWN, true); Player entity = Scene.Tracker.GetEntity <Player>(); if (entity != null) { cameraStart = entity.CameraTarget; } List <HeartGemShard> pieces = heartData.Get <List <HeartGemShard> >(HeartGemShard.HeartGem_HeartGemPieces); foreach (HeartGemShard piece in pieces) { piece.OnAllCollected(); } heart.Depth = Depths.FormationSequences - 2; heart.AddTag(Tags.FrozenUpdate); yield return(0.35f); Tag = Tags.FrozenUpdate | Tags.HUD; level.Frozen = true; level.FormationBackdrop.Display = true; level.FormationBackdrop.Alpha = 0.5f; level.Displacement.Clear(); level.Displacement.Enabled = false; Audio.BusPaused(Buses.AMBIENCE, true); Audio.BusPaused(Buses.CHAR, true); Audio.BusPaused(Buses.YES_PAUSE, true); Audio.BusPaused(Buses.CHAPTERS, true); yield return(0.1f); system = new ParticleSystem(-2000002, 50); system.Tag = Tags.FrozenUpdate; level.Add(system); float angleIncr = Calc.Circle / pieces.Count; float angle = angleIncr; Vector2 averatePos = Vector2.Zero; foreach (HeartGemShard piece in pieces) { averatePos += piece.Position; } averatePos /= pieces.Count; float duration = 5f; bool specialCase = pieces.Count == 3; foreach (HeartGemShard piece in pieces) { piece.StartSpinAnimation(averatePos, heart.Position, angle, duration, regular: !specialCase); angle += angleIncr; } Vector2 cameraTarget = heart.Position - new Vector2(160f, 90f); cameraTarget = cameraTarget.Clamp(level.Bounds.Left, level.Bounds.Top, level.Bounds.Right - 320, level.Bounds.Bottom - 180); Add(new Coroutine(CameraTo(cameraTarget, duration - .8f, Ease.CubeInOut, 0f), true)); yield return(duration); Input.Rumble(RumbleStrength.Light, RumbleLength.Long); Audio.Play(CustomSFX.game_seedCrystalHeart_shards_reform, heart.Position); foreach (HeartGemShard piece in pieces) { piece.StartCombineAnimation(heart.Position, 0.658f, system, level, spin: !specialCase); } yield return(0.658f); Input.Rumble(RumbleStrength.Medium, RumbleLength.Medium); foreach (HeartGemShard piece in pieces) { piece.RemoveSelf(); } level.Shake(); level.Flash(Color.White * .8f); HeartGemShard.CollectedPieces(heartData); yield return(0.5f); float dist = (level.Camera.Position - cameraStart).Length(); yield return(CameraTo(cameraStart, dist / 180f, null, 0f)); if (dist > 80f) { yield return(0.25f); } level.EndCutscene(); OnEnd(level); yield break; }
public RESULT createInstance(out EventInstance instance) { RESULT result = RESULT.OK; IntPtr eventinstanceraw = new IntPtr(); instance = null; try { result = FMOD_Studio_EventDescription_CreateInstance(rawPtr, out eventinstanceraw); } catch { result = RESULT.ERR_INVALID_PARAM; } if (result != RESULT.OK) { return result; } instance = new EventInstance(); instance.setRaw(eventinstanceraw); return result; }
protected override void InitializeEventInstance(EventInstance eventInstance) { }
public void WriteEvent(EventInstance instance, object[] values) { }
private IEnumerator Cutscene(Level level) { sfx = Audio.Play(SFX.game_gen_seed_complete_main, Position); snapshot = Audio.CreateSnapshot(Snapshots.MAIN_DOWN); Player player = Scene.Tracker.GetEntity <Player>(); if (player != null) { cameraStart = player.CameraTarget; } // Shorten code for reading. List <GenericStrawberrySeed> seeds = strawberry.Seeds; Entity entity = (Entity)strawberry; foreach (GenericStrawberrySeed seed in seeds) { seed.OnAllCollected(); } entity.Depth = -2000002; entity.AddTag(Tags.FrozenUpdate); yield return(0.35f); Tag = Tags.FrozenUpdate | Tags.HUD; level.Frozen = true; level.FormationBackdrop.Display = true; level.FormationBackdrop.Alpha = 0.5f; level.Displacement.Clear(); level.Displacement.Enabled = false; Audio.BusPaused(Buses.AMBIENCE, true); Audio.BusPaused(Buses.CHAR, true); Audio.BusPaused(Buses.YES_PAUSE, true); Audio.BusPaused(Buses.CHAPTERS, true); yield return(0.1f); system = new ParticleSystem(-2000002, 50); system.Tag = Tags.FrozenUpdate; level.Add(system); float angleSep = (float)Math.PI * 2 / seeds.Count; float angle = (float)Math.PI / 2; Vector2 avg = Vector2.Zero; foreach (GenericStrawberrySeed seed in seeds) { avg += seed.Position; } avg /= seeds.Count; foreach (GenericStrawberrySeed seed in seeds) { seed.StartSpinAnimation(avg, entity.Position, angle, 4f); angle -= angleSep; } avg = default; Vector2 target = entity.Position - new Vector2(160f, 90f); target = target.Clamp(level.Bounds.Left, level.Bounds.Top, level.Bounds.Right - 320, level.Bounds.Bottom - 180); Add(new Coroutine(CameraTo(target, 3.5f, Ease.CubeInOut))); target = default; yield return(4f); Input.Rumble(RumbleStrength.Light, RumbleLength.Long); Audio.Play(SFX.game_gen_seed_complete_berry, entity.Position); foreach (GenericStrawberrySeed seed in seeds) { seed.StartCombineAnimation(entity.Position, 0.6f, system); } yield return(0.6f); Input.Rumble(RumbleStrength.Medium, RumbleLength.Medium); foreach (GenericStrawberrySeed seed in seeds) { seed.RemoveSelf(); } strawberry.CollectedSeeds(); yield return(0.5f); float dist = (level.Camera.Position - cameraStart).Length(); yield return(CameraTo(cameraStart, dist / 180f)); if (dist > 80f) { yield return(0.25f); } level.EndCutscene(); OnEnd(level); yield break; }
void Start() { _goblinLaugh = StudioSystem.GetEvent (GoblinLaugh.path); _goblinLyrics = StudioSystem.GetEvent (GoblinLyrics.path); _goblinDeath = StudioSystem.GetEvent (GoblinDeath.path); }
public void WriteEvent(EventInstance instance, byte[] data, object[] values) { }