public MainViewModel(MusicLoader musicLoader, KeyDispatcher keyDispatcher) { _musicLoader = musicLoader; FileName = @"Files/Alle-eendjes-zwemmen-in-het-water.mid"; _keyDispatcher = keyDispatcher; _musicLoader.OnCompositionChanged += _musicLoader_OnCompositionChanged; }
public override void SetDefaults() { NPC.aiStyle = -1; NPC.lifeMax = 35000; NPC.damage = 0; NPC.defense = 15; NPC.knockBackResist = 0; NPC.width = 621 / 2; NPC.height = 877; NPC.scale = 1; NPC.value = 500; NPC.npcSlots = 4; NPC.boss = true; NPC.lavaImmune = true; NPC.noGravity = true; NPC.noTileCollide = true; NPC.HitSound = SoundID.NPCHit1; NPC.behindTiles = true; NPC.hide = true; NPC.DeathSound = SoundID.NPCDeath1; Music = MusicLoader.GetMusicSlot("KingdomTerrahearts/Sounds/Music/Vector to the Heaven"); s = new ProjectileSource_NPC(NPC); NPC.ai[0] = 50; }
public override void SetDefaults() { NPC.width = 110; NPC.height = 110; NPC.damage = 130; NPC.defense = 60; NPC.lifeMax = 330000; NPC.HitSound = SoundID.NPCHit5; NPC.DeathSound = SoundID.NPCDeath7; NPC.noGravity = true; NPC.noTileCollide = true; NPC.knockBackResist = 0f; NPC.lavaImmune = true; NPC.aiStyle = -1; NPC.value = Item.buyPrice(0, 15); NPC.boss = true; Music = ModLoader.TryGetMod("FargowiltasMusic", out Mod musicMod) ? MusicLoader.GetMusicSlot(musicMod, "Assets/Music/Champions") : MusicID.OtherworldlyBoss1; SceneEffectPriority = SceneEffectPriority.BossLow; NPC.dontTakeDamage = true; NPC.BossBar = ModContent.GetInstance <CompositeBossBar>(); }
public override void SetDefaults() { NPC.width = 130; NPC.height = 130; NPC.damage = 160; NPC.defense = 0; NPC.lifeMax = 35000; NPC.HitSound = SoundID.NPCHit5; NPC.DeathSound = SoundID.NPCDeath7; NPC.noGravity = true; NPC.noTileCollide = true; NPC.knockBackResist = 0f; NPC.lavaImmune = true; NPC.aiStyle = -1; NPC.value = Item.buyPrice(0, 15); NPC.boss = true; NPC.buffImmune[BuffID.Chilled] = true; NPC.buffImmune[BuffID.OnFire] = true; NPC.buffImmune[BuffID.Suffocation] = true; NPC.buffImmune[BuffID.Daybreak] = true; NPC.buffImmune[BuffID.StardustMinionBleed] = true; NPC.buffImmune[ModContent.BuffType <Lethargic>()] = true; NPC.buffImmune[ModContent.BuffType <ClippedWings>()] = true; Music = ModLoader.TryGetMod("FargowiltasMusic", out Mod musicMod) ? MusicLoader.GetMusicSlot(musicMod, "Assets/Music/Champions") : MusicID.OtherworldlyBoss1; NPC.dontTakeDamage = true; NPC.alpha = 255; }
public override void SetDefaults() { NPC.width = 80; NPC.height = 80; NPC.damage = 140; NPC.defense = 80; NPC.lifeMax = 170000; NPC.HitSound = SoundID.NPCHit41; NPC.DeathSound = SoundID.NPCDeath14; NPC.noGravity = true; NPC.noTileCollide = true; NPC.knockBackResist = 0f; NPC.lavaImmune = true; NPC.aiStyle = -1; NPC.value = Item.buyPrice(0, 15); NPC.boss = true; Music = ModLoader.TryGetMod("FargowiltasMusic", out Mod musicMod) ? MusicLoader.GetMusicSlot(musicMod, "Assets/Music/Champions") : MusicID.OtherworldlyBoss1; SceneEffectPriority = SceneEffectPriority.BossLow; NPC.behindTiles = true; NPC.trapImmune = true; NPC.scale *= 1.5f; }
public MainViewModel(MusicLoader musicLoader) { //TODO: Can we use some sort of eventing system so the managers layer doesn't have to know the viewmodel layer? _musicLoader = musicLoader; FileName = @"Files/Alle-eendjes-zwemmen-in-het-water.mid"; CurrentSaveState = new SavedState(this); }
public static void StartAndLoad() { if (startedAndLoaded) { return; } lock (typeof(MusicStarter)) { if (startedAndLoaded) { return; } var conf = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()) //.AddJsonFile("appsettings.json") .AddUserSecrets(typeof(MusicStarter).Assembly, optional: true) .Build(); var connectionString = conf.GetConnectionString("SignumTest") ?? "Data Source=.\\SQLEXPRESS;Initial Catalog=SignumTest;Integrated Security=true;TrustServerCertificate=true"; Start(connectionString); Administrator.TotalGeneration(); Schema.Current.Initialize(); MusicLoader.Load(); startedAndLoaded = true; } }
// Use this for initialization void Start() { gobSystemManager = GameObject.FindGameObjectWithTag("MANAGER_SCENE"); gobMenuManager = GameObject.FindGameObjectWithTag("MANAGER_MENU"); _ldrMusic = gobMenuManager.GetComponent<MusicLoader>() as MusicLoader; ManagerSetup(); }
public MainViewModel(PhotoService photoService, Viewport viewport, MusicLoader musicLoader) { this.photoService = photoService; this.viewport = viewport; this.musicLoader = musicLoader; Metadata = new MetadataViewModel(); }
public override void SetStaticDefaults() { DisplayName.SetDefault("Music Box (Lunatic Cultist)"); CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1; MusicLoader.AddMusicBox(Mod, MusicLoader.GetMusicSlot(Mod, "Music/LunaticCultist"), ModContent.ItemType <Items.CultistMusicBox>(), ModContent.TileType <Tiles.CultistMusicBox>()); }
// Update is called once per frame void Update() { gameObject.GetComponent <Text>().text = "CurrentSongs:" + MusicWheelBase.GetWheelItemCount() + " CurrentPacks:"; foreach (string s in MusicLoader.GetFolderFilter()) { gameObject.GetComponent <Text>().text = gameObject.GetComponent <Text>().text + s + " "; } }
public ShortcutChain(MusicLoader musicLoader, Editor editor, KeyDispatcher keyDispatcher) { // subscribe for keys keyDispatcher.KeyDown += KeyDispatcher_KeyDown; keyDispatcher.KeyUp += KeyDispatcher_KeyUp; // build hardcoded chain firstHandler = new SaveAsShortcutHandler(editor); firstHandler.SetNext(new OpenFileShortcutHandler(musicLoader)); }
//private AudioSource bgAudioSource; void Start() { Screen.fullScreen = false; MusicLoader.InitMusicLoader(); //bgAudioSource = gameObject.AddComponent<AudioSource>(); //bgAudioSource.playOnAwake = false; //bgAudioSource.hideFlags = HideFlags.HideInHierarchy; //bgAudioSource.transform.SetParent(this.transform); }
public override void UpdateObject(MusicLoader ldr) { int i = 0; // TODO Handle > 64 bars foreach(GameObject gob in _lstBars) { gob.transform.localScale = Vector3.Lerp(gob.transform.localScale, new Vector3(gob.transform.localScale.x, ldr.fSpectrum[i] * 20.0f * ((bSimpleLog) ? 1 : (i + 1)), gob.transform.localScale.z), 0.1f * Time.timeScale); i++; } }
public IEnumerator LoadNotExistAudio(string fileName) { var func = MusicLoader.LoadAudioClipAsync($"{Application.dataPath}/Tests/Resources/{fileName}"); while (func.MoveNext()) { yield return(null); } Assert.IsNull(func.Current, "楽曲がnullであること。"); }
public MainViewModel(MusicLoader musicLoader, Invoker invoker, EditorContext context) { _invoker = invoker; _pressedKeys = new Shortcut(); _musicLoader = musicLoader; _editorContext = context; FileName = @"Files/Alle-eendjes-zwemmen-in-het-water.mid"; _handler = new OpenFileHandler(_invoker, new Shortcut(Key.LeftCtrl, Key.O), SetFileName); }
public LilypondViewModel(MainViewModel mainViewModel, MusicLoader musicLoader) { // TODO: Can we use some sort of eventing system so the managers layer doesn't have to know the viewmodel layer and viewmodels don't know each other? // And viewmodels don't _mainViewModel = mainViewModel; _musicLoader = musicLoader; _musicLoader.LilypondViewModel = this; _text = "Your lilypond text will appear here."; }
public LilypondViewModel(MusicLoader musicLoader, Editor editor) { musicLoader.OnCompositionChanged += MusicLoader_OnCompositionChanged; _musicLoader = musicLoader; editor.SetLilypondViewModel(this); _editor = editor; _text = "Your lilypond text will appear here."; }
public override void UpdateObject(MusicLoader ldr) { foreach(List<GameObject> lst in lstLstBars) { int i = 0; foreach(GameObject gob in lst) { gob.transform.localScale = new Vector3(gob.transform.localScale.x, (ldr.fSpectrum[i] * 10.0f * ((bSimpleLog) ? 1 : (i + 1))) + 1.0f, gob.transform.localScale.z); /*Color updateColor = new Color( ((i < iBlockPerHalf) ? 1.0f - (i * fTintPerBar) : 0.0f) * ldr.fOutPower, ((i < iBlockPerHalf) ? (i * fTintPerBar) : 1.0f - ((i - iBlockPerHalf) * fTintPerBar)) * ldr.fOutPower, ((i > iBlockPerHalf) ? ((i - iBlockPerHalf) * fTintPerBar) : 0.0f) * ldr.fOutPower, 1.0f );*/ Color updateColor; if (i < iBlockPerHalf) { float fDistanceLeft = 1.0f - ((float)i / (float)iBlockPerHalf); float fDistanceRight = (float)i / (float)iBlockPerHalf; updateColor = new Color( (colColourRamp[0].r * fDistanceLeft) + (colColourRamp[1].r * fDistanceRight), (colColourRamp[0].g * fDistanceLeft) + (colColourRamp[1].g * fDistanceRight), (colColourRamp[0].b * fDistanceLeft) + (colColourRamp[1].b * fDistanceRight), 1.0f ); } else { float fDistanceLeft = 1.0f - (((float)i - (float)iBlockPerHalf) / ((float)iNumberOfBars - (float)iBlockPerHalf)); float fDistanceRight = ((float)i - (float)iBlockPerHalf) / ((float)iNumberOfBars - (float)iBlockPerHalf); updateColor = new Color( (colColourRamp[1].r * fDistanceLeft) + (colColourRamp[2].r * fDistanceRight), (colColourRamp[1].g * fDistanceLeft) + (colColourRamp[2].g * fDistanceRight), (colColourRamp[1].b * fDistanceLeft) + (colColourRamp[2].b * fDistanceRight), 1.0f ); } if (bSmoothTransitions) { gob.GetComponent<Renderer>().material.color = Color.Lerp(gob.GetComponent<Renderer>().material.color, updateColor, 0.1f * Time.timeScale * Time.deltaTime); } else { gob.GetComponent<Renderer>().material.color = updateColor; } i++; } } }
IEnumerator LoadMusicList(List <string> levelsSorted) { MusicLoader musicLoader = FindObjectOfType <MusicLoader>(); yield return(StartCoroutine(musicLoader.LoadMusicFiles(musicList, levelsSorted))); // Disable level browser because user is currently in main menu //Color tmp = new Color(0, 0, 0, 0); //transform.parent.GetChild(transform.parent.childCount - 1).GetComponent<Image>().color = tmp; //transform.parent.gameObject.SetActive(false); }
public override void UpdateSystem(MusicLoader ldr) { sysMySys.startSize = ldr.fKickPower * 2.0f; ParticleSystem.Particle[] particles = new ParticleSystem.Particle[sysMySys.particleCount]; sysMySys.GetParticles(particles); for (int i = 0; i < particles.Length; i++) { //particles[i].size = Mathf.Lerp(particles[i].size, ldr.fKickPower * 2.0f, 0.1f * Time.deltaTime * Time.timeScale); particles[i].size = (ldr.fKickPower * 2.0f) + 1.0f; } sysMySys.SetParticles(particles, particles.Length); }
public Editor(MusicLoader musicLoader, KeyDispatcher keyDispatcher) { // set dependencies _musicLoader = musicLoader; _mainViewModel = ServiceLocator.Current.GetInstance <MainViewModel>(); // init state and subscribe events lastSavedComposition = new Composition(); SetState(new IdleEditorState(this)); _musicLoader.OnCompositionChanged += _musicLoader_OnCompositionChanged; _mainViewModel.OnWindowClosing += _mainViewModel_OnWindowClosing; // init shortcutchain new ShortcutChain(musicLoader, this, keyDispatcher); }
public override void UpdateSystem(MusicLoader ldr) { sysMySys.startSize = ldr.fKickPower * 2.0f; ParticleSystem.Particle[] particles = new ParticleSystem.Particle[sysMySys.particleCount]; sysMySys.GetParticles(particles); for (int i = 0; i < particles.Length; i++) { particles[i].size = Mathf.Lerp(particles[i].size, ldr.fKickPower * 2.0f, 0.1f * Time.deltaTime * Time.timeScale); } sysMySys.SetParticles(particles, particles.Length); renSystemRenderer.material.color = Color.Lerp(renSystemRenderer.material.color, new Color(0.0f, 1.0f * ldr.fKickPower, 0.0f, 1.0f), 0.1f * Time.timeScale * Time.deltaTime); sysMySys.startColor = Color.Lerp(sysMySys.startColor, new Color(0.0f, 1.0f * ldr.fKickPower, 0.0f, 1.0f), 0.1f * Time.timeScale * Time.deltaTime); }
public void SaveManyMList() { using (var tr = new Transaction()) using (OperationLogic.AllowSave <LabelEntity>()) using (OperationLogic.AllowSave <CountryEntity>()) using (OperationLogic.AllowSave <AlbumEntity>()) using (OperationLogic.AllowSave <ArtistEntity>()) { var prev = Database.MListQuery((AlbumEntity a) => a.Songs).Count(); var authors = Database.Query <BandEntity>().Take(6).ToList().Concat <IAuthorEntity>( Database.Query <ArtistEntity>().Take(8).ToList()).ToList(); var label = new LabelEntity { Name = "Four Music", Country = new CountryEntity { Name = "Germany" }, Node = MusicLoader.NextLabelNode() }; List <AlbumEntity> albums = 0.To(16).Select(i => new AlbumEntity() { Name = "System Greatest hits {0}".FormatWith(i), Author = i < authors.Count ? authors[i] : new ArtistEntity { Name = ".Net Framework" }, Year = 2001, Songs = { new SongEmbedded { Name = "Compilation {0}".FormatWith(i) } }, State = AlbumState.Saved, Label = label, }).ToList(); albums.SaveList(); Assert.All(GraphExplorer.FromRoots(albums), a => Assert.False(a.IsGraphModified)); Assert.Equal(prev + 16, Database.MListQuery((AlbumEntity a) => a.Songs).Count()); albums.ForEach(a => a.Name += "Updated"); albums.SaveList(); albums.ForEach(a => a.Songs.ForEach(s => s.Name = "Updated")); albums.SaveList(); //tr.Commit(); } }
/// <summary> /// 楽曲データをロードする。 /// </summary> /// <returns>IEnumerator</returns> IEnumerator LoadMusic() { MusicData md = PlayInfo.Instance.Music; musicNameText.text = md.name; noteManager.Initialize(md.notes); var func = MusicLoader.LoadAudioClipAsync(FileUtils.GetGameDataPath() + "/" + md.audioFileName); yield return(StartCoroutine(func)); var audioClip = (AudioClip)func.Current; audioManager.SetBGM(audioClip); }
public static void InitCardSelector() { mfdata = MusicLoader.LoadSongDataFromDisk(); mdata = MusicLoader.ConvertMusicFoldersToMusicData(mfdata); mdata_new = new List <MusicData>(); filters = new List <string>(); CardNum = mdata.Count; GameObject.Find("TotalCards").GetComponent <Text>().text = "CurrentSelected:" + mdata_new.Count; DestroyCardList(); CreateCardList(); DestroyToogleList(); CreateToggleList(); //InitCardListToCurrentList(); }
private void Awake() { Debug.Log("Awake MusicLoader " + GetInstanceID()); if (_instance == null) { _instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); print("Destroying Extra MusicLoader"); } }
public IEnumerator LoadExistAudio(string fileName) { float startTime = Time.realtimeSinceStartup; var func = MusicLoader.LoadAudioClipAsync($"{Application.dataPath}/Tests/Resources/{fileName}"); while (func.MoveNext()) { yield return(null); } float endTime = Time.realtimeSinceStartup - startTime; var clip = (AudioClip)func.Current; Assert.IsTrue(endTime < 0.5f, "ロード時間が0.5秒未満であること。"); Assert.IsNotNull(clip, "楽曲がnullでないこと。"); }
public LilypondViewModel(MainViewModel mainViewModel, MusicLoader musicLoader) { // TODO: Can we use some sort of eventing system so the managers layer doesn't have to know the viewmodel layer and viewmodels don't know each other? // And viewmodels don't _mainViewModel = mainViewModel; _musicLoader = musicLoader; _musicLoader.LilypondViewModel = this; _text = new LilypondText(); _caretaker = new LilypondTextCaretaker(_text); _movedInHistory = false; LilypondText = "Your lilypond text will appear here."; _caretaker.change(); UndoCommand.RaiseCanExecuteChanged(); RedoCommand.RaiseCanExecuteChanged(); }
public override void OnInBiome(Player player) { if (KingdomTerrahearts.instance.AnyEnemiesAround()) { if (!MusicLoader.GetMusic("KingdomTerrahearts/Sounds/Music/Twilight Town Combat").IsPlaying) { MusicLoader.GetMusic("KingdomTerrahearts/Sounds/Music/Twilight Town Combat").Play(); } } else { if (!MusicLoader.GetMusic("KingdomTerrahearts/Sounds/Music/Lazy Afternoons").IsPlaying) { MusicLoader.GetMusic("KingdomTerrahearts/Sounds/Music/Lazy Afternoons").Play(); } } }
public void SaveMList() { using (var tr = new Transaction()) using (OperationLogic.AllowSave <LabelEntity>()) using (OperationLogic.AllowSave <CountryEntity>()) using (OperationLogic.AllowSave <AlbumEntity>()) using (OperationLogic.AllowSave <ArtistEntity>()) { var prev = Database.MListQuery((AlbumEntity a) => a.Songs).Count(); Type[] types = typeof(int).Assembly.GetTypes().Where(a => a.Name.Length > 3 && a.Name.StartsWith("A")).ToArray(); AlbumEntity album = new AlbumEntity() { Name = "System Greatest hits", Author = new ArtistEntity { Name = ".Net Framework" }, Year = 2001, Songs = types.Select(t => new SongEmbedded() { Name = t.Name }).ToMList(), State = AlbumState.Saved, Label = new LabelEntity { Name = "Four Music", Country = new CountryEntity { Name = "Germany" }, Node = MusicLoader.NextLabelNode() }, }.Save(); Assert.All(GraphExplorer.FromRoot(album), a => Assert.False(a.IsGraphModified)); Assert.Equal(prev + types.Length, Database.MListQuery((AlbumEntity a) => a.Songs).Count()); album.Name += "Updated"; album.Save(); album.Songs.ForEach(a => a.Name = "Updated"); album.Save(); //tr.Commit(); } }
public void ButtonOnClickEvent() { // Application.LoadLevel("songselect"); cardSelectState = !cardSelectState; cl.SetActive(cardSelectState); if (cardSelectState) { CardSelectManager.InitCardSelector(); GameObject.Find("Scrollbar").GetComponent <SongListScrollbar>().blocked = true; } else { MusicLoader.UpdateSongList(CardSelectManager.mdata_new); GameObject.Find("Scrollbar").GetComponent <SongListScrollbar>().blocked = false; MusicLoader.FolderFilter = CardSelectManager.filters.ToArray(); } }
public MidiPlayerViewModel(MusicLoader musicLoader) { // The OutputDevice is a midi device on the midi channel of your computer. // The audio will be streamed towards this output. // DeviceID 0 is your computer's audio channel. _outputDevice = new OutputDevice(0); _sequencer = new Sequencer(); _sequencer.ChannelMessagePlayed += ChannelMessagePlayed; // Wanneer de sequence klaar is moeten we alles closen en stoppen. _sequencer.PlayingCompleted += (playingSender, playingEvent) => { Stop(); }; musicLoader.OnCompositionChanged += MusicLoader_OnCompositionChanged; }
void Start() { ambientMusicIndex = 0; modeIndex = 0; //leemos y cargamos la musica y los modos MusicLoader.SetJson(jsonFile.text); load(); playerController = player.GetComponent <PlayerController>(); //calculamos el valor de cada salto entre modos enemyModeInterval = Vector3.Distance(player.transform.position, enemyPos.position) / modes.Count; energyModeInterval = (float)(playerController.maxEnergia) / modes.Count; joyasModeInterval = (float)(GameManager.instance.joyasTotales) / modes.Count; //se toca un acorde de la musica de ambiente cada 0.6 segundos InvokeRepeating("playAmbient", 0.0f, 0.6f); }
public void OnBtnFinish() { string fullname = mInputFilename.GetComponent <InputField>().text; string[] splits = fullname.Split(new char[2] { '\\', '/' }); string filename = splits[splits.Length - 1]; Song song = new Song(); song.DBID = -1; song.BPM = mCustomTP.BPM; song.StartTime = mCustomTP.StartTime; song.EndTime = mCustomTP.EndTime; song.FilePath = String.Join("/", splits, 0, splits.Length - 1) + "/"; song.FileNameNoExt = splits[splits.Length - 1].Split('.')[0]; song.Title = mInputTitle.GetComponent <InputField>().text; song.Artist = mInputArtist.GetComponent <InputField>().text; song.StarCount = 0; song.UserID = Setting.Inst().UserName; song.Bars = mCustomTP.ExportToBars(); song.BarCount = song.Bars.Length; byte[] buf = Utils.Serialize(song); File.WriteAllBytes(Application.persistentDataPath + "/" + song.FileNameNoExt + ".bytes", buf); if (mEditTarget != null) { mEditTarget.GetComponent <ItemDisplay>().SongInfo = song; } else { GameObject musicListObj = GameObject.Find("btnList").GetComponent <MainCategory>().SelectView; MusicLoader loader = musicListObj.GetComponentInChildren <MusicLoader>(); loader.AddNewSong(song); } MainCategory mainCate = GameObject.Find("btnList").GetComponent <MainCategory>(); mainCate.OnClickButton(); ResetAll(); mCustomTP.ReleaseAll(); }
public virtual void UpdateSystem(MusicLoader ldr) { }
public virtual void UpdateMaterial(MusicLoader ldr) { }
public virtual void UpdateObject(MusicLoader ldr) { }
// Use this for initialization void Start() { gobCanvas = GameObject.FindGameObjectWithTag("CANVAS"); _ldrMusic = gobManagerMenu.GetComponent<MusicLoader>(); _txtLoadPercentage = gobLoadPercentageText.GetComponent<Text>(); _txtMode = gobModeSelect.GetComponent<Text>(); _transLoadingBarProgress = gobLoadLoadingBarProgress.GetComponent<RectTransform>(); fLoadingBarMaxWidth = gobLoadLoadingBarImg.GetComponent<RectTransform>().sizeDelta.x; }
public override void UpdateObject(MusicLoader ldr) { transMyTransform.localScale = Vector3.Lerp(transMyTransform.localScale, new Vector3(ldr.fKickPower * 10.0f, ldr.fKickPower * 10.0f, ldr.fKickPower * 10.0f), 0.1f * Time.timeScale * Time.deltaTime); }
public override void UpdateMaterial(MusicLoader ldr) { matMyMat.color = Color.Lerp(matMyMat.color, new Color(0.0f, ldr.fKickPower, 0.0f, 1.0f), 0.1f * Time.timeScale * Time.deltaTime); }
public override void UpdateSystem(MusicLoader ldr) { sysMySys.startSize = ldr.fKickPower * 5.0f; //matMyMat.color = Color.Lerp(matMyMat.color, new Color(1.0f * ldr.fKickPower, 0.0f, 1.0f * ldr.fKickPower, 1.0f), 0.1f * Time.timeScale * Time.deltaTime); }