public IHttpActionResult PutColorTab(int id, ColorTab colorTab) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != colorTab.Id) { return(BadRequest()); } db.Entry(colorTab).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ColorTabExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetColorTab(int id) { ColorTab colorTab = db.ColorTabs.Find(id); if (colorTab == null) { return(NotFound()); } return(Ok(colorTab)); }
public IHttpActionResult PostColorTab(ColorTab colorTab) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.ColorTabs.Add(colorTab); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = colorTab.Id }, colorTab)); }
public IHttpActionResult DeleteColorTab(int id) { ColorTab colorTab = db.ColorTabs.Find(id); if (colorTab == null) { return(NotFound()); } db.ColorTabs.Remove(colorTab); db.SaveChanges(); return(Ok(colorTab)); }
void Start() { //find player _player = GameObject.Find("player").GetComponent <Player>(); //init active tab _activeTab = _tabs[_tabCounter]; _activeTab.transform.localScale = _upScale; _activeTab.Label.gameObject.SetActive(true); //find meters _r = GameObject.Find("R").GetComponent <ColorMeter>(); _g = GameObject.Find("G").GetComponent <ColorMeter>(); _b = GameObject.Find("B").GetComponent <ColorMeter>(); }
//go through the tabs after spinning public void UpdateWheel(int _dir) { //increase index and reset if necessary _tabCounter += _dir; if (_tabCounter == _tabs.Length) { _tabCounter = 0; } else if (_tabCounter == -1) { _tabCounter = _tabs.Length - 1; } //change scales _activeTab.transform.localScale = _normalScale; _activeTab.Label.gameObject.SetActive(false); //update active tab _activeTab = _tabs[_tabCounter]; //change scales _activeTab.transform.localScale = _upScale; _activeTab.Label.gameObject.SetActive(true); }