public CrossfaderManager(LogManager log, AudioManager audioManager) { Log = log; Log.AddMessage("Initializing Crossfader...", LogLevel.INFO); AudioManager = audioManager; PreviewDuration = 10; }
public SoundEffectManager(LogManager log, AudioManager audioManager, SettingsManager settings) { Log = log; AudioManager = audioManager; SettingsManager = settings; Sounds = new Dictionary <string, string>(); Log.AddMessage("Initializing Sound Effect Manager...", LogLevel.INFO); }
public SongManager(LogManager log, AudioManager audioManager, SettingsManager settings) { Log = log; AudioManager = audioManager; SettingsManager = settings; Log.AddMessage("Initializing Song Manager...", LogLevel.INFO); CreateLoaders(); }
public AudioManager(LogManager log) { Log = log; _channelAssignments = new string[CHANNEL_COUNT]; Log.AddMessage("Initializing Audio Manager...", LogLevel.INFO); CheckFMODErrors(Factory.System_Create(ref _fmodSystem)); CheckFMODErrors(_fmodSystem.init(CHANNEL_COUNT, INITFLAGS.NORMAL, new IntPtr(0))); }
private void InitManagers() { Log = new LogManager { Enabled = true, SaveLog = true, RootFolder = WgibeatRootFolder, LogLevel = LogLevel.INFO }; Log.AddMessage("Initializing Cookies...", LogLevel.INFO); Cookies = new Dictionary <string, object>(); TextureManager.Log = Log; TextureManager.GraphicsDevice = this.GraphicsDevice; Metrics = new MetricsManager { Log = this.Log }; Settings = SettingsManager.LoadFromFile(WgibeatRootFolder + "\\settings.txt", this.Log); Log.LogLevel = (LogLevel)Settings.Get <int>("LogLevel"); HighScores = HighScoreManager.LoadFromFile(WgibeatRootFolder + "\\Scores.conf", this.Log); Profiles = ProfileManager.LoadFromFolder(WgibeatRootFolder + "\\Profiles", this.Log); //TODO: Refactor Text = TextManager.LoadFromFile(WgibeatRootFolder + "\\Content\\Text\\OptionText.txt", this.Log); Text.AddResource(WgibeatRootFolder + "\\Content\\Text\\EditorText.txt"); Text.AddResource(WgibeatRootFolder + "\\Content\\Text\\ModeText.txt"); Audio = new AudioManager(this.Log) { FallbackSound = (WgibeatRootFolder + "\\Content\\SoundEffects\\Fallback.ogg") }; Audio.SetMasterVolume((float)Settings.Get <double>("SongVolume")); Songs = new SongManager(this.Log, this.Audio, this.Settings); Sounds = new SoundEffectManager(this.Log, this.Audio, this.Settings); Crossfader = new CrossfaderManager(this.Log, this.Audio); CPUManager = new CPUManager(this.Log); CPUManager.LoadWeights("CPUSkill.txt"); _menuMusicManager = new MenuMusicManager(this.Log) { MusicFilePath = WgibeatRootFolder + "\\MenuMusic\\", AudioManager = this.Audio, Crossfader = this.Crossfader }; _menuMusicManager.LoadMusicList(_menuMusicManager.MusicFilePath + "MusicList.txt"); // _menuMusicManager.ChangeMusic("InitialLoad"); KeyMappings = new KeyMappings(this.Log); if (!KeyMappings.LoadFromFile("Keys.conf")) { KeyMappings.LoadDefault(); } UpdateManager = new UpdateManager { Log = this.Log }; }
/// <summary> /// Changes the currently displayed GameScreen to the one with the provided name. /// This GameScreen must already be present on the GameScreen Dictionary. /// </summary> /// <param name="screen">The name of the GameScreen to change to.</param> public void ScreenTransition(string screen) { if (!_screens.ContainsKey(screen)) { throw new InvalidOperationException("GameCore does not contain a screen called: " + screen); } _screens[screen].Initialize(); _activeScreen = _screens[screen]; _menuMusicManager.ChangeMusic(screen); Log.AddMessage("Screen transition to: " + screen, LogLevel.INFO); }
void Awake() { try { nu = NativeUart.Instance; deviceList.ClearOptions(); deviceList.onValueChanged.AddListener(index => { devicePath = deviceList.options[index].text; }); baudrateInput.onValueChanged.AddListener(value => { baudrate = int.Parse(value); }); switchPort.onClick.AddListener(SwitchPort); send.onClick.AddListener(SendCommand); clear.onClick.AddListener(() => { logManager.ClearMssage(); }); forbidden.onClick.AddListener(() => { isForbiddenReceive = !isForbiddenReceive; forbidden.GetComponentInChildren <Text>().text = isForbiddenReceive ? "打开禁止自动更新日志" : "关闭禁止自动更新日志"; }); send.interactable = false; tip.SetActive(false); nu.OnUartState += SerialState; nu.OnUartDeviceList += SerialDeviceList; nu.OnUartMessageRead += SerialMessageReceived; nu.Init(); } catch (Exception e) { logManager.AddMessage(LogManager.MessageType.Error, "Initialize serial port error: " + e.Message); } }
public static Texture2D Textures(string id) { if (!_textures.ContainsKey(id.ToUpper())) { Log.AddMessage(String.Format("Texture {0} is missing.", id.ToUpper()), LogLevel.ERROR); if (_textures.ContainsKey("MISSINGGRAPHIC")) { _textures.Add(id.ToUpper(), _textures["MISSINGGRAPHIC"]); } else { _textures.Add(id.ToUpper(), new Texture2D(GraphicsDevice, 1, 1)); } } return(_textures[id.ToUpper()]); }
private void Activate() { // Não ser clicável caso o mundo não acabe nesse path ou já tenha acabado if (!activatable || gameHasEnded) { return; } // Ativa o nodo node.isActive = true; bool textAdded = false; GameObject.FindObjectOfType <GameController>().AddIcon(node.iconPrefab); // Checa se possui end rule if (node.endRule) { if (node.endRule.Check()) // Mundo acabou { logManager.AddMessage(node.endRule.triggeredMessage); gameHasEnded = true; FindObjectOfType <SceneController>().EnableRestart(); textAdded = true; activatable = false; } else if (node.endRule.untriggeredMessage.Trim().Length > 0) // Mundo não acabou { logManager.AddMessage(node.endRule.untriggeredMessage); textAdded = true; activatable = false; } } if (!textAdded) { // Mostra a mensagem logManager.AddMessage(node.message); // valida se existe interações if (node.interactions.Count > 0) { interacaoFlag = true; // percorre as interações e olha se todos os nodos da interação estão ativos foreach (Interaction a in node.interactions) { foreach (StoryNode b in a.nodes) { if (b.isActive) { GameObject.FindObjectOfType <GameController>().AddIcon(b.iconPrefab); logManager.AddMessage(a.message); } } } } } // Passa pro proximo nodo if (!gameHasEnded) { if (node.nextNode) { node = node.nextNode; activationsCounter += 1; transform.localScale = initScale * 1.5f * activationsCounter; } else { Debug.LogError("Didn't find next node!! Title: " + node.title); } } }
public MenuMusicManager(LogManager log) { _musicList = new Dictionary <string, string>(); log.AddMessage("Initializing Menu Music Manager...", LogLevel.INFO); Log = log; }