public async Task <IActionResult> Edit(int id, [Bind("ID,Name")] Squasher squasher) { if (id != squasher.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(squasher); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SquasherExists(squasher.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(squasher)); }
// Use this for initialization void Start() { squasher = GetComponent <Squasher>(); // modifierText = GetComponent<Text>(); NewValue(); }
private void AddSquasher(GameObject target) { Squasher squasher = target.AddComponent <Squasher>(); squasher.Target = MapPointer.transform; squasher.Near = SquashNear; squasher.Far = SquashFar; squasher.MaximumSquashing = MaximumSquash; }
/// <summary> /// Adds a Squasher MonoBehaviour to the supplied GameObject. /// </summary> /// <remarks> /// The Squasher MonoBehaviour reduced the vertical scale of the GameObject's transform when a /// certain object is nearby. /// </remarks> /// <param name="go">The GameObject to which to add the Squasher behaviour.</param> private void AddSquasher(GameObject go) { Squasher squasher = go.AddComponent <Squasher>(); squasher.Target = Avatar; squasher.Near = SquashNear; squasher.Far = SquashFar; squasher.MaximumSquashing = MaximumSquash; }
public async Task <IActionResult> Create([Bind("ID,Name")] Squasher squasher) { if (ModelState.IsValid) { _context.Add(squasher); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(squasher)); }
// Use this for initialization void Start() { uiElement = GetComponent <MaskableGraphic>(); startPos = transform.localPosition; if (game == null) { game = (GameManager)FindObjectOfType <GameManager>(); } squasher = GetComponent <Squasher>(); rotator = GetComponent <SinRotate>(); rotator.enabled = false; }
public static void Initialize(SquasherContext context) { context.Database.EnsureCreated(); if (context.Bugs.Any()) { return; // DB has been seeded } var bugs = new Bug[] { new Bug { Title = "NavBar Update", Description = "The NavBar needs updating", Severity = "High" }, new Bug { Title = "Home link", Description = "The home link on the about page doesn't work", Severity = "Mid" }, new Bug { Title = "Typos", Description = "The Bugs Feed page has types", Severity = "High" }, new Bug { Title = "Post Error", Description = "The create new bug page is not posting to database", Severity = "High" }, new Bug { Title = "Style changes", Description = "The site needs style changes", Severity = "low" } }; foreach (Bug b in bugs) { context.Bugs.Add(b); } context.SaveChanges(); var projects = new Project[] { new Project { Name = "Squasher" }, new Project { Name = "Fizikel" }, new Project { Name = "Todo" }, new Project { Name = "SquasherXamarin" }, }; foreach (Project p in projects) { context.Projects.Add(p); } context.SaveChanges(); var squashers = new Squasher[] { new Squasher { Name = "Jake" }, new Squasher { Name = "KT" }, new Squasher { Name = "Brian" }, new Squasher { Name = "Amos" }, }; foreach (Squasher s in squashers) { context.Squashers.Add(s); } context.SaveChanges(); }