void Awake() { if (instance == null) { instance = this; } }
IEnumerator ClientCheck() { string persistentCVFile = GameUtility.PersistentHotfixPath + "/ClientVersion.txt"; string streamingCVFile = GameUtility.StreamingHotfixPathFull + "/ClientVersion.txt"; yield return(GameLoader.LoadText(streamingCVFile, (str) => { ClientVersion streamCC = JsonUtility.FromJson <ClientVersion> (str); ClientVersion persistentCC = LoadPersistentCC(persistentCVFile); if (persistentCC != null) { if (streamCC.md5 != persistentCC.md5) { Caching.CleanCache(); File.WriteAllText(persistentCVFile, str); Debug.Log("CleanCache And WriteClient"); } } else { if (!Directory.Exists(GameUtility.PersistentHotfixPath)) { Directory.CreateDirectory(GameUtility.PersistentHotfixPath); } File.WriteAllText(persistentCVFile, str); Debug.Log("WriteClient"); } })); }
IEnumerator LoadManifest() { string file = GameUtility.StreamingHotfixPathApp + "/" + Configs.clientConfig.hotfixFile; AssetBundle curBundle = null; yield return(GameLoader.LoadFromFileAsync(file, (bundle) => { curBundle = bundle; })); AssetBundleRequest requst = curBundle.LoadAssetAsync <AssetBundleManifest> ("AssetBundleManifest"); yield return(requst); if (requst.asset != null) { streamManifest = (AssetBundleManifest)requst.asset; } curBundle.Unload(false); curBundle = null; yield return(GameLoader.LoadAssetBundle(GameUtility.resURL + Configs.clientConfig.hotfixFile, (bundle) => { curBundle = bundle; })); requst = curBundle.LoadAssetAsync <AssetBundleManifest> ("AssetBundleManifest"); yield return(requst); if (requst.asset != null) { remoteManifest = (AssetBundleManifest)requst.asset; } curBundle.Unload(false); curBundle = null; }
private void LateInitialize(On.Celeste.GameLoader.orig_Begin orig, GameLoader self) { orig(self); var dll = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(asm => asm.FullName.Contains("ExtendedVariant")); if (dll != null) { var ty = dll.GetType("ExtendedVariants.Module.ExtendedVariantsModule"); var module = ty.GetField("Instance", BindingFlags.Static | BindingFlags.Public).GetValue(null); var method = ty.GetMethod("ResetToDefaultSettings", BindingFlags.Public | BindingFlags.Instance); ResetExtendedVariants = () => { method.Invoke(module, new object[0]); }; } else { ResetExtendedVariants = () => {}; } dll = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(asm => asm.FullName.Contains("IsaMods")); if (dll != null) { var ty = dll.GetType("Celeste.Mod.IsaGrabBag.ForceVariantTrigger"); var method = ty.GetMethod("SetVariantsToDefault", BindingFlags.Static | BindingFlags.Public); ResetIsaVariants = () => { method.Invoke(null, new object[0]); }; } else { ResetIsaVariants = () => {}; } this.DelayedLoadMechanics(); this.DelayedLoadQol(); }
internal SetScriptBase(SetScriptConstructor constructor, IFunction appliesTo, string property, GameLoader loader) { m_constructor = constructor; AppliesTo = appliesTo; Property = property; m_loader = loader; }
public FunctionCallScript(GameLoader loader, string procedure, IList<IFunction> parameters, IScript paramFunction) { m_loader = loader; m_procedure = procedure.Replace(" ", Utility.SpaceReplacementString); m_parameters = new FunctionCallParameters(parameters); m_paramFunction = paramFunction; }
internal SetScriptBase(SetScriptConstructor constructor, IFunction appliesTo, string property, GameLoader loader) { m_constructor = constructor; AppliesTo = appliesTo; Property = property; m_loader = loader; }
public GameManager Initialize(int startLevel) { //_topScore= ServiceLocator.Get<SaveSystem>().LoadBinary<int>("topScore"); GameLoader.CallOnComplete(OnGameLoaderComplete); SetLevel(startLevel); return(this); }
// Use this for initialization void Start() { GameLoader.LoadData(); GameLoader.LoadScenario(); sceneSwitcher = gameObject.GetComponent <SceneSwitcher>(); sceneSwitcher.LoadMain(); }
public void OnNbPlayersChanged() { Dropdown dd = GameObject.Find("NbPlayers_Dropdown").GetComponent <Dropdown> (); GameLoader gl = GameObject.Find("GameLoader").GetComponent <GameLoader> (); gl.setNbPlayers(dd.value + 1); }
// Update is called once per frame private void Update() { if (firstUpdate) { firstUpdate = false; GameLoader.LoaderCallBack(); } }
private void bLoadGame_Click(object sender, EventArgs e) { var gameLoader = new GameLoader(); gameLoader.StartMenu = this; gameLoader.LoadGame(); SettingsPanel.Hide(); }
private void SaveEndExit() { updateProvider.IsStoped = true; orbitalManager.Save(); gameModeManager.Save(); GameLoader.Reload(); }
public override void Begin() { base.Begin(); this.previousX = this.previousX2 = this.gameObject.transform.position.x; this.edge = 0.5; this.timer = this.effectTimer = 1.0; this.loader = GameSystem.GetGameData <GameLoader>("GameLoader");; }
public Save() { Version = 1; PlayerID = GameLoader.GetUniqueKey(8); PlayerData = new PlayerData(); GarageData = new GarageData(); SettingsData = new SettingsData(); }
private void LoadFile(string path, List <string> pathArgs = null) { var projectLoader = new GameLoader(); this.FileReaderProvider = projectLoader.Load(path); project = FileReaderProvider.GetProjectReader().Load(); BasePath = project.BaseDir; PixelsDown = project.ScreenHeight; PixelsAcross = project.ScreenWidth; if (ScreenSizeChanged != null) { ScreenSizeChangedEventArgs args = new ScreenSizeChangedEventArgs(PixelsAcross, PixelsDown); ScreenSizeChanged(this, args); } if (project.MusicNSF != null) { Engine.Instance.SoundSystem.LoadMusicNSF(project.MusicNSF.Absolute); } if (project.EffectsNSF != null) { Engine.Instance.SoundSystem.LoadSfxNSF(project.EffectsNSF.Absolute); } foreach (var stageInfo in project.Stages) { stageFactory.Load(stageInfo); } _tileProperties.LoadProperties(project.EntityProperties); _entitySource.LoadEntities(project.Entities); EffectParser.LoadEffectsList(project.Functions); Engine.Instance.SoundSystem.LoadEffectsFromInfo(project.Sounds); Scene.LoadScenes(project.Scenes); Menu.LoadMenus(project.Menus); FontSystem.Load(project.Fonts); PaletteSystem.LoadPalettes(project.Palettes); currentPath = path; if (pathArgs != null && pathArgs.Any()) { ProcessCommandLineArgs(pathArgs); } else if (project.StartHandler != null) { _stateMachine.ProcessHandler(project.StartHandler); } else { throw new GameRunException("The game file loaded correctly, but it failed to specify a starting point!"); } Player = new Player(); }
//--- Class Methods --- public static void Main(string[] args) { // check if a filepath to an adventure file was provided and that the file exists if (args.Length != 1) { Console.WriteLine("ERROR: missing path to adventure file."); return; } if (!File.Exists(args[0])) { Console.WriteLine("ERROR: cannot find file."); return; } // initialize the game from the adventure file Game game; GamePlayer player; try { game = GameLoader.LoadFrom(args[0]); player = new GamePlayer(Game.StartPlaceId); } catch (GameLoaderException e) { Console.WriteLine($"ERROR: {e.Message}"); return; } catch (Exception e) { Console.WriteLine($"ERROR: unable to load file"); Console.WriteLine(e); return; } Console.Clear(); // start the game loop var responses = game.Do(player, GameCommandType.Restart); try { while (true) { if (PlayResponses(responses)) { return; } // prompt user input Console.Write("> "); var commandText = Console.ReadLine().Trim().ToLower(); if (!Enum.TryParse(commandText, true, out GameCommandType command)) { responses = new[] { new GameResponseNotUnderstood() }; continue; } // process user input responses = game.Do(player, command); } } catch (Exception e) { Console.Error.WriteLine(e); } }
private void Awake() { if (hudPrefab == null) { Debug.Log("UIManager has no hud prefab assigned"); } GameLoader.CallOnComplete(Initialize); }
void Start() { menu = GameObject.Find("Menu"); gl = menu.GetComponent <GameLoader>(); p1Score = GameObject.Find("p1Score").GetComponent <Text>(); p2Score = GameObject.Find("p2Score").GetComponent <Text>(); cam = GameObject.Find("Main Camera"); }
/// <summary> /// Loads the games stored in the preferences into the UI. /// </summary> private async Task LoadGames() { var sw = new Stopwatch(); sw.Start(); var loader = new GameLoader(); var dialog = EverlookGameLoadingDialog.Create(this); dialog.ShowAll(); var loadingProgress = default(OverallLoadingProgress); loadingProgress.OperationCount = GamePathStorage.Instance.GamePaths.Count; var loadedGames = 0; foreach (var gameTarget in GamePathStorage.Instance.GamePaths) { loadedGames++; loadingProgress.FinishedOperations = loadedGames; dialog.OverallProgressNotifier.Report(loadingProgress); if (!Directory.Exists(gameTarget.Path)) { Log.Warn($"Could not find game folder for {gameTarget.Alias}. Has the directory moved?"); continue; } try { (var group, var nodeTree) = await loader.LoadGameAsync ( gameTarget.Alias, gameTarget.Path, dialog.CancellationSource.Token, dialog.GameLoadProgressNotifier ); if (group is null || nodeTree is null) { continue; } AddGamePage(gameTarget.Alias, gameTarget.Version, group, nodeTree); } catch (OperationCanceledException) { Log.Info("Cancelled game loading operation."); break; } } dialog.Destroy(); sw.Stop(); Log.Debug($"Game loading took {sw.Elapsed.TotalMilliseconds}ms ({sw.Elapsed.TotalSeconds}s)"); }
public PlayGame(string fileName) { InitializeComponent(); var loader = new GameLoader(); definition = loader.LoadGame(fileName); engine = new GameEngine(definition); pictureBox1.Refresh(); }
void GetReferences() { offlineManager = FindObjectOfType <OfflineManager>(); playFabLogin = FindObjectOfType <PlayfabNoEmailLogin>(); // playFab = FindObjectOfType<PlayFabLogin>(); internetManager = FindObjectOfType <InternetManager>(); gameloader = FindObjectOfType <GameLoader>(); popupManager = FindObjectOfType <PopupManager>(); }
void GetReferencesFromScene() { flowchart = GameObject.FindObjectOfType <Flowchart>(); flowchartTransVar = flowchart.GetVariable <TransformVariable>("thisTrans"); gameSaver = GameObject.FindObjectOfType <GameSaver>(); gameLoader = GameObject.FindObjectOfType <GameLoader>(); saveManager = GameObject.FindObjectOfType <SaveManager>(); GetRefsToGameObjects(); }
void OnPhotonInstantiate(PhotonMessageInfo info) { if (photonView.isMine) { battleLauncher = GameObject.FindGameObjectWithTag("BattleLauncher").GetComponent <BattleLauncher>(); playername = battleLauncher.playername; } gameLoader = GameObject.FindGameObjectWithTag("GameLoader").GetComponent <GameLoader>(); gameLoader.playersready++; }
public void LoadScene(string scene, GameLoader gameLoader) { if (persistentState.ContainsKey(scene)) { foreach (State.Data data in persistentState[scene]) { gameLoader.StartCoroutine(State.LoadObject(data, guidManager)); } } }
static public IEnumerator LoadFromJson <T>(string path, string name, Action <T> callback = null) { yield return(GameLoader.LoadText(path + "/" + name + ".txt", (str) => { T config = JsonUtility.FromJson <T> (str); if (callback != null) { callback(config); } })); }
private void LoadGame(string file) { GameLoader loader = new GameLoader(); definition = loader.LoadGame(file); fileName = file; UpdateTree(); //this.Text = file; this.Text = definition.Name; }
public Game1() { this.IsMouseVisible = true; graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; gameWorld = new GameWorld(this); loader = new GameLoader(gameWorld); input = new InputManager(gameWorld); }
public static void RegisterAudio() { GameLoader.AddSoundFile(GameLoader.NAMESPACE + "ZombieAudio", new List <string>() { GameLoader.AUDIO_FOLDER_PANDA + "/Zombie1.ogg", GameLoader.AUDIO_FOLDER_PANDA + "/Zombie2.ogg", GameLoader.AUDIO_FOLDER_PANDA + "/Zombie3.ogg", GameLoader.AUDIO_FOLDER_PANDA + "/Zombie4.ogg", }); }
public SuperMetroidComponent(LiveSplitState state) { GameLoader.Load(new SuperMetroid()); InternalComponent = new ComponentRendererComponent(); var components = new List <IComponent>(); components.Add(new ItemTracker()); //components.Add(new BossTracker()); InternalComponent.VisibleComponents = components; }
private static void LoadUpdatables() { if (JSON.Deserialize(GameLoader.GetUpdatableBlocksJSONPath(), out JSONNode jSONNode, false)) { if (jSONNode.TryGetChild(Items.UpdatableBlocks.Herbs.NAME, out JSONNode array)) { Items.UpdatableBlocks.Herbs.Load(array); } } }
public void OnLoadGame(ref GameLoader.GameDataContainer data) { for (int i = 0; i < data.AcquiredUpgrades.Count; i++) { this.UpgradeList[data.AcquiredUpgrades[i]].ApplyUpgrade(); this.UpgradeList.Remove(data.AcquiredUpgrades[i]); this.AcquiredUps.Add(data.AcquiredUpgrades[i]); } UpdateUpgrdList (); }
public void OnLoadGame(ref GameLoader.GameDataContainer cont) { this.Money = cont.Money; UpdateMoneyDisplay (); this.ProdList = GameLoader.LoadProducts (ref cont); foreach (Products p in ProdList.Keys) { UpdateButtonDisplay(p); } }
void IPunInstantiateMagicCallback.OnPhotonInstantiate(PhotonMessageInfo info) { if (photonView.IsMine) { battleLauncher = GameObject.FindGameObjectWithTag("BattleLauncher").GetComponent <BattleLauncher>(); playername = battleLauncher.playername; portraitnumber = battleLauncher.selectedportraitnumber; } gameLoader = GameObject.FindGameObjectWithTag("GameLoader").GetComponent <GameLoader>(); gameLoader.playersready++; }
internal KGLLoaderUtility(string fileName, GameLoader gameLoader) { Parser parser = new Parser(grammar); string src = File.ReadAllText(fileName); ParseTree parseTree = parser.Parse(src, fileName); //TODO find out what to do here to get the error to show if (parseTree.HasErrors()) { var builder = new StringBuilder("Can't construct game due to syntax errors:" + Environment.NewLine + Environment.NewLine); foreach (var message in parseTree.ParserMessages) { builder.AppendLine(message.Message + " at line " + message.Location.Line + " column " + message.Location.Column); } Game.CurrentGame.Die(builder.ToString()); } Root = parseTree.Root; }
public SetScriptScript(SetScriptConstructor constructor, IFunction appliesTo, string property, IScript script, GameLoader loader) : base(constructor, appliesTo, property, loader) { m_script = script; m_scriptFactory = constructor.ScriptFactory; }
public FunctionCallScript(GameLoader loader, string procedure) : this(loader, procedure, null, null) { }
public SetExpressionScript(SetScriptConstructor constructor, IFunction appliesTo, string property, Expression expr, GameLoader loader) : base(constructor, appliesTo, property, loader) { m_expr = expr; }
void Awake() { instance = this; }
private GameViewer() { title = "Game Viewer"; loader = new GameLoader (this); accel = new AccelGroup (); initialDirForFileChooser = App.Session.CurrentFolder; gameLoaders = new ArrayList (); exporters = new ArrayList (); menubar.highlightMoveMenuItem.Active = App.Session.HighLightMove; menubar.saveAsMenuItem.Activated += on_save_as_activate; menubar.switchSideMenuItem.Activated += on_switch_side_activate; menubar.moveCommentMenuItem.Activated += OnEditCommentActivated; menubar.highlightMoveMenuItem.Activated += OnHighlightMoveMenuItemActivated; menubar.switchSideMenuItem. AddAccelerator ("activate", accel, new AccelKey (Gdk.Key. t, Gdk. ModifierType. ControlMask, AccelFlags. Visible)); menubar.quitMenuItem. AddAccelerator ("activate", accel, new AccelKey (Gdk.Key. q, Gdk. ModifierType. ControlMask, AccelFlags. Visible)); Gtk.Image img = new Gtk.Image (); img.Stock = Stock.JustifyFill; toolbutton = new ToolButton (img, Catalog. GetString ("Viewer")); ShowAll (); toolbutton.ShowAll (); progressBar.Hide (); gameViewerWidget.ChessGameWidget.SplitPane. Position = App.Session.ViewerSplitPanePosition; CsBoardApp.Instance.QuitEvent += OnQuitEvent; }