void Start() { //Screen.lockCursor = true; //Screen.fullScreen = true; Screen.sleepTimeout = SleepTimeout.NeverSleep; if (GameObject.FindObjectOfType <OptionsController>()) { optionsController = GameObject.FindObjectOfType <OptionsController>(); optionsController.gameObject.SetActive(false); uiCanvas = GameObject.Find("UI Canvas").GetComponent <Canvas>(); } if (autoLoadNextLevelAfter <= 0f) { Debug.Log("Level auto load disabled"); } else { Debug.Log("Autoloading level " + SceneManager.GetActiveScene().buildIndex + 1); Invoke("LoadNextLevel", autoLoadNextLevelAfter); } }
/// <summary> /// Opens the backup path in a explorer window. /// </summary> public static void OpenBackupPath() { if (!string.IsNullOrEmpty(View.BackupPath)) { OptionsController.OpenFolder(View.BackupPath); } }
// Use this for initialization void Start() { cam = Camera.main; distanceZ = Mathf.Abs(cam.transform.position.z + transform.position.z); rb = GetComponent <Rigidbody2D> (); op = GameObject.FindWithTag("OptionsController").GetComponent <OptionsController> (); if (op == null) { Debug.Log("OptionsController nicht gefunden!"); } pc = GameObject.FindWithTag("Player").GetComponent <PlayerController> (); if (pc == null) { Debug.Log("PlayerController nicht gefunden!"); } leftConstraint = cam.ScreenToWorldPoint(new Vector3(0.0f, 0.0f, distanceZ)).x; rightConstraint = cam.ScreenToWorldPoint(new Vector3(Screen.width, 0.0f, distanceZ)).x; bottomConstraint = cam.ScreenToWorldPoint(new Vector3(0.0f, 0.0f, distanceZ)).y; topConstraint = cam.ScreenToWorldPoint(new Vector3(0.0f, Screen.height, distanceZ)).y; float magnitude = Random.Range(minForce, maxForce); float torque = Random.Range(minTorque, maxForce); float x = Random.Range(-1f, 1f); float y = Random.Range(-1f, 1f); rb.AddForce(magnitude * new Vector2(x, y)); rb.AddTorque(torque); }
public static List <ShipBodyMaterial> loadShip(int shipSlotNumber) { List <ShipBodyMaterial> shipMatrix = new List <ShipBodyMaterial>(); List <ShipSaveHolder> ship = new List <ShipSaveHolder>(); if (File.Exists(Application.persistentDataPath + "/" + OptionsController.GetConstantValue(0) + "_ship" + shipSlotNumber + ".dat")) { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Open(Application.persistentDataPath + "/" + OptionsController.GetConstantValue(0) + "_ship" + shipSlotNumber + ".dat", FileMode.Open); ship = (List <ShipSaveHolder>)bf.Deserialize(file); file.Close(); if (ship.Count > 0) { foreach (ShipSaveHolder ssh in ship) { ShipBodyMaterial sbm = new ShipBodyMaterial(); sbm.cell.x = ssh.posX; sbm.cell.y = ssh.posY; //sbm.stats = ssh.sms; shipMatrix.Add(sbm); } } } else { Debug.Log("There is no ship in Ship Slot:" + shipSlotNumber + " for Profile:" + OptionsController.GetConstantValue(0)); } return(shipMatrix); }
private void Start() { gc = this; cc = GameObject.Find("CameraParentObject").GetComponent <CameraController>(); pc = GameObject.Find("Player").GetComponent <PlayerController>(); uc = GameObject.Find("Canvas").GetComponent <UIController>(); gv = GetComponent <GameVibrator>(); sc = GetComponent <SceneController>(); cg = GameObject.Find("Canvas").GetComponent <ClaimGems>(); scc = GameObject.Find("Canvas").GetComponent <SecondChanceController>(); fc = GameObject.Find("Canvas").GetComponent <FeverController>(); bm = GetComponent <BrickManager>(); ads = GameObject.Find("Canvas").GetComponent <AdSimulation>(); scorec = GameObject.Find("Canvas").GetComponent <ScoreController>(); gemc = GameObject.Find("Canvas").GetComponent <GemController>(); oc = GameObject.Find("OptionsButton").GetComponent <OptionsController>(); am = GameObject.Find("CameraParentObject").GetComponent <AudioManager>(); DontDestroyOnLoad(gameObject); DontDestroyOnLoad(uc.gameObject); DontDestroyOnLoad(pc.gameObject); DontDestroyOnLoad(cc.gameObject); DontDestroyOnLoad(GameObject.Find("EventSystem")); DontDestroyOnLoad(GameObject.Find("Directional Light")); DontDestroyOnLoad(GameObject.Find("LiteFPSCounter")); pc.enabled = false; sc.LoadScene("LevelScene"); storing = GetComponent <Storing>(); LoadAllData(); pc.SelectedBrick = bm.GetCurrentBrick(); }
public void UpdateOSC() { Settings.Instance.OSC_IP = oscIP.text; Settings.Instance.OSC_Port = oscPort.text; Settings.Instance.OSC_Enabled = oscEnabled.isOn; OptionsController.Find <OSCMessageSender>()?.ReloadOSCStats(); }
void Start () { Cursor.visible = false; optionsController = GameObject.FindObjectOfType<OptionsController>(); if (!optionsController) Debug.LogError (this + ":ERROR: unable to attach to OptionsController to reset options to defaults"); optionsController.SetDefaults(); optionsController.Save (); Invoke("LoadNextLevel", autoLoadNextLevelDelay); }
// Use this for initialization void Start() { shipDesign = OptionsController.GetCurrentShip(); // Initialize Play currentLives = lives; NewLife(); // Get Engines GameObject engines = OptionsController.GetCurrentEngines(); foreach (Transform child in engines.transform) { Vector3 pos; if (child.position.x == 0) { pos = shipDesign.transform.FindChild("Center Engine").position; } else if (child.position.x < 0) { pos = shipDesign.transform.FindChild("Left Engine").position; } else { pos = shipDesign.transform.FindChild("Right Engine").position; } GameObject go = Instantiate(child.gameObject, pos + transform.position, Quaternion.identity) as GameObject; go.transform.parent = transform; } }
/// <summary> /// Event handler for the KSPMAStarted event. /// Starts the app and mod update checks. /// </summary> protected static void KSPMAStarted(object sender) { EventDistributor.InvokeAsyncTaskStarted(Instance); ModSelectionController.View.ShowBusy = true; AsyncTask <bool> .DoWork(() => { // Auto KSP MA update check. OptionsController.Check4AppUpdates(); // Auto mod update check. OptionsController.Check4ModUpdates(true); return(true); }, (result, ex) => { EventDistributor.InvokeAsyncTaskDone(Instance); ModSelectionController.View.ShowBusy = false; if (ex != null) { Messenger.AddError(string.Format("Error during startup update checks! {0}", ex.Message), ex); } } ); }
private void OpenFolder(ModNode node) { if (node != null && !node.IsFile && node.IsInstalled) { OptionsController.OpenFolder(KSPPathHelper.GetAbsolutePath(SelectedNode.Destination)); } }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); sounds = GetComponents <AudioSource> (); if (SceneManager.GetActiveScene().buildIndex < 2) { muteToggle = GameObject.FindWithTag("volume_mute").GetComponent <Toggle> (); mSlider = GameObject.FindWithTag("volume_master").GetComponent <Slider> (); sfxSlider = GameObject.FindWithTag("volume_sfx").GetComponent <Slider> (); menuSlider = GameObject.FindWithTag("volume_menu").GetComponent <Slider> (); gameSlider = GameObject.FindWithTag("volume_game").GetComponent <Slider> (); } if (SceneManager.GetActiveScene().buildIndex == 1) { ui = GameObject.FindWithTag("OptionsController").GetComponent <UIController> (); } }
public IEnumerable <IndivPricing> GetIndivPrices(string nationalityId, string professionId) { string SQL = @"select distinct * from new_indvprice where new_nationality = '@nationalityId' and new_profession = '@professionId' and statecode = 0 and new_forweb = 1"; SQL = SQL.Replace("@nationalityId", nationalityId); SQL = SQL.Replace("@professionId", professionId); DataTable dt = CRMAccessDB.SelectQ(SQL).Tables[0]; List <IndivPricing> List = new List <IndivPricing>(); for (int i = 0; i < dt.Rows.Count; i++) { List.Add(new IndivPricing() { Id = dt.Rows[i]["new_indvpriceId"].ToString(), Name = dt.Rows[i]["new_pricename"].ToString(), Number = dt.Rows[i]["new_pricenumber"].ToString(), NationalityName = dt.Rows[i]["new_nationalityName"].ToString(), TypeId = dt.Rows[i]["new_pricetype"].ToString(), TypeName = OptionsController.GetName("new_indvprice", "new_pricetype", 1025, dt.Rows[i]["new_pricetype"].ToString()), ContractMonths = MathNumber.RoundDeciaml(dt.Rows[i]["new_contractmonths"].ToString()), PeriodAmount = MathNumber.RoundDeciaml(dt.Rows[i]["new_periodamount"].ToString()), EveryMonth = MathNumber.RoundDeciaml(dt.Rows[i]["new_everymonth"].ToString()), MonthelyPaid = MathNumber.RoundDeciaml(dt.Rows[i]["new_monthlypaid"].ToString()), PrePaid = MathNumber.RoundDeciaml(dt.Rows[i]["new_monthlypaid"].ToString()), NationalityId = nationalityId, ProfessionId = professionId, }); } return(List); }
public void UpdateChromaLite(bool enabled) { if (!enabled) { OptionsController.Find <PlatformDescriptor>()?.KillChromaLights(); } Settings.Instance.EmulateChromaLite = enabled; }
public void SetUp() { fileSystem = MockRepository.GenerateStub<IFileSystem>(); xmlSerializer = MockRepository.GenerateStub<IXmlSerializer>(); unhandledExceptionPolicy = MockRepository.GenerateStub<IUnhandledExceptionPolicy>(); eventAggregator = MockRepository.GenerateStub<IEventAggregator>(); optionsController = new OptionsController(fileSystem, xmlSerializer, unhandledExceptionPolicy, eventAggregator); }
public void SetUp() { fileSystem = MockRepository.GenerateStub <IFileSystem>(); xmlSerializer = MockRepository.GenerateStub <IXmlSerializer>(); unhandledExceptionPolicy = MockRepository.GenerateStub <IUnhandledExceptionPolicy>(); eventAggregator = MockRepository.GenerateStub <IEventAggregator>(); optionsController = new OptionsController(fileSystem, xmlSerializer, unhandledExceptionPolicy, eventAggregator); }
private void Awake() { base.Awake(); _optionsController = FindObjectOfType <OptionsController>(); if (_optionsController == null) { throw new Exception($"No OptionController Object on {SceneManager.GetActiveScene().name} scene"); } }
public void it_should_allow_methods() { var controller = new OptionsController(HttpStatusCode.MethodNotAllowed, "GET"); controller.Response = new StringResponseInfo(String.Empty, new RequestInfo(Verb.POST, (HttpUrl)UrlParser.Parse("/"), new MemoryStream(), new BasicClaimBasedIdentity())); controller.Allow(); controller.Response.Headers["Allow"].Should().Be("GET"); }
private void tsbAddMod_Click(object sender, EventArgs e) { //Check for a downloads folder (configured and exists) while (!OptionsController.HasValidDownloadPath) { OptionsController.SelectNewDownloadPath(); } ModSelectionController.OpenAddModDialog(); }
public override void LoadOption() { if (!OptionsController.TryGetOptionValue(optionName, out string optionValue) || !bool.TryParse(optionValue, out bool value) || toggle == null) { return; } toggle.SetIsOnWithoutNotify(value); }
public void initialise() { _repository = new Mock <IOptionsRepository>(); var mockUoW = new Mock <IUnitOfWork>(); mockUoW.SetupGet(o => o.Options).Returns(_repository.Object); _controller = new OptionsController(mockUoW.Object); }
void CheckCount() { // End game in case of Negative score if (count < 0) { collisonText.text = ""; OptionsController.PauseGame(); showPopUp = true; } }
IEnumerator optionsRoutine() { audioSource.PlayOneShot(click); FadeOut(); yield return(new WaitForSeconds(1)); OptionsController Options = FindObjectOfType <OptionsController>(); Options.OptionsMenu(); }
public static void Save(Talkable talkable) { var options = OptionsController.GetOptions(); RTFDocument doc = CreateDocument(); doc = AddTalkable(doc, talkable, options); RTFParser.ToFile("Assets/" + PlayerSettings.productName + " Screenplay - " + talkable.name + " - " + options.currentLanguage + ".rtf", doc); AssetDatabase.Refresh(); }
// Use this for initialization void Start() { spawnPoints = playerSpawnPoints.GetComponentsInChildren <Transform>(); optionsController = FindObjectOfType <OptionsController>(); print(optionsController); //print(spawnPoints.Length); slider.value = health; SetOrangeColor(); Diff(); }
public void it_should_allow_methods_in_CORS_request() { var controller = new OptionsController(HttpStatusCode.MethodNotAllowed, "GET"); var request = new RequestInfo(Verb.OPTIONS, (HttpUrl)UrlParser.Parse("/"), new MemoryStream(), new BasicClaimBasedIdentity(), new Header("Origin", "temp.uri"), new Header("Access-Control-Request-Method", "GET")); controller.Response = new StringResponseInfo(String.Empty, request); controller.Allow(); controller.Response.Headers["Access-Control-Allow-Methods"].Should().Be("GET"); }
void SetScreenResolution() { if (!PlayerPrefs.HasKey(GamePreferences.ScreenResolution)) { GamePreferences.SetScreenResolution("big"); } else { OptionsController.SetScreenResolution(GamePreferences.ScreenResolution); } }
private void Awake() { if (instance != null && instance != this) { Destroy(this); } else { instance = this; } }
///<summary> ///Выбираем и сохраняем расположение папки с MSTS ///</summary> private void SelectFolderMenuItem_Click(object sender, EventArgs e) { DialogResult result = SelectFolderDialog.ShowDialog(); //Открываем диалоговое окно выбора директории if (result == DialogResult.OK) //Если пользователь выбрал директорию { var path = SelectFolderDialog.SelectedPath; //Получаем путь к выбранной директории OptionsController.SetPath(path); //Пытаемся записать путь к MSTS в конфигурационный файл LoadPath(); // Пробуем получить путь к МСТС } }
public static void SaveOptionsData(OptionsController optionsController) { BinaryFormatter formatter = new BinaryFormatter(); string path = Application.persistentDataPath + "/options.taco"; FileStream stream = new FileStream(path, FileMode.Create); OptionData data = new OptionData(optionsController); formatter.Serialize(stream, data); stream.Close(); }
private void Awake() { //Singleton pattern, we know that only one exists instance = this; //Keep this object through scenes, since we use it as a holder for data if (SceneManager.GetActiveScene().name == "Menu") { DontDestroyOnLoad(this.gameObject); } }
public void Save() { Controller.Instance.Options.attributes = ArrayHelper.Copy(attributesTemp); Controller.Instance.Options.languages = ArrayHelper.Copy(languagesTemp); Controller.Instance.Options.jsonPrettyPrint = jsonPrettyPrintTemp; Controller.Instance.Options.currentLanguage = string.Copy(currentLanguageTemp); Controller.Instance.Options.SetLanguageList(); CharactersController.UpdateList(Controller.Instance.Options); OptionsController.Save(Controller.Instance.Options, Controller.Instance.Options.jsonPrettyPrint); Close(); }
private void Start() { UpdateAudio(); if (PlayerPrefController.GetLoadStatus() == 0) { OptionsController optionsController = new OptionsController(); optionsController.Defaults(); Destroy(optionsController, 1.5f); PlayerPrefController.SetAsLoadedBefore(); } }
public OptionsRequestMapping(OperationInfo<Verb> operation, HttpUrl methodRoute, HttpStatusCode responseStatusCode, params string[] allowed) { if (operation == null) { throw new ArgumentNullException("operation"); } if (allowed == null) { throw new ArgumentNullException("allowed"); } if (allowed.Length == 0) { throw new ArgumentOutOfRangeException("allowed"); } Target = new OptionsController(responseStatusCode, allowed); Operation = operation; MethodRoute = methodRoute; ArgumentSources = new Dictionary<int, ArgumentValueSources>(operation.UnderlyingMethod.GetParameters().Length + (operation.UnderlyingMethod.ReturnType != typeof(void) ? 1 : 0)); }
public void RegisterController(OptionsController controller) { this.controller = controller; }
void OnApplicationQuit() { Save(); s_Instance = null; }
public void ShowOptions() { var optionsView = viewFactory.CreateOptionsView(); OptionsController optionsController = new OptionsController(optionsView, true, servicesProvider); optionsView.ShowModal(); }
public void gameController_ShowOptionsRequested(object sender, EventArgs e) { var optionsView = logicStarter.ViewFactory.CreateOptionsView(); OptionsController optionsController = new OptionsController(optionsView, true, logicStarter.ServicesProvider); optionsView.ShowModal(); }
void gameController_ShowOptionsRequested(object sender, EventArgs e) { var optionsView = viewFactory.CreateOptionsView(); OptionsController optionsController = new OptionsController(optionsView, false, servicesProvider); optionsView.ShowModal(); }