void Start() { 死 = SoundManager.Instance(); soundOptions = SoundOptions.Instance(); 死.SetBGM(SoundManager.SFX.Main); 死.PlayBGM(); }
public void SubmitResult(ChoreographyCue cue) { //if (double.IsNaN(cue.Score)) //{ // Speech.Say("What the heck was that?"); //} //else if (cue.Score < 0) //{ // var recognizedAsName = Classifiers[cue.ClassifierKey].MatchingDatasetClasses[cue.GestureClassIndex].className; // Speech.Say($"Looked more like {recognizedAsName}, with {(-1 * cue.Score):f1} points.", SoundOptions.AtSpeed(2.0)); //} //else //{ // Speech.Say($"Score {cue.Score:f1}, {cue.Delay.TotalSeconds:f1} seconds", SoundOptions.AtSpeed(2.0)); //} if (IsOnPlayerTwo) { if (double.IsNaN(PlayerOneCue.Score)) { Speech.Say("First gesture unrecognized.", SoundOptions.AtSpeed(2.0)); } else if (double.IsNaN(cue.Score)) { Speech.Say("Second gesture unrecognized.", SoundOptions.AtSpeed(2.0)); } else { var P1netscore = PlayerOneCue.Score - PlayerOneCue.Delay.TotalSeconds; var P2netscore = cue.Score - cue.Delay.TotalSeconds; if (Math.Abs(P1netscore - P2netscore) < 0.35) { Speech.Say("Tie."); } else if (P1netscore > P2netscore) { Speech.Say("Point to first.", SoundOptions.AtSpeed(2.0)); } else { Speech.Say("Point to second.", SoundOptions.AtSpeed(2.0)); } } Generator.SubmitResults(PlayerOneCue, cue); IsOnPlayerTwo = false; PlayerOneCue = null; } else { PlayerOneCue = cue; IsOnPlayerTwo = true; ReceivedSubmission.Set(); } }
public Scenario OnQR(string qrString, IEffect effect, SoundOptions options = null, bool awaitCompletion = false) { if (awaitCompletion) { return(OnQR(qrString, () => { return effect.PlayToCompletion(options ?? SoundOptions.Default); })); } else { return(OnQR(qrString, () => { effect.Play(options ?? SoundOptions.Default); })); } }
public Scenario OnQR(string qrString, string contents, SoundOptions options = null, bool awaitCompletion = false) { if (awaitCompletion) { return(OnQR(qrString, () => { return Speech.SayAllOf(contents, options ?? SoundOptions.Default); })); } else { return(OnQR(qrString, () => { Speech.Say(contents, options ?? SoundOptions.Default); })); } }
public ScenarioCondition Then(IEffect effect, SoundOptions options = null, bool awaitCompletion = false) { if (awaitCompletion) { return(Then(() => { return effect.PlayToCompletion(options ?? SoundOptions.Default); })); } else { return(Then(() => { effect.Play(options ?? SoundOptions.Default); })); } }
public ScenarioCondition Then(string contents, SoundOptions options = null, bool awaitCompletion = false) { if (awaitCompletion) { return(Then(() => { return Speech.SayAllOf(contents, options ?? SoundOptions.Default); })); } else { return(Then(() => { Speech.Say(contents, options ?? SoundOptions.Default); })); } }
void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(this.gameObject); } else { Destroy(this.gameObject); } }
void Start() { soundManager = SoundManagerStaticReference.GetSoundManager(); if (soundManager == null) { Debug.LogError("Sound Manager not found."); } soundOptions = SoundManagerStaticReference.GetSoundOptions(); if (soundOptions == null) { Debug.LogError("Sound Options not found."); } }
void Start() { soundManager = SoundManager.Instance(); if (soundManager == null) { Debug.LogError("Sound Manager not found."); } soundOptions = SoundOptions.Instance(); if (soundOptions == null) { Debug.LogError("Sound Options not found."); } }
public static AudioSource SpawnSound(AudioClip clip, SoundOptions options = null) { options = options ?? new SoundOptions(); if (clip != null) { if (!Sounds.ContainsKey(clip)) { Sounds.Add(clip, new OneSound(clip, options)); } return(Sounds[clip].PlayAnother()); } return(null); }
// Use this for initialization void Start() { 死 = SoundManager.Instance(); soundOptions = SoundOptions.Instance(); 死.SetBGM(SoundManager.SFX.Farm); 死.PlayBGM(); maintainedDistance = (minZoomDistance + maxZoomDistance) / 2f; if (focusObject != null) { idealFocus = focusObject.transform.position + new Vector3(0, startingYOffset, 0); } resetCamera(); }
IEnumerator WaitForClip(SoundOptions clip, AudioSource source) { if (queued == false) { queued = true; yield return(new WaitWhile(() => source.isPlaying)); if (swimming == true) { source.volume = clip.volume; source.loop = clip.loop; source.clip = clip.sound; source.Play(); queued = false; } } }
void Start() { 死 = SoundManager.Instance(); soundOptions = SoundOptions.Instance(); 死.SetBGM(SoundManager.SFX.Race); 死.PlayBGM(); winScreen.SetActive(false); gliders = new GameObject[numAI + 1]; Glider glider = GameObject.Instantiate(gliderPrefab, start.position - start.forward * 2, start.rotation).GetComponent <Glider>(); glider.setAgent(new PlayerAgent(glider)); //glider.transform.Find("Main Camera").gameObject.SetActive(true); GameObject cam = GameObject.Instantiate(camPrefab, glider.transform.position, glider.transform.rotation); cam.GetComponent <CameraControl>().target = glider.transform; glider.indicator = indicator; glider.setRaceStats(SelectedRaceParameters.wingspan, SelectedRaceParameters.dragMultiplier, SelectedRaceParameters.mass, SelectedRaceParameters.controlAuthority); glider.GetComponent <Rigidbody>().constraints = RigidbodyConstraints.FreezePosition; gliders[0] = glider.gameObject; float aiMinSpan = Mathf.Max(SelectedRaceParameters.wingspan, RaceStatsCalculator.MIN_WINGSPAN); float aiMaxSpan = Mathf.Min(SelectedRaceParameters.wingspan, RaceStatsCalculator.MAX_WINGSPAN); float aiMinDrag = Mathf.Max(SelectedRaceParameters.wingspan, RaceStatsCalculator.MIN_DRAG_MULT); float aiMaxDrag = Mathf.Min(SelectedRaceParameters.wingspan, RaceStatsCalculator.MAX_DRAG_MULT); float aiMinMass = Mathf.Max(SelectedRaceParameters.wingspan, RaceStatsCalculator.MIN_MASS); float aiMaxMass = Mathf.Min(SelectedRaceParameters.wingspan, RaceStatsCalculator.MAX_MASS); float aiMinCtrl = Mathf.Max(SelectedRaceParameters.wingspan, RaceStatsCalculator.MIN_AUTHORITY); float aiMaxCtrl = Mathf.Min(SelectedRaceParameters.wingspan, RaceStatsCalculator.MAX_AUTHORITY); for (int i = 0; i < numAI; i++) { glider = GameObject.Instantiate(gliderPrefab, start.position + start.right * (i + 1) * 3, start.rotation).GetComponent <Glider>(); glider.setAgent(new AIAgent(glider, goal.position)); glider.setRaceStats(Random.Range(aiMinSpan, aiMaxSpan), Random.Range(aiMinDrag, aiMaxDrag), Random.Range(aiMinMass, aiMaxMass), Random.Range(aiMinCtrl, aiMaxCtrl)); glider.GetComponent <Rigidbody>().constraints = RigidbodyConstraints.FreezePosition; gliders[i + 1] = glider.gameObject; } }
protected async void RespondToPromptCue(object o, EventArgs <ChoreographyCue> eargs) { CurrentCue = eargs.Value; Classifier = CueClassifiers[CurrentCue.ClassifierKey]; //await GimmeCue(eargs.Value.GestureClass); SelectedGestureClass = Classifier.MatchingDatasetClasses[CurrentCue.GestureClassIndex]; if (CurrentCue.CueTime < DateTime.Now) { Log.Debug(_tag, $"Timing issue - CurrentCue.CueTime is {CurrentCue.CueTime}, now is {DateTime.Now}."); CurrentCue.CueTime = DateTime.Now + TimeSpan.FromMilliseconds(250); } var delay = CurrentCue.CueTime - DateTime.Now; await Task.Delay(delay); Speech.Say(SelectedGestureClass.className, SoundOptions.AtSpeed(2.0)); Stopwatch.Restart(); if (_singleMode) { MeleeChoreographer.Deactivate(); } }
void PlayRandomSound(SoundOptions[] inputSounds, AudioSource overrideSource = null, bool WaitToFinish = false) { if (inputSounds.Length <= 0) { return; } SoundOptions selected = inputSounds[UnityEngine.Random.Range(0, inputSounds.Length)]; if (overrideSource != null) { if (WaitToFinish == true) { StartCoroutine(WaitForClip(selected, overrideSource)); } else { overrideSource.volume = selected.volume; overrideSource.loop = selected.loop; overrideSource.clip = selected.sound; overrideSource.Play(); } } else { if (WaitToFinish == true) { StartCoroutine(WaitForClip(selected, soundSource)); } else { soundSource.volume = selected.volume; soundSource.loop = selected.loop; soundSource.clip = selected.sound; soundSource.Play(); } } }
protected float Sound(string text) { string[] components = text.Split(','); SoundOptions options = defaultSoundOptions; if (components.Length > 1) { string option = components[1].ToLower().Trim(); if (option.EndsWith("wait")) { options.waitFinish = TagState(option); } } if (!tagActionRunning) { foreach (AudioClip audioClip in sounds) { if (audioClip.name == components[0].Trim()) { Vector3 originPos = Camera.main.transform.position; float volume = Options.GetSFXVolume(); AudioSource.PlayClipAtPoint(audioClip, originPos, volume); if (options.waitFinish) { tagActionRunning = true; return(audioClip.length); } break; } } } tagActionRunning = false; return(actionComplete); }
// Start is called before the first frame update void Start() { nextButton.onClick.AddListener(delegate { selectNext(); }); lastButton.onClick.AddListener(delegate { selectPrev(); }); listItems = new List <StackSelectionListItem>(); henList = HenInfoPersist.loadList(); currentHenIndex = 0; updateSelection(); 死 = SoundManager.Instance(); soundOptions = SoundOptions.Instance(); if (Random.Range(0.0f, 1.0f) > 0.5) { 死.SetBGM(SoundManager.SFX.chickenMarch); 死.PlayBGM(); } else { 死.SetBGM(SoundManager.SFX.chickenMarchDubstep); 死.PlayBGM(); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.SimpleListPage); //FindAllViews(); Dataset = new DataSet <DKS>(); Classifier = new Classifier(); // Just in case; it's not actually going to get used in this version. var lView = FindViewById(Resource.Id.list); var mPanel = FindViewById(Resource.Id.listpage_backdrop); listView = lView as ListView; mainPanel = mPanel as RelativeLayout; //listView.ItemClick += ListView_ItemClick; //HackingActionsList = new HackingActionsList(); //HackingActionsList.SetUpBasicNetwork(); //HackingActionsList.SetUpFirewall(); //HackingActionsList.RegisterAllActions(); Map = new HackingMap(); Map.SetUpDefaults(); Map.SetupObjectiveChain("Root Access", "Security Server", "Suppress Cameras"); Map.SetupFirewall(); //Map.OnTransition += (o, e) => UpdateMapView(); UpdateMapView(); Speech.Say("Penetrating access point. Raising hud and gestural interface. Loading icebreakers. Scrambler countermeasures detected and partially neutralized.", SoundOptions.AtSpeed(2.0)); useVolumeTrigger = true; //OnVolumeButtonPressed += (o, e) => PerformSpellSelection(); }
void Awake() { Instance = this; }
public ScenarioCondition Then(int effectID, SoundOptions options = null, bool awaitCompletion = false) { var effect = new Effect(condition.qrString, effectID); return(Then(effect, options, awaitCompletion)); }
public void SubmitResult(ChoreographyCue cue) { if (double.IsNaN(cue.Score)) { Speech.Say("What the heck was that?"); } else if (cue.Score < 0) // Encodes "score but for the wrong gesture" in our Cue.Score scheme. { var recognizedAsName = Classifiers[cue.ClassifierKey].MatchingDatasetClasses[cue.GestureClassIndex].className; Speech.Say($"Looked more like {recognizedAsName}, with {(-1 * cue.Score):f1} points.", SoundOptions.AtSpeed(2.0)); } else { Speech.Say($"Score {cue.Score:f1}, {cue.Delay.TotalSeconds:f1} seconds", SoundOptions.AtSpeed(2.0)); } Generator.SubmitResults(cue, default(ChoreographyCue)); }
public Scenario OnQR(string qrString, int effectID, SoundOptions options = null, bool awaitCompletion = false) { var effect = new Effect(qrString, effectID); return(OnQR(qrString, effect, options, awaitCompletion)); }
protected override Task nextStageActionAsync() { return(Speech.SayAllOf("Got it.", SoundOptions.AtSpeed(1.75))); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); GravProvider = new Vector3Provider(SensorType.Gravity, StopToken); GravProvider.Activate(); // Getting this running right away means that we can ask it for a meaningful value when the player presses the button. useVolumeTrigger = true; OnVolumeButtonPressed += LimberUpVolumePressed; OnVolumeButtonReleased += LimberUpVolumeReleased; Speech.Say("Limber up."); Speech.Say("Start at zero, hold down button and mime your rotation, let go at zero.", SoundOptions.AtSpeed(1.25)); }
public SoundClassifier(IJSInProcessRuntime runtime, string modelURL, SoundOptions serializableOptions = null) { Runtime = runtime; Init(modelURL, serializableOptions); }
public SoundClassifier(IJSInProcessRuntime runtime, SoundModel model, SoundOptions serializableOptions = null) { Runtime = runtime; Init(model.ToString(), serializableOptions); }
public static AudioSource SpawnSound(AudioClip[] clips, SoundOptions options = null) { AudioClip clip = clips[UnityEngine.Random.Range(0, clips.Length)]; return(SpawnSound(clip, options)); }
public OneSound(AudioClip ac, SoundOptions options) { AudioClip = ac; Options = options; }
public void SetUpDefaults() { // Format: var AssessICE = Nodes["AssessICE"] = new HackingMapNode("Assess ICE"); var FalseTrail = Nodes["FalseTrail"] = new HackingMapNode("False Trail", "Lay False Trail"); var PasswordPrompt = Nodes["PasswordPrompt"] = new HackingMapNode("Password", "Password Prompt") { IsBlocking = true }; var ShellAccess = Nodes["ShellAccess"] = new HackingMapNode("Shell", "Shell Access"); var Paydata = Nodes["Paydata"] = new HackingMapNode("Paydata", "Seek Paydata"); var NetworkScan = Nodes["NetworkScan"] = new HackingMapNode("Netscan", "Network Scan"); // Assess ICE - investigate and un-hide pieces of ICE before they trip you up. AssessICE.IsAbove(StartNode); AssessICE.OnEntrySay = "Analyzing network"; AssessICE.Data["Detectables"] = new Dictionary <int, string> { { 3, "PasswordPrompt" }, { 5, "Firewall" }, { 8, "ProxyServer" }, { 12, "Biometrics" }, { 15, "Voiceprint" }, { 19, "TwoFactor" }, { 23, "Further countermeasures" } }; AssessICE.AddAction("Probe", HackGesture.Typing, (action, node) => { var detectables = AssessICE.Data["Detectables"] as Dictionary <int, string>; // Lookup from Data[], rather than direct local variable, because this way it can be altered between creation & use. node.Counter_Persistent++; action.Name = "Probe More"; if (detectables.TryGetValue(node.Counter_Persistent, out string nodeName)) // Their tally of digging-clicks corresponds to a valid list entry (whether it's present or not). { if (Exists(nodeName) && Nodes[nodeName] != null) { Nodes[nodeName].IsHidden = false; Speech.Say($"{Nodes[nodeName].Longname} detected", Interrupt); } else { Speech.Say($"{nodeName} not found.", Interrupt); } } }); // False Trail - preventative counter to trace attempts which might happen later. FalseTrail.IsBelow(StartNode, PasswordPrompt); FalseTrail.AddAction("Add Bounce", HackGesture.Typing, (action, node) => { var citynames = new string[] { "London", "New York", "Sydney", "Moscow", "Paris", "Bogota", "Rekyavick", "Berlin", "Nairobi", "Sao Paolo", "Leema", "Perth", "Singapore", "Hong Kong", "Vancouver", "Toronto", "Istanbul", "Delhi", "Los Angeles", "Miami", "Prague", "Malta", "The Caymans", "Brunei", "Ell five" }; if (Res.Random < 0.25) { Speech.Say($"Routing through {citynames.GetRandom()}", new SoundOptions() { Speed = 2.0, Interrupt = true }); node.Counter_Persistent++; } }); PasswordPrompt.IsRightOf(StartNode); PasswordPrompt.OnEntrySay = "Running Pineapple-hack 1.1 "; // Making it "longer" makes it be said faster [see Enter( )] PasswordPrompt.Data["targetClicks"] = MiscUtil.StaticRandom.Next(6, 11); PasswordPrompt.AddAction("Crack", HackGesture.Typing, (action, node) => { if (!node.IsBlocking) { return; } dataEntryEffect.Play(); node.Counter_ThisAccess++; if (node.Counter_ThisAccess > (int)node.Data["targetClicks"]) { node.IsBlocking = false; Speech.Say("Cracked it."); } }); ShellAccess.IsRightOf(PasswordPrompt); Paydata.IsBelow(ShellAccess); NetworkScan.IsAbove(ShellAccess); Paydata.AddAction("Assess", HackGesture.Typing, (action, node) => { Speech.Say("No valuable side data found on this server."); Paydata.Actions.Clear(); }); NetworkScan.AddAction("Trace Status", HackGesture.Left, async(action, node) => { await Speech.SayAllOf("Checking...", new SoundOptions() { Speed = 2.0, Interrupt = true }); await Task.Delay(750); Speech.Say("No active trace in progress.", SoundOptions.AtSpeed(1.5)); }); NetworkScan.AddAction("Delete Logs", HackGesture.Typing, (action, node) => { ExecutableActionsCounter--; // Doesn't count toward the actions needing deletion. node.Counter_Persistent++; if (0.25 * node.Counter_Persistent * node.Counter_Persistent >= ExecutableActionsCounter) { Speech.Say("Logs cleared. Passive trace; should; be impossible.", new SoundOptions() { Speed = 1.8, Interrupt = true }); } }); NetworkScan.AddAction("Detect Sysop", HackGesture.Right, async(action, node) => { await Speech.SayAllOf("Scanning...", new SoundOptions() { Speed = 2.0, Interrupt = true }); await Task.Delay(1000); Speech.Say("Sysop does not appear to be logged on.", SoundOptions.AtSpeed(1.5)); }); }