public async Task <IActionResult> Edit(int id, [Bind("Id,ApplicationUserId,PartyName,DateTime")] PartyTime partyTime) { if (id != partyTime.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(partyTime); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PartyTimeExists(partyTime.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ApplicationUserId"] = new SelectList(_context.ApplicationUser, "Id", "Id", partyTime.ApplicationUserId); return(View(partyTime)); }
//make Partytime happening each minute void StartParty() { //set property startQuarantaine = true; partytime = PartyTime.ON; //play audio alarme _audioSource.Stop(); _audioSource.clip = _audioClipPartyTime; _audioSource.Play(); //stop ambient light MainLight.SetActive(false); //start flashing lights StartCoroutine(coroutine); //vfx bolt lights Instantiate(vfx, new Vector3(fxPos.position.x, fxPos.position.y, fxPos.position.z), Quaternion.identity); //play sfx of bolt lights BoltAudio.GetComponent <AudioSource>().Play(); //find objects "nothing" and put them on gravity if (GameObject.FindGameObjectsWithTag("Objet").Length != 0) { foreach (GameObject go in GameObject.FindGameObjectsWithTag("Objet")) { if (go.GetComponent <Objet>().GetIsNothingObject()) { go.GetComponent <Rigidbody>().useGravity = false; go.GetComponent <Rigidbody>().AddForce(new Vector3(Random.Range(0f, 3.0f), Random.Range(0f, 1.0f), Random.Range(0f, 3.0f)), ForceMode.Impulse); } } } }
public async Task <IActionResult> Create([Bind("Id,DateTime,Name,ApplicationUserId")] PartyTime partyTime) { if (ModelState.IsValid) { _context.Add(partyTime); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(partyTime)); }
public async Task <IActionResult> Create([Bind("Id,ApplicationUserId,PartyName,DateTime")] PartyTime partyTime) { if (ModelState.IsValid) { _context.Add(partyTime); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ApplicationUserId"] = new SelectList(_context.ApplicationUser, "Id", "Id", partyTime.ApplicationUserId); return(View(partyTime)); }
void Start() { this.timer = 0.0f; this.partyTimer = 0.0f; this.score = 0; this.startQuarantaine = false; _audioSource = this.gameObject.AddComponent <AudioSource>(); textMeshScore.text = score.ToString(); textMeshTimer.text = "05:00"; gstate = GameState.START; partytime = PartyTime.OFF; _audioSource.PlayOneShot(_audioClipAmbient); coroutine = Flashing(); }
void StopParty() { MainLight.SetActive(true); StopCoroutine(coroutine); PartyLight.SetActive(false); BoltAudio.GetComponent <AudioSource>().Stop(); //put gravity back to objects if (GameObject.FindGameObjectsWithTag("Objet").Length != 0) { foreach (GameObject go in GameObject.FindGameObjectsWithTag("Objet")) { go.GetComponent <Rigidbody>().useGravity = true; } } //reset property startQuarantaine = false; partytime = PartyTime.OFF; partyTimer = 0.0f; _audioSource.Stop(); _audioSource.clip = _audioClipAmbient; _audioSource.Play(); }